Monday, 10 February 2025
DevOps How To's Recent Post

Visual Studio Code Remote – SSH

Visual Studio Code Remote – SSH

The Remote – SSH extension lets you use any remote machine with a SSH server as your development environment. This can greatly simplify development and troubleshooting in a wide variety of situations. You can:

  • Develop on the same operating system you deploy to or use larger, faster, or more specialized hardware than your local machine.
  • Quickly swap between different, remote development environments and safely make updates without worrying about impacting your local machine.
  • Access an existing development environment from multiple machines or locations.
  • Debug an application running somewhere else such as a customer site or in the cloud.

SSH Host Requirements

You can connect to a running SSH server on the following platforms.

Supported:

  • x86_64 Debian 8+, Ubuntu 16.04+, CentOS / RHEL 7+ Linux.
  • ARMv7l (AArch32) Raspbian Stretch/9+ (32-bit).
  • ARMv8l (AArch64) Ubuntu 18.04+ (64-bit).
  • Windows 10 / Server 2016/2019 (1803+) using the official OpenSSH Server.
  • macOS 10.14+ (Mojave) SSH hosts with Remote Login enabled.

Other glibc based Linux distributions for x86_64, ARMv7l (AArch32), and ARMv8l (AArch64) should work if they have the needed prerequisites. See the Remote Development with Linux article for information prerequisites and tips for getting community supported distributions up and running.

While ARMv7l (AArch32) and ARMv8l (AArch64) support is available, some extensions installed on these devices may not work due to the use of x86 native code in the extension.

 

Installation

  1. Install VS Code or VS Code – Insiders and this extension.
  2. Install an OpenSSH compatible SSH client.
  3. If you do not have a SSH host set up, follow the directions for LinuxWindows 10 / Server (1803+), or macOS or create a VM on Azure.

Visual Studio Code Remote – SSH

The Remote – SSH extension lets you use any remote machine with a SSH server as your development environment. This can greatly simplify development and troubleshooting in a wide variety of situations. You can:

  • Develop on the same operating system you deploy to or use larger, faster, or more specialized hardware than your local machine.
  • Quickly swap between different, remote development environments and safely make updates without worrying about impacting your local machine.
  • Access an existing development environment from multiple machines or locations.
  • Debug an application running somewhere else such as a customer site or in the cloud.

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. You can open any folder on the remote machine and work with it just as you would if the folder were on your own machine.

Remote SSH

SSH Host Requirements

You can connect to a running SSH server on the following platforms.

Supported:

  • x86_64 Debian 8+, Ubuntu 16.04+, CentOS / RHEL 7+ Linux.
  • ARMv7l (AArch32) Raspbian Stretch/9+ (32-bit).
  • ARMv8l (AArch64) Ubuntu 18.04+ (64-bit).
  • Windows 10 / Server 2016/2019 (1803+) using the official OpenSSH Server.
  • macOS 10.14+ (Mojave) SSH hosts with Remote Login enabled.

Other glibc based Linux distributions for x86_64, ARMv7l (AArch32), and ARMv8l (AArch64) should work if they have the needed prerequisites. See the Remote Development with Linux article for information prerequisites and tips for getting community supported distributions up and running.

While ARMv7l (AArch32) and ARMv8l (AArch64) support is available, some extensions installed on these devices may not work due to the use of x86 native code in the extension.

Installation

  1. Install VS Code or VS Code – Insiders and this extension.
  2. Install an OpenSSH compatible SSH client.
  3. If you do not have a SSH host set up, follow the directions for LinuxWindows 10 / Server (1803+), or macOS or create a VM on Azure.

Getting started

Follow the step-by-step tutorial or if you have a simple SSH host setup, connect to it as follows:

  1. Press F1 and run the Remote-SSH: Open SSH Host… command.
  2. Enter your user and host/IP in the following format in the input box that appears and press enter: user@host-or-ip or user@domain@host-or-ip
  3. If prompted, enter your password (but we suggest setting up key based authentication).
  4. After you are connected, use File > Open Folder to open a folder on the host.

You can press F1 to bring up the Command Palette and type in Remote-SSH for a full list of available commands.

Command palette

You can also click on the Remote “Quick Access” status bar item in the lower left corner to get a list of the most common commands.

Quick actions status bar item

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. You can open any folder on the remote machine and work with it just as you would if the folder were on your own machine.

Post Comment