blog

Develop in the Cloud with Visual Studio Code

How to develop on remote cloud instances using Visual Studio Code.

Lawrence Murray 13 January 2023

Visual Studio Code can connect to a remote machine via SSH to provide an ergonomic development environment. The explorer allows browsing files remotely, and terminals allow running commands remotely. A particular convenience is that Code will automatically import credentials for you, to allow convenient interaction with e.g. GitHub repositories.

You will need to know the 👤user and 🏠host of the remote instance to which to connect. It will also need to be set up with a 🔑key or ✳️password that you can use to access it. If you are interested in developing on a GPU instance in particular, see the roundup of cloud service providers.

  1. Install Visual Studio Code
    Instructions are available at the Visual Studio Code website.
  2. Install the SSH extension
    Click the Extensions icon on the left. Type ssh into the search box. Find Remote - SSH from Microsoft (likely the first) and click the Install button next to it.
  3. Connect to your instance
    After installing the SSH extension, a new icon appears in the bottom left; click on it. A menu will appear at the top of the window. Select Connect to Host… then enter your 👤user and 🏠host into the textbox in the form [email protected] and hit Enter. A new window will open for the remote connection. If this is the first login for the instance, you may be prompted with “Host has fingerprint… Are you sure you want to continue?”; this is normal, click Continue. If you are using a ✳️password, you may be prompted to enter it.
  4. Setup your workspace
    On the left, click Open Folder and select a working directory to enable the file browser. From the menu, select Terminal > New Terminal to open a terminal, or use the keyboard shortcut Ctrl + `.

The screen recording below demonstrates the steps. For more information see the Visual Studio Code documentation.

Screen recording demonstrating how to connect to a remote instance via SSH in Visual Studio Code.

blog Related
GPU Programming in the Cloud

A how-to and round-up of cloud service providers.

Lawrence Murray

22 Nov 22

blog Related
Responsive Images with Jekyll and ImageMagick

Step by step through the HTML, ImageMagick and Ruby. Works with Jekyll 4.

Lawrence Murray

30 Oct 22

blog Next
Profile in the Cloud with Nsight Systems

How to profile CUDA code on cloud GPU instances using Nsight Systems.

Lawrence Murray

13 Jan 23

photography Previous
Chiang Mai Mood
1

23 Dec 22