Skip to content

Instantly share code, notes, and snippets.

@matchaxnb
Created April 7, 2023 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matchaxnb/2ddd7470d9bb4c4213b2a10962c83916 to your computer and use it in GitHub Desktop.
Save matchaxnb/2ddd7470d9bb4c4213b2a10962c83916 to your computer and use it in GitHub Desktop.
Using VS Code on WSL2 from another machine

Using VS Code on WSL2 from another machine

This has become a problem since Microsoft Store apps can't be executed from session 0, i.e. not from a SSH session. Pity.

Fortunately, there's the Remote Tunnel option.

To use it, download the VS Code server and run it on your machine as follows:

./code tunnel

It will ask for a connection to GitHub, which you certainly have. Then it will allow you to tunnel to your remote machine without a SSH hack.

This gives you a near-native experience for running VS Code.

For example, I'm working on machine learning models that make use of CUDA from my small laptop that would not support it at all. This works thanks to my connecting to that remote WSL 2 instance.

Have fun :) m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment