Running VS Code (Server) on a Quest Compute Node

VS Code Server allows Quest users to run VS Code on the Quest compute nodes access it in through browser.

If you're running into an issue with the desktop version of VS Code having difficulties connecting remotely to Quest, please update your desktop version.  VS Code pushed out a previous version which broke this capability and promptly rolled out a patch to fix the issue.


VS Code Server can be launched and run on a Quest compute node through an interactive job or batch job on Quest.

To schedule the interactive job from the command line on Quest, ssh into a Quest log-in node and type:

srun -A <allocation_name> -p <queue_name> -N 1 --ntasks-per-node=1 --mem-per-cpu=4G --time=04:00:00 --pty bash -l

This example requests a single core for a 4 hour job. Substitute an active allocation name and queue name, for example if using allocation p12345 this might be:

srun -A p12345 -p short -N 1 --ntasks-per-node=1 --mem-per-cpu=4G --time=04:00:00 --pty bash -l

Note that the more cores requested, the longer the wait for the interactive session to start. Do not request more than 1 node for VS Code Server sessions.

Once the session begins, get the name of the compute node that you were scheduled to by running the command hostname, e.g.,

$ hostname

Next load the VS Code Server module, vscode-server/4.12.0, which will display to you a short hand version of the instructions that you see here.

[qnode0372 ~]$ module load vscode-server/4.12.0
If you have not already done so, make sure you are running and interactive or
batch job.

Once you are sure that you are running a batch or interactive Slurm job, execute
the command `vscode-server <port_number>` where <port_number> should be a value
between 7000 and 8000.

Next, open a new terminal window *on your local computer* and based on the port
number and the compute node that VSCode Server is running on, you will then
tunnel to the server using the command:

`ssh -L <port_number>:localhost:<port_number> <your_netID> ssh -N -L <port_number>:localhost:<port_number> qnode<number>` 

filling in the appropriate value for <port_number> and <compute_node>

Finally, in your *local browser* you can then put in the URL
`localhost:<port_number>` and connect to your VSCode Server session *where you
will be asked for a password*.

The VSCode Server password can be found be *connecting to Quest* and running
`cat ~/.config/code-server/config.yaml` and copying and pasting th value for
`password:` in this file. 

Once VS Code Server is running on the compute node, open a new terminal window on your local computer, and type:

ssh -L <port_number>:localhost:<port_number> <your_netID> ssh -N -L <port_number>:localhost:<port_number> qnode<number>

In the command template above, be sure to replace <your_netID> with your netID, replace qnode<number> with the name of the compute node, and replace all <port_number> instances with the port number between 7000 and 8000 that you selected. You will be prompted for your Quest password, which will not return a prompt.

On your local computer, open up your browser and connect to http://localhost:<port_number>/. Your browser is now connected to the VSCode Server session running on Quest and you will be asked for a password.

The VS Code Server password can be found be connecting to Quest and running cat ~/.config/code-server/config.yaml and copying and pasting the value in the password: section in this file.

Note that your VS Code Server session will quit abruptly when the walltime of the interactive job comes to an end. Save often and be aware of walltime to avoid losing your work.

Was this helpful?
0 reviews


Article ID: 2317
Wed 5/17/23 2:37 PM
Mon 2/19/24 2:08 PM

Related Articles (3)

This article demonstrates how a user can run RStudio Server on a Quest compute node through a Slurm interactive or batch job.

Related Services / Offerings (1)

Quest, Quest Analytics Nodes, Kellogg Linux Cluster (KLC), and Genomics Compute Cluster (GCC).