Installing VSCode-Server Offline

These are my basic notes on installing the server piece that is required to run Remote-SSH Extension in VSCode on a remote server that is air gapped or otherwise lacks internet connectivity.

I think obtaining the required vscode-server file is janky, I do not see a github for it and the "fix" I found downloads it via a direct link.

  1. Install VSCode
  2. Connect to a server with internet connectivity and then find the md5 sum generated as a directory name in ~/.vscode-server/bin/
  3. Download https://update.code.visualstudio.com/commit:{hash}/server-linux-x64/stable
  4. Unpack the tar file into ~/.vscode-server/bin/{hash}

The following script can be executed on a Linux host to extract the server into the proper directory (or tell you that it is already written). This would need to be run by each user, I see no simple way to automate it further than this script.

SERVER_TAR=\path\to\vscode-server-linux-x64.tar.gz
COMMIT=c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5

DEST=~/.vscode-server/bin/$COMMIT

if [ ! -d $DEST ] ; then
    mkdir -p $DEST
    tar -xzvf $SERVER_TAR -C $DEST --strip-components=1
else
    echo "Already in place"
fi