-
Notifications
You must be signed in to change notification settings - Fork 0
Remote SSH
The Remote-SSH extension lets us use a remote machine as our development environment while running VS Code locally. The source code is located on the remote machine.
We are assuming the following tasks have been done beforehand:
- The remote host that we want to connect to is defined in the local SSH configuration file
~/.ssh/config
. - The toy repository has been cloned and set up on the remote machine as described in Basic VS Code setup.
To install/enable the extension, follow the same steps as in the previous sections.
To establish a connection to the remote machine,
- Run
>Remote-SSH: Connect to Host...
- Select your host from the pop up window (
workstation
in our case)
This opens a new VS Code window that is connected to the remote host (see bottom left corner):
In our case it shows SSH: workstation
since workstation
is the name of our remote host.
Just like we did in the previous sections, we can install extensions on the remote machine.
- Go to
Extensions
in the activity bar
VS Code shows you all the extensions which are installed locally and on the remote machine. It will also disable certain local extensions if they cannot be used on the remote machine.
To install an extension remotely, simply select a greyed out local extension and click Install in SSH: workstation
:
To modify VS Code user settings on the remote machine,
- Run
>Preferences: Open Remote Settings (JSON) (SSH: workstation)
You can simply copy the contents of your local user settings to the remote file.
Note: Be careful to adjust all paths in case they don't make sense for the remote machine. Settings for extensions which are not installed remotely will simply be greyed out and ignored.