VSCode

VSCode is a popular source-code editor by Microsoft.

Using VSCode installed on your PC/laptop

We recommend that you install VSCode on your PC/laptop and use the Remote - SSH extension to connect VSCode to the CSF. You can then edit files stored on the CSF using your local copy of VSCode. This will give a better experience when using VSCode and allows you to install the latest version.

VSCode 1.90.2 (and newer) now works with the CSF. The “SSH Extension” in VSCode will warn that it is about to connect to a system with an unsupported Operating System. But it is safe to proceed.
VSCode warning about unsupported OS

Older versions of VSCode do not work on the CSF – please use 1.90.2 or newer.

Configure VSCode Before Connecting to the CSF

Before we setup the connection to the CSF, please do the following configuration in your local VS Code installation. This will help to reduce the CPU usage on the CSF login nodes. Otherwise, your VSCode usage will slow down the CSF for other users.

  1. Open the File > Preferences > Settings panel (or use the shortcut Ctrl+,).
    VS Code Settings Tab
  2. In the search bar at the top, enter the following string: search.follow
    Search for search.follow in the search bar.
  3. UNTICK the Follow Symlinks option. This will reduce the amount of file search that VSCode performs on the CSF login node.
    Untick the Follow Symlinks option.

You can then close the settings tab and proceed with the steps below to install the Remote SSH extension.

Installing the VSCode “Remote – SSH” extension on your PC/Laptop

You must install the Remote - SSH extension in to your local copy of VSCode on your PC/laptop.

Then, in the Extension Settings, ensure the following are ticked:

# Tick / enable the following options
Remote.SSH: Enable Agent Forwarding
Remote.SSH: Enable Dynamic Forwarding
Remote.SSH: Enable X11 Forwarding
Remote.SSH: External SSH_ASKPASS
Remote.SSH: Local Server Download -- Set to 'always' in the drop-down menu
Remote.SSH: Show Login Terminal
Remote.SSH: Use Flock
Remote.SSH: Use Local Server

The CSF password and DUO 2FA prompt will appear in the Login Terminal window inside VSCode. You must ensure you have ticked remote.SSH.showLoginTerminal in the above list.

The first time VSCode connects to the CSF, it will install some software in a ~/.vscode-server directory in your CSF home directory. By ticking the Remote.SSH: Use Local Server option above, it will do this download on your local PC/laptop then transfer the files to the CSF. If you see any errors relating to wget then VSCode is trying to do the download on the CSF login node, and this will not work. Please check that you have the above list of options selected in your VSCode config.

If you are unable to install VSCode on your PC/laptop, then there is a version installed directly on the CSF – v1.48. However, we are unlikely to update this version.

Using the VSCode installed on the CSF

Note that is NOT the recommended method. It is better to install VSCode on your PC/laptop and use the “SSH Connection” module to allow it to login to the CSF (see above.) The version installed on the CSF will be removed in future.

To use the VSCode installed on the CSF, you will need to connect to the CSF with X11 functionality enabled. If you have logged in using MobaXterm on Windows this will have been done automatically for you – proceed with the instructions below. If on MacOS-X or Linux, check you have logged in correctly.

To run VSCode, do the following commands on the command line:

module load apps/binapps/vscode/1.48
code

If you’re compiling code with VSCode, please use an interactive job, for example a 4 core interactive job:

module load apps/binapps/vscode/1.48
qrsh -l short -pe smp.pe 4 code

Last modified on January 22, 2025 at 11:50 am by George Leaver