« Previous 1 2 3 4 Next »
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.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)