Installing Vscode Server Offline
Tags: vscode
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.
Install VSCodeConnect to a server with internet connectivity and then find the md5 sum generated as a directory name in ~/.vscode-server/bin/- Download https://update.code.visualstudio.com/commit:{hash}/server-linux-x64/stable
Unpack the tar file into ~/.vscode-server/bin/{hash}
Update 2025-04-24
You can obtain the hash by checking the following URL, replace with your VSCode version
Invoke-WebRequest https://api.github.com/repos/microsoft/vscode/git/refs/tags/1.98.1 | Select-Object -ExpandProperty Content | ConvertFrom-Json | Select-Object -ExpandProperty object | Select sha
All release info
Deploying on the server side
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.gzCOMMIT=c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
DEST=~/.vscode-server/bin/$COMMIT
if [ ! -d $DEST ] ; then mkdir -p $DEST tar -xzvf $SERVER_TAR -C $DEST --strip-components=1else echo "Already in place"fi
Linux script to pull
i=0TAG=$(curl -s https://api.github.com/repos/microsoft/vscode/releases | jq -r .[$i].tag_name)
while [ $TAG != "null" ]do HASH=$(curl -s https://api.github.com/repos/microsoft/vscode/git/refs/tags/$TAG | jq -r .object.sha) OUTPUT_PATH="./outputs/commit:$HASH/server-linux-x64/" mkdir -p $OUTPUT_PATH curl -JLO https://update.code.visualstudio.com/commit:$HASH/server-linux-x64/stable --output-dir $OUTPUT_PATH ((i = i + 1)) TAG=$(curl -s https://api.github.com/repos/microsoft/vscode/releases | jq -r .[$i].tag_name)done