Remote Development using VS Code & SSH - TeamHaircut/CAH GitHub Wiki

Remote Development using SSH

The Visual Studio Code Remote - SSH extension allows you to open a remote folder on any remote machine, virtual machine, or container with a running SSH server and take full advantage of VS Code's feature set. Once connected to a server, you can interact with files and folders anywhere on the remote filesystem.

No source code needs to be on your local machine to gain these benefits since the extension runs commands and other extensions directly on the remote machine.

This lets VS Code provide a local-quality development experience — including full IntelliSense (completions), code navigation, and debugging — regardless of where your code is hosted.

Getting started

Installation

To get started, you need to:

1. Install an OpenSSH compatible SSH client if one is not already present.

  1. Install Visual Studio Code.

  2. Install the Remote Development extension pack.

Connect to a remote host

To connect to a remote host for the first time, follow these steps:

  1. In VS Code, press select F1 to open the Command Palette, then type Remote-SSH: Connect to Host...

  2. enter ssh username@host to access the remote server. When prompted enter your server password.

  3. If VS Code cannot automatically detect the type of server you are connecting to, you will be asked to select the type manually.

    Choose Linux

  4. After a moment, VS Code will connect to the SSH server and set itself up. VS Code will keep you up-to-date using a progress notification and you can see a detailed log in the Remote - SSH output channel.

  5. After you are connected, you'll be in an empty window. You can always refer to the Status bar to see which host you are connected to.

    Clicking on the Status bar item will provide a list of remote commands while you are connected.

  6. You can then open any folder or workspace on the remote machine using File > Open... or File > Open Workspace... just as you would locally!

From here start editing!