# Use Remote SSH in Visual Studio Code

In this tutorial, we will take you through the steps required to connect Visual Studio Code on your local machine to a remote cnvrg workspace.

# Requirements

You must have the following installed on your local machine:

# Guide

  1. Go to your project's Workspaces tab and launch any workspace type inside cnvrg. Wait for the setup to complete.
  2. On your local machine, run the command cnvrg ssh start workspace_id in a terminal session.

TIP

The workspace_id can be found in the URL for the workspace.

For example, if your workspace is live at https://app.cnvrg.io/acme/projects/recommender/notebook_sessions/show/ekqjsnzerv9x5t62y7yd, then the workspace_id would be ekqjsnzerv9x5t62y7yd.

The corresponding example command would be: cnvrg ssh start ekqjsnzerv9x5t62y7yd.

  1. Wait for ssh to start. During this time, cnvrg will automatically install the requirements in the workspace. When it has started, the command will tell you the host, port, username and password for the SSH session.

  1. In your local Visual Studio Code, open the Extensions tab and add the extension Remote - SSH.

  1. Open the Command Palette. Search for SSH. Click Remote-SSH: Add New SSH Host....

  1. Enter the SSH command based on what cnvrg ssh start has told you: ssh user@localhost -p <port>

  1. You may be prompted to choose which ssh config file to update. Choose the relevant config file from the list.

  1. Go to the Remote - SSH tab of Visual Studio Code and connect to the newly added SSH host from your IDE.

  1. You will be prompted for the password.

  1. Congratulations, you will now have connected to the remote workspace! However, we should now set the correct folder to access the remote files.
  2. Click Open Folder.

  1. Set the path as /cnvrg.

  1. You will be prompted to re-enter the password.

  1. Now you are done! You can access the files and use your remote compute, right from your local Visual Studio Code.

Last Updated: 4/22/2021, 4:12:42 PM