Skip to content

Remote Debugging with VS Code

  1. In VS Code, click on Remote Explorer on the left panel

remote_explorer

2. Open your SSH config file by clicking on the button "Open SSH Config File"

open_ssh_config_file

3. A dropdown menu should appear at the top of your VS Code window : type in the path to your SSH config file (or select from the paths displayed)

config_path

4. Now the file is opened in VS Code, simply add the required information:

Host oaks-debug
  HostName {nodename}
  User {username}
  Port {port}
  IdentityFile {path/to/your/ssh_private_key}

Do not forget to replace {nodename} with the node on which you started the sshd service. Add your username and the port you chose when starting the sshd service. Eventually, add the path to your private ssh key after IdentifyFile (should look something like ~/.ssh/id_rsa).

remote_debug_config_file

5. Save the file. A new host with name oaks-debug should have appeared in the left pannel, under SSH:

new_ssh_host

6. Click on the "Connect in New Window..." icon:

connect_in_new_window

A new window will pop up. VS Code will run some installation in the background. It may take some time (a few minutes) if it's the first time you follow this tutorial. Once ready, you can open the embedded terminal: you should see the name of the node you're using for debugging. If so, you're in the container!