# Visual Studio Code (remote)

VS Code (opens new window) is a source-code editor made by Microsoft that supports features such as debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. Lab users may for example use VSCode to run GPU accelerators inside their labs.

# Connecting to IaaS machine from your local machine

This guide describes a setup where you use VSCode installed on your local computer to connect and analyze data that is located inside a lab machine in HUNT Cloud.

# Requirements

Requirements

To complete this guide, you will need (1) VS Code (opens new window) installed on your local computer, and (2) a running IAAS machine inside your lab, your local (3) SSH configuration file.

Without these your will not be able to complete this guide.

# 1. Local computer configuration

Connection to your lab machine requires two adjustments to your local VSCode installation:

# 1.1 Add required extension

You will need to install the Remote-SSH extension to the VSCode on your local computer. This is required to successfully connect to your lab machine over ssh.

  1. Open VSCode on your local computer
  2. Inside VSCode, launch VSCode Quick Open Ctrl+P or if on mac CMD+P
  3. Paste the following command and press enter:
ext install ms-vscode-remote.remote-ssh

Alternatively, open the VSCode Remote SSH (opens new window) page directly, or identify the package in the extension marketsplace (opens new window) and follow the installation instructions.

# 1.2 Configure your local .ssh config file

This step configures the .ssh configuration file on your local computer.

# macOS
  1. Access VSCode command palette by shortuct โ‡งโŒ˜P (CMD+shift+P), or selecting View --> Command Palette.

mvscode1

  1. A command pallete should pop-up. Type in the following text and press enter:
 Remote-SSH: Open SSH Configuration file

mvscode2

  1. Select config file, f.e. /Users/username/.ssh/config from the list.

mvscode3

  1. With a little bit of luck, a window with your local ssh configuration file should open in VScode.

mvscode4

  1. In the new window, paste your IAAS ssh-config.txt file which you have received from us. You can order a new SSH configuration file in the service desk (opens new window).

  2. Save your changes before you continue to the next step.

# Windows
  1. Access VSCode command palette by shortcut CTRL+SHIFT+P, or selecting View --> Command Palette.

  2. A command pallete should pop-up. Type in the following text and press enter:

 Remote-SSH: Open SSH Configuration file

mvscode2

  1. Select config file, f.e. C:\Users\username\.ssh\config from the list.

wvscode9

  1. With a little bit of luck, a window with your local ssh configuration file should open in VScode.

  2. In the new window, paste your IAAS ssh-config.txt file which you have received from us. You can order a new SSH configuration file in the service desk (opens new window).

mvscode4

  1. Save your changes before you continue to the next step.
# Linux

See macOS guide.

# 2. Connect to your lab machine

This section establishes a connection between your local computer and your IAAS lab machine.

2.1 In command palette (see above), type Remote-SSH: Connect to Host and select it from the drop-down list.

vscode5

A list of connections from your .ssh/config file should appear in drop-down list.

2.2 Select your desired IAAS or blue machine from the list and press enter.

A new window will open and after a short moment you should be prompted for your IAAS machine password.

2.3 Insert your IAAS password.

vscode6

2.4 On the left side of the window, select Explorer (opens new window).

vscode7

You should see an option to Open Folder.

2.5 Click on the "Open Folder" button, keep default path /home/<username>, or select your preferred path. Type IAAS machine password once more when prompted.

vscode8

If all is fine, you should now see your lab machine files and selected directory.

Happy coding!

# Troubleshooting

Stumbled upon an issue and cannot find a solution here ? Get in touch with us on slack or through general request contact form.

Last Updated: 10/28/2024