Remote Debugging with VS Code
- In VS Code, click on Remote Explorer on the left panel
2. Open your SSH config file by clicking on the button "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)
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
).
5. Save the file. A new host with name oaks-debug
should have appeared in the left pannel, under SSH:
6. Click on the "Connect in New Window..." icon:
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!