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 v1.86 no longer works with the CSF. The “SSH Extension” in VSCode is unable to login to the CSF. Microsoft have increased the minimum version required for some system libraries on the CSF (namely GLIBC v2.28.) The current OS on the CSF does not provide this version.

We recommend that you do not upgrade your local installation of VS Code beyond v1.85 if you need to connect it to the CSF.

If we find a workaround or there’s a change in policy from Microsoft, we will provide further details.

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:

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.)

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 March 15, 2024 at 2:52 pm by George Leaver