Differences between revisions 3 and 4
Revision 3 as of 2022-06-13 14:02:29
Size: 1778
Editor: stroth
Comment: Remove unused example; Add info about application data path
Revision 4 as of 2022-06-20 19:29:17
Size: 2030
Editor: stroth
Comment: Clarify possibility to connect to the openvscode-server URL from within the ETH network
Deletions are marked like this. Additions are marked like this.
Line 21: Line 21:
Connecting your web browser to the URL `http://<OVS_HOST>:<random port>/?tkn=01234567-89ab-cdef-0123-456789abcdef` shown at the end of the output from `openvscode-server` is possible from anywhere within the ETH network or while connected to it by VPN.

Run Visual Studio Code as a service on a remote host

Two SEPP software packages of Visual Studio Code are available:

  • Code, started from the command line with code, the desktop application

  • OpenVSCode Server, started from the command line with openvscode-server, the web application

This article explains how to start openvscode-server as a service on a remote PC or cluster node and connect to it with a web browser.
A typical use case is to start it within a cluster job for debugging.

Use case: Start openvscode-server in an interactive Slurm job

Within an interactive shell in a Slurm job, issue the following command:

OVS_HOST=$(hostname -f) && openvscode-server --host $OVS_HOST --accept-server-license-terms --telemetry-level off |sed "s/localhost/$OVS_HOST/g"

The output of openvscode-server will tell you the URL to access the web-based Code editor:

Server bound to <public ip of OVS_HOST>:<random port> (IPv4)
Extension host agent listening on <random port>

Web UI available at http://<OVS_HOST>:<random port>/?tkn=01234567-89ab-cdef-0123-456789abcdef

Connecting your web browser to the URL http://<OVS_HOST>:<random port>/?tkn=01234567-89ab-cdef-0123-456789abcdef shown at the end of the output from openvscode-server is possible from anywhere within the ETH network or while connected to it by VPN.

VSCode data

OpenVSCode Server stores it's data in $HOME/.openvscode-server, separated from the VSCode desktop application which stores it's data in $HOME/.vscode. Both store their extensions in the subdirectory extensions.

The example token 01234567-89ab-cdef-0123-456789abcdef is saved in $HOME/.openvscode-server/data/token and will be re-used at future starts of openvscode-server.

FAQ/VS-Code_Server (last edited 2022-06-21 08:42:05 by stroth)