VSC Remote - SSH extension

Edit code on your Remote Workstation with "Visual Studio Code Remote - SSH extension"

You work on a remote workstation, so the code for themes is not on your local machine, but on the remote sandbox of your workstation.

Visual Studio Code has a plugin Remote-SSH to develop remotely. There are many resources online to use Remote-SSH extension, for example:

1 - Install the extension

Install the extension "Remote-SSH"

If you are not familiar with installing VSC extensions, you can learn more on the official Visual Studio Code documentation: Extension Marketplace.

2 - Setup your SSH Config file

After installing the extension, we can add the configuration to connect to the Remote Workstation.

The extension has added a new button to the bottom left of your VSC window (see screenshot). Click on it, and you will have a command palette with the option "Open SSH Configuration file"

After selecting the option, it might as you to choose which configuration file to open. If this is the case, you should use the file in your user directory.

Select the file, and it will open the configuration file, add the following code

Host my_remote_workstation
  Hostname my-alias.tc.exo7d.us
  User user
  Port 2222
  IdentityFile /location/of/your/private/key
  RequestTTY yes
  ForwardAgent yes
  AddKeysToAgent yes

Here you need to edit 2 information

  • Hostname: use the hostname provided in the backoffice (See my configuration)

  • IdentityFile: path to your SSH private key on your locale machine

After saving the file, you now have the correct configuration to edit code!

3 - Connect and edit code

Click again on the button and this time choose "Connect to Host"

The server you just configured will appear in the list, click on it and wait

On the Explorer Panel, you can click on "Open folder" to open your theme (themes are inside the folder integration)

4 - Performances

The extension is known to use heavily the resources of the server.

In the past, we advised disabling the builtin extension "TypeScript and JavaScript Language Features", we found a better alternative in this comment:

https://github.com/microsoft/vscode-remote-release/issues/2692#issuecomment-1172915688

The idea is to tell VSC to run the extension "TypeScript and JavaScript Language Features" on your local machine instead of the remote server.

To do this, edit the settings.json file (read official documentation to open it) and add the following lines:

"remote.extensionKind": {
    "vscode.typescript-language-features": ["ui"]
}

This should be way better for performances of Visual Studio Code when used remotely.

Note: when working remotely, you will have Partial IntelliSense mode.

Last updated