sc liu
sc liu

Reputation: 81

How do I install vscode-server offline on a server for VS Code version 1.82.0 or later?

In previous versions, it was sufficient to install the remote-ssh extension and then download the vscode-server-linux-x64.tar.gz file, extract it, and copy it to the server directory ~/.vscode-server/bin/${COMMIT}/,a as in this answer. However, it seems that this method is no longer effective for newer versions.

Does anyone know the method for offline installation of the new version on a server?

After upgrading to version 1.82.0 of VS Code on Windows, I tried to access an SSH server project directory that I had previously opened.

Upon clicking on the "Details" button in the progress dialog in the bottom right corner, and then navigating to the "Output" tab in the terminal pane, I discovered that the following output was printed: waiting for vscode-cli-${COMMIT}.tar.gz.done and vscode-server.tar.gz exist.

Here is what worked for me, but I would like to know if anyone has a more streamlined process.

  1. Download tarballs and place on the server.

  2. If the process times out before the message waiting for vscode-cli-${COMMIT}.tar.gz.done and vscode-server.tar.gz exist appears, you may need to reopen the SSH project and wait for the message to appear again before proceeding. Once the message appears, execute the following on the serverb:

     cp vscode_cli_alpine_x64_cli.tar.gz ~/.vscode-server/vscode-cli-${COMMIT}.tar.gz.done 
    

    This will generate a new file named "code-${COMMIT}" in the directory "~/.vscode-server/".

  3. Next, create a directory, and extract the archive there:

     mkdir -p ~/.vscode-server/cli/servers/Stable-${COMMIT}/server
     tar -xvzf vscode-server-linux-x64.tar.gz --strip-components 1 -C "$_"
    
  4. Finally, restart VS Code to complete the process.


a "${COMMIT}" refers to the current commit ID of VS Code, which can be found by clicking on "Help" -> "About" -> "Commit" in the top menu. When performing the actual operation, you need to replace "${COMMIT}" with the corresponding commit ID. For example, the commit ID for version 1.82.0 is 8b617bd08fd9e3fc94d14adb8d358b56e3f72314.

b One editor needed to manually remove the .done from the end of the tarball name in order for the extraction to run properly.

Upvotes: 8

Views: 17055

Answers (5)

Adeel
Adeel

Reputation: 1

I found the issue happy to share my solution. Cant use older version as it has vulnerabilities. I have solved issue by switch off the "exec server":

enter image description here

Upvotes: -1

马习之
马习之

Reputation: 26

Try reinstalling an older version.

I encountered with the same problem. I was originally using VS Code 1.81.0 on Mac, 1.81.0 on Ubuntu. However, it might be brew that upgraded my VS Code to 1.82.2 and now I can't log into my server. I reinstalled 1.81.0 and it works again.

Upvotes: 1

huang zhihao
huang zhihao

Reputation: 21

For vscode-cli-${COMMIT}.tar.gz.done, a new file named code-${COMMIT} in the directory ~/.vscode-server/ is the key point.

I just tar it in the filepath, and the install process is successful.

  1. Just tar 'vscode-cli-alpine_x64_cli.tar.gz', and a file named 'Code' will be obtained

  2. Rename 'Code' as 'code-${COMMIT}'; 3. Move 'code-${COMMIT}' to '~/.vscode-server/'.

Upvotes: 2

Mike
Mike

Reputation: 111

Seems the new Remote SSH feature uses a new bootstrapping mode; disabling it helped me solve the issue:

Try turning off the 'exec server' feature:

enter image description here

Reference: Stuck in Downloading VS Code Server for Remote SSH Connection

Upvotes: 2

magor
magor

Reputation: 709

The path to which we have to extract the server tar file has changed.

Current working steps are (I have 1.88.1):

  • Download the tar file from: https://update.code.visualstudio.com/commit:<your-commit-hash>/server-linux-x64/stable
  • copy to the Linux host
  • extract to ~/.vscode-server/cli/servers/Stable-<commit-id>/server/

Prior to 1.82 we had to extract to .vscode-server/bin/<commit-id>.
Since 1.82(?) the new destination is .vscode-server/cli/servers/Stable-<commit-id>/server/.


Example shell commands - version 1.88.1 - I copied the tar file to my user's home folder:

  • download tar from: https://update.code.visualstudio.com/commit:e170252f762678dec6ca2cc69aba1570769a5d39/server-linux-x64/stable
mkdir -p ~/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server
cd ~/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server
tar xzf ~/vscode-server-linux-x64.tar.gz --strip-components=1

Upvotes: 4

Related Questions