5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Codespacesの利用枠が足りない??それなら、VScode Tunnelを使えばいいじゃない。

Posted at

非力なPCで作業をしたり、ローカルを汚さずにちょっとした作業をしたい時、複数のデバイスを跨いで開発をしたい時にGitHubのCodespacesが重宝します。ところでみなさん、Codespacesの利用枠、足りてますか?

私は、足りていません。
image.png

毎月の利用枠があまりにも早く消え去っていくことを嘆いていると、通りすがりの@taichanからVisual Studio Code Tunnelのことを教えて頂きました。

Visual Studio Code Tunnelとは

公式ドキュメントによると、

The Visual Studio Code Remote - Tunnels extension lets you connect to a remote machine, like a desktop PC or virtual machine (VM), via a secure tunnel. You can connect to that machine from a VS Code client anywhere, without the requirement of SSH.

らしいです。要するに自前環境でCodespaces的なことができるみたい。

使ってみる

今回用意した環境はこんな感じ。
image.png


以下のコマンドで、インストールを行います。

curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
tar -xf vscode_cli.tar.gz

実行権限を与えて、

chmod +x ./code

そして起動

./code tunnel --accept-server-license-terms

ここまで完了するとターミナルには接続するためのURLが表示されます。
image.png
拡張機能を用いることで、デスクトップ版のVScodeからも接続が可能です。
image.png

これでCodespacesとほぼ同等の遜色ない環境が構築できました!
よい開発ライフを!

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?