48

I am trying to install VScode remote-ssh extensions, but my remote host could not connect to the Internet,so there is no way to download software is needed. So I got some error message like that:

SSH Resolver called for "ssh-remote+kf"
SSH Resolver called for host: kf
Setting up SSH remote "kf"
Using commit id "daf71423252a707b8e396e8afa8102b717f8213b" and quality "insider" for server
Install and start server if needed
> bash: no job control in this shell
> Installing...
> Downloading with wget
> ERROR: certificate common name “*.azurewebsites.net” doesn’t match requested host name “update.code.visualstudio.com”. To connect to update.code.visualstudio.com insecurely, use ‘--no-check-certificate’.
> 2b948abc-b874-4ef5-875a-a29370a5f844##25##
"install" terminal command done
Received install output: 2b948abc-b874-4ef5-875a-a29370a5f844##25##
Server download failed
Downloading VS Code Server failed. Please try again later.

How could I fix this problem ?

Gama11
  • 31,714
  • 9
  • 78
  • 100
ehds
  • 665
  • 1
  • 6
  • 16

1 Answers1

108
  1. First get commit id
  2. Download vscode server from url: https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
  3. Upload the vscode-server-linux-x64.tar.gz to server
  4. Unzip the downloaded vscode-server-linux-x64.tar.gz to ~/.vscode-server/bin/${commit_id} without vscode-server-linux-x64 dir
  5. Create 0 file under ~/.vscode-server/bin/${commit_id}
commit_id=f06011ac164ae4dc8e753a3fe7f9549844d15e35

# Download url is: https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable
curl -sSL "https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable" -o vscode-server-linux-x64.tar.gz

mkdir -p ~/.vscode-server/bin/${commit_id}
tar zxvf vscode-server-linux-x64.tar.gz -C ~/.vscode-server/bin/${commit_id} --strip 1
touch ~/.vscode-server/bin/${commit_id}/0

- or -

See this Gist download-vs-code-server for a more complete shell script that will also get the latest released commit SHA (from GitHub) so you do not need to supply it yourself.


[edited to add helpful comment in case comments disappear later:]

You can replace commit:<commit> with latest to get the latest release build. Example: https://update.code.visualstudio.com/latest/server-linux-x64/stable. Respects indicated quality i.e, stable, insider. – Doom5

yaxin
  • 1,308
  • 1
  • 11
  • 11
  • Thanks! One more question: how can I upgrade the extension when there is one available in the future? – idailylife Jun 02 '20 at 07:46
  • Yeah but how can I get the latest ${commit_id} once there is an update? Btw, I created an issue regarding this, https://github.com/microsoft/vscode-remote-release/issues/3100. – idailylife Jun 03 '20 at 06:22
  • when you connect to remote with vscode, open detail message, a commit id is in output message, eg:[14:25:33.213] Using commit id "5763d909d5f12fe19f215cbfdd29a91c0fa9208a" and quality "stable" for server – yaxin Jun 03 '20 at 06:27
  • 2
    @idailylife you can't connect to remote once there have a new version, because vscode will use new commit id to connect server which do not exist – yaxin Jun 03 '20 at 06:31
  • 11
    You can replace `commit:` with `latest` to get the latest release build. Example: `https://update.code.visualstudio.com/latest/server-linux-x64/stable`. Respects indicated quality i.e, `stable`, `insider`. – Doom5 Oct 04 '20 at 06:45
  • Nice! I was having a problem doing this automatically through VS Code because of a proxy and this helped immensely. I turned this into a shell script and replaced the commit ID value with `$1`. Just call it with `get_server.sh {commit_id}`, which will make it easy to update when necessary. – J. Titus Oct 15 '20 at 15:07
  • 3
    FYI, the commit_id's match the commit hashes from releases here: https://github.com/microsoft/vscode/releases – b01 Jan 18 '21 at 14:08
  • what is the link for windows? – yekanchi Nov 12 '22 at 06:55
  • 2
    How many time I've come back to this life-saving answer... – Rm4n Mar 13 '23 at 06:35