Visual Studio Code (often abbreviated as VS Code) is a free and open-source code editor developed by Microsoft.
VS Code has an Remote-SSH extension that allows you to remotely connect to and work on a remote server over SSH. This extension is helpful for developing and editing code on a remote system without leaving the VSCode environment.
VS Code Server is a service that allows users to run VS Code on a remote server and access it via a web browser.
This user guide describes three methods for using VS Code with the Berzelius supercomputer:
Option 1 and Option 3 allow users to start VS Code directly on a compute node.
We have a VS Code module on Berzelius. After connecting to Berzelius via Thinlinc, you can load the module and run VS Code by
module load VSCode/latest-bdist
XDG_RUNTIME_DIR=~/.vscode/runtime code /your/working/dir
Make sure that the directory ~/.vscode/runtime
exists.
Follow the instructions and install VS Code on your local computer.
Click the Extensions tab in the left side panel. Search for “Remote-SSH” and install the extension.
Once it’s installed a new tab (Remote Explorer) will appear on the side panel.
Click the Remote Explorer tab in the left side panel.
Press the plus (+) in the Remote Explorer tab to add a new ssh connection to Berzelius.
Input the ssh connection command.
Update the SSH configuration file. Just hit enter to make the updates. You only need to do it once.
Click the refresh icon in the Remote Explorer and you will see the new SSH connection.
Click “Connect in Current Window..” and Input your password and verification code.
Now you are connected to Berzelius.
You can use the Explorer tab to open your directory on Berzelius.
Click Explorer → Open Folder → Input your directory path. You need to input your password and verification code again.
You can have a terminal on Berzelius by clicking Terminal → New Terminal on the top menu bar.
You can terminate the ssh connection by clicking File → Close Remote Connection on the top menu bar.
We have a module of VS Code Server on Berzelius. You can load the module by
module load VSCode-Server/latest-bdist
With an interactive session, execute the command on a compute node node0xy to start VS Code
code-server --bind-addr node0xy:9988 ./your/working/dir
The port 9988 is arbitrary. If 9988 is already in use, then just try 9989, etc.
Open a local terminal, make a SSH tunnel login:
ssh -N -L localhost:9988:node0xy:9988 <your username>@berzelius1.nsc.liu.se
Start your favorite browser on your local computer, paste the following URL given by VS Code Server on Berzelius:
http://localhost:9988
The VS Code Server password can be found at /home/<your username>/.config/code-server/config.yaml
.
Guides, documentation and FAQ.
Applying for projects and login accounts.