Secure remote connectivity with VS Code for the Web

Tunnel Tech

Bouncing VS Code Server

In some instances you might need to restart the VS Code Server process. By bouncing the tunnel and monitoring the logs, you will observe that this action initiates a new connection to vscode.dev. This process will also produce log messages that display the vscode.dev URL.

As previously mentioned, you can use systemctl commands to manage the service. To restart the service and check the service status, extracting the specific URL of the web-based tunnel, use:

systemctl --user restart code-tunnel.service
systemctl --user status code-tunnel.service | grep vscode.dev

On restarting the service, the console will display the link, typically formatted as https://vscode.dev/tunnel.

VS Code Server Hidden Parts

Like SSH remote tunneling, web-based tunneling methods also use hidden subdirectories for VS Code Server installation and runtime hosting. Initializing VS Code Server for the first time creates hidden subdirectories in the filesystem named .vscode-server and .vscode. In this context, the main subdirectory path that houses the server components is:

.vscode/cli/servers/Stable-<40-char-hash>

If you have opted for an Insiders edition of Visual Code (i.e., the nightly build), the child server subdirectory will begin with the Insiders prefix.

A breakdown of the directory structure is:

Additionally, a hidden subdirectory called .vscode-server contains folders for data and extensions. Extensions added by the user will land in the extensions subdirectory:

Installing Extensions from the CLI

Although many users opt to install extensions in the Extensions pane of the VS Code for the Web UI, performing this task from the command line is also possible. To do so, start by determining the subdirectory location of the VS Code Server instance relevant to the user context:

which code-insiders
/home/kevin/.vscode-insiders/cli/servers/Insiders-c72447e8d8aaa7497c9a4bd68bc4301584b92beb/server/bin/remote-cli/code-insiders

The output provides the path, which includes a unique 40-character hash, indicating the location of the VS Code Server. Navigate to the directory as shown in the output:

cd /<path-to-directory>/code-insiders

Use the code-insiders command to install your desired extension. For instance, to install the Python extension for this specific user instance, use:

code-insiders --install-extension ms-python.python

Note that the installation of the ms-python.python extension will trigger the installation of Pylance. These extensions will land in the .vscode-server/extensions subdirectory.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Secure and seamless server access
    The powerful Cloudflare Tunnel provides secure and seamless access to servers and applications, making it a convenient alternative to VPN for any modern IT infrastructure.
  • Remote maintenance and automation with RPort
    Firewalls and network address translation often stand in the way of access to remote systems, but the free RPort software works around these obstacles and supports remote maintenance through a tunnel locally, in the cloud, and from your home office.
  • Secure your data channel with stunnel
    Stunnel provides a TLS wrapper with extensive configuration options to secure your data over insecure wireless networks.
  • Self-hosted remote support
    RustDesk supports self-hosted cross-platform remote support and maintenance. The client and optional basic server are open source and available free of charge.
  • SSH on Windows

    For Linux admins, SSH is one the most important tools of remote administration. SSH also works in Windows, with tools such as PuTTY or WinSSH, MobaXterm, WinSCP, or Swish.

comments powered by Disqus