23

When I try use remote-ssh connect to my server to install install vs-code-server, it hangs with these message: Install and start server if needed

bash: no job control in this shell Installing... Downloading with wget

It seems my server cannot use wget to download vs-code-server. Can I install vs-code-server manually?

Jacki
  • 231
  • 1
  • 2
  • 3
  • 4
    See this question. https://stackoverflow.com/questions/56718453/ssh-with-vscode-without-internet/56781109#56781109 – aviso Jun 26 '19 at 21:49
  • Does this answer your question? [Using "Remote SSH" in VSCode on a target machine that only allows inbound SSH connections](https://stackoverflow.com/questions/56718453/using-remote-ssh-in-vscode-on-a-target-machine-that-only-allows-inbound-ssh-co) – rustyhu Aug 23 '22 at 02:34

3 Answers3

24

Download your current used version via

wget https://update.code.visualstudio.com/commit:c3f126316369cd610563c75b1b1725e0679adfb3/server-linux-x64/stable

You can check the commit id in vscode Help -> About

Copy it to your machine through ssh.

Unpack to ~/.vscode-server/bin/c3f126316369cd610563c75b1b1725e0679adfb3

And you're done

FelixWee
  • 241
  • 2
  • 2
  • 2
    just to mention for those who need: the `~/.vscode-server/bin/{commit-id}/` directory must contain the **content** of the unpacked folder, i.e., `bin`, `server.sh`, ... not the unpacked folder `vscode-server-linux-x86` itself. – fmatt Feb 05 '23 at 10:47
  • Where does this need to go if we are on windows? – Chad Jul 17 '23 at 17:28
6

I used this bash script on my linux container and it works fine. You can try this too.

read -p 'What commit of vscode server do you wish to install? ' commit

echo ""

if [ ! -d "$HOME/.vscode-server/bin/$commit" ] ; then
    mkdir -p install-vscode-server
    cd install-vscode-server
    wget -q https://update.code.visualstudio.com/commit:$commit/server-linux-x64/stable
    tar -xf stable
    mkdir -p ~/.vscode-server/bin
    mv vscode-server-linux-x64 ~/.vscode-server/bin/$commit
    cd ..
    rm -rf install-vscode-server
    echo "vscode server commit:$commit installed"
else
    echo "Commit already installed"
fi

echo ""
  • I think, the script is rather helpful if everything goes right, but is absolutely abysmal when things are not going quite 100%: 1. `set -x`, 2. `set -e`, 3. Don't set `wget` to quiet. Remove `-q`. – Domi Feb 12 '23 at 11:22
  • 3
    Abysmal? I don't think so. For point 1 and 3, I want the script to run as quiet as possible. For point 2, I avoided set -e because I want the script to always exit with 0. That's for me! You are free to modify the script to whatever you want. – Akintomiwa Opemipo Feb 12 '23 at 15:09
  • (Again, quiet is all good as long as there are no problems!) – Domi Feb 13 '23 at 07:55
  • Refined script without saving the blob https://github.com/AnrDaemon/samba4-ads/blob/master/home/%24USER/bin/install-vscode-remote.sh – AnrDaemon Jul 06 '23 at 17:37
2

This problem is caused by your terminal shell path isn't configured rightly.

Follow this issue https://github.com/microsoft/vscode-remote-release/issues/220#issuecomment-490374437

Check which shell you are using: which $SHELL

milkice
  • 455
  • 6
  • 10
  • 1
    Thanks for your reply. But my issue isn't about shell configuration. My server is in cooperate datacenter which may block some traffic. So my question is how can I download vscode-server package and install the vscode-server package in remote server manually. – Jacki May 23 '19 at 08:37
  • I have the same problem. Is there a tar of vscode-server which I can download locally and then transfer and install into my remote server. – SilentGuy Jul 19 '19 at 19:19
  • You can look up at [Vs code Remote Issues](https://github.com/microsoft/vscode-remote-release/issues), maybe there is a solution.@SilentGuy – milkice Jul 25 '19 at 02:56