Use compute nodes to connect from Visual Studio Code.
NOTE: Please avoid connecting directly to login nodes:
– idun-login1.hpc.ntnu.no
– idun-login2.hpc.ntnu.no
Running processing, compilation, …. will create issues for other IDUN users on login nodes.
– idun-login1.hpc.ntnu.no
– idun-login2.hpc.ntnu.no
Running processing, compilation, …. will create issues for other IDUN users on login nodes.
Allocate compute node for connection
Use command "salloc" to start job on a compute node. Example below will run:
- on 1 compute node
- will use 2 CPU cores and 4 GB memory
- job will jun for 10 hours.
[USERNAME@idun-login2 ~]$ salloc --account=support --nodes=1 --cpus-per-task=2 --mem=4G --partition=CPUQ --time=00:30:00
...
salloc: Nodes idun-02-25 are ready for job
Node idun-02-25 was allocated. This command can be users to connect compute node. You'll need to enter your password twice:
ssh -A -J USERNAME@idun-login2.hpc.ntnu.no USERNAME@idun-02-25
Install "Remote - SSH" extension
Open Extensions > Search for "Remote SSH" > Install
![](https://www.hpc.ntnu.no/wp-content/uploads/2024/04/vscode_install_extension-1024x564.png)
Connect
Click the connect icon in the left bottom corner. Click "Connect to Host... Remote-SSH"
![](https://www.hpc.ntnu.no/wp-content/uploads/2024/04/vscode_connect_host-1024x500.png)
Add host:
![](https://www.hpc.ntnu.no/wp-content/uploads/2024/04/vscode_add_host-1024x259.png)
Paste "ssh" command. Press Enter:
![](https://www.hpc.ntnu.no/wp-content/uploads/2024/04/vscode_ssh-1024x250.png)
Select a configuration file to save new connection. Press Enter:
![](https://www.hpc.ntnu.no/wp-content/uploads/2024/04/vscode_config-1024x302.png)
Connect
![](https://www.hpc.ntnu.no/wp-content/uploads/2024/04/vscode_connect-1024x496.png)
New windows will be opened. Enter your password two times. Press Enter.
![](https://www.hpc.ntnu.no/wp-content/uploads/2024/04/vscode_terminal-1024x580.png)