Skip to end of banner
Go to start of banner

Visual Studio Code for Remote Development

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Visual Studio Code is a popular free and open-source code editing application that can be deployed on Linux, macOS and Windows. It has an integrated terminal within its user interface that removes the need to switch between command-line tasks and code editing. The functionality of VS Code can easily be extended by installing extensions. These extensions allow for almost arbitrary language support, debugging or remote development.

Please refer to the Visual Studio HomePage (external site) to learn more about Visual Studio Code and for downloading and installation instructions. The default terminal shell is bash on Linux and macOS, and PowerShell on Windows. 

Windows users must install Git for Windows (external site) to then configure the default terminal shell to bash.

Although the integrated terminal on Visual Studio Code can be used directly to SSH login to Pawsey systems, the Remote Development extension pack provides the ability open remote directories and text files on Visual Studio Code for in-app code editing and building. The Remote Development extension pack is easily installed from the Marketplace within the application. There are instructions for downloading the Remove Development extension here. See also the instructions on the official web page Remote Development using SSH (external site).

After the standard installation procedure, you may also need to check the box for Remote.SSH: Lockfiles in Tmp, under Settings, in order to connect to Pawsey systems.

Preventing unexpected behaviour from Visual Studio Code

If you want to end your remote session, click the green box in the lower left corner. In the input box that opens, select the "Close Remote Connection" option. If you simply close your VS Code window, some server-side components of VS Code will continue to run remotely.


Figure 2. Example of Visual Studio Code screen feature that allows clean disconnection from SSH session.


If Visual Studio Code has left some related processes running on the login nodes, these may use CPU and prevent you from logging in to Setonix via Visual Studio Code. If you are unable to login to Setonix with Visual Studio Code, instead use a different command line interface such as Terminal to ssh into Setonix. From there you can you can identify any leftover Visual Studio Code processes using the 'ps' command. 


Leftover Visual Studio Code processed will take the form shown below, where the 40-character hex-string is randomly created for each process.

Terminal 2. Finding and killing unexpected VS Code processes
$ ps
PID TTY          TIME CMD

162952 pts/150  00:00:00 /home/<username>/.vscode-server/bin/695af097c7bd098fbf017ce3ac85e09bbc5dda06/node 

## To kill the process, use

$ kill -9 <PID>



We suggest that our users regularly check what processes they have running, and clean up any leftover processes that they know are no longer in use. If you find this still doesn't resolve the issue, you may need to purge the Visual Studio Code directory on Setonix using the following:

Terminal 3. Purging the VS Code files
$ rm -rf ~/.vscode-server/

Preventing Visual Studio Code overloading the login nodes

The Visual Studio Code filewatcher and file searcher (rg) indexes all the files you have access to in your workspace. If you have a large dataset (e.g. machine learning) this can take a lot of resources on the login nodes. Please note that making some changes to your settings.json file on Setonix can prevent this issue. 

Terminal 4. Updating the settings.json file
# Create the settings.json file

$ touch ~/.vscode-server/data/Machine/settings.json

# add the following information to settings.json with your favourite text editor

"files.watcherExclude": {
  "**/.git/objects/**": true,
  "**/.git/subtree-cache/**": true,     
  "**/node_modules/*/**": true,
  "/usr/local/**": true,
  "/scratch/**": true},

"search.followSymlinks": false,

"search.exclude": {     
  "**/.git/objects/**": true,
  "**/.git/subtree-cache/**": true,     
  "**/node_modules/*/**": true,
  "/usr/local/**": true,
  "/scratch/**": true},


  • No labels