14

I'm working in a network that has no direct internet connection.

I have VS Code on my desktop PC and I use the "Remote - SSH" extension (version 0.55) to do development on a Linux VM. It works very well.

From time to time I have need to install other Extensions into both the desktop VS Code (which is an easily accomplished using code --install-extension <path-to-vsix>) and also the Linux end of the "Remote - SSH" server.

My question is "under these circumstances, how do I correctly install Extensions into the Linux server?"

I will describe what I do, which partially works sometimes, but I have used this process to upgrade extensions and lost features (like coloring of output) so there must be something missing. I would like to know the missing step.

  1. Download the extension from an internet-connected computer. There is a "Download Extension" link on the Extension's page at marketplace.visualstudio.com/vscode. Copy it (however you can) onto your Linux development host.
  2. Copy the VSIX file to ~/.vscode-server/data/CachedExtensionVSIXs/ and rename the file by getting rid of the ".vsix" extension.
  3. Sometimes the extension becomes installable at this stage. I'm not sure what the differences are between cases when this has worked and when it sometimes doesn't work. At least it's worth trying --- go to VS Code, connect to your remote host, look in the Extensions panel and if you can install it from there, good for you. If it didn't work, close the connection to the Remote Host.
  4. Assuming that the previous step failed, you will need to unzip the VSIX and copy it into place. The following code uses the cmake-tools extension as an example.
cd /tmp
mkdir cmaketools && cd cmaketools
7z x -tzip ~/.vscode-server/data/CachedExtensionVSIXs/ms-vscode.cmake-tools-1.4.2
cd ~/.vscode-server/extensions/
mv /tmp/cmaketools/extension ms-vscode.cmake-tools-1.4.2
cd ms-vscode.cmake-tools-1.4.2/
cp /tmp/cmaketools/extension.vsixmanifest .vsixmanifest
2
  • 1
    download and upload the vsix file for the extension and use the Install from vsix command on the extension bar top menu Commented Sep 23, 2020 at 10:47
  • @rioV8 If you want, make this an answer and I will accept. You solved my problem. Commented Sep 23, 2020 at 13:16

3 Answers 3

16

You can download the extension from the Marketplace and upload the extensionvsix file to the remote.

In the remote VSC use the Install from VSIX... command on the Extension bar top menu.

Sign up to request clarification or add additional context in comments.

5 Comments

is there a way to do this from the command line ?
@filaton What does the doc page on command line say about this
not much, it doesn't mention anything about SSH (code.visualstudio.com/docs/editor/…)
@filaton Where do you expect the remote VSC to get the extension, you don't have internet, why should it mention SSH
sorry, in my use case, the remote has access to the internet. Basically I'm just looking for a way to reproduce the behavior of the "Install in SSH: <config_name>" button that you have when you search for extensions in an SSH remote.
7

If you want to install it from the command line on the remote:

  • get the name of the current server directory (easiest: connect to the remote workspace, then run ps -u $USER -o pid,ppid,user,pcpu,pmem,etime,args via the vscode terminal)
    This can get you, for example to
    /home/me/.codium-server/bin/8311b9c0ddd6ed7738146332e5a0629c76f17be3/bin/
  • execute the server runtime (in this case codium-server, often vscode-server) from this directory with the --install-extension <path-to-vsix> command

Comments

2

If you want to automate this with bash, then the path is (change ):

~/.vscode-server/bin/<commit-id>/bin/remote-cli/code

so to install extension would be something like:

~/.vscode-server/bin/<commit-id>/bin/remote-cli/code --install-extension </path/to/extension.vsix>

1 Comment

How is that different to the answer I gave below - other than a fixed name for the files and folders with an additional "replacement-commit-id"?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.