Reputation: 21
While trying to use the Remote Server extention to connect to a high performance computing server, the connection was unsuccessful and returned Server returned 404
.
From the error log, it appears that the error is executing the line wget [vscode-server-download-lind]
. So I believe it's an issue with downloading the correct version of VS Code server.
I am able to connect through ssh. Tried different network and connecting to other high performance computing servers. Also tried manually installing vscode server, but did was all unsuccessful.
Upvotes: 0
Views: 11010
Reputation: 21
The issue is resolved by manually downloading the correct server version and installing it on the remote server, making sure that the obsolete version is deleted and moving the updated version to the correct location.
Manually download the file in the home directory of the server using SSH from the link:
https://update.code.visualstudio.com/commit:[commit id]/server-linux-x64/stable
The commit id can be found on your local machine in the menu bar of VS Code: Code -> About Visual Studio Code -> Commit. If you are on mac, it should look something like this: b58957e67ee1e712cebf466b995adf4c5307b2bd
Use the following command to download the server file:
wget https://update.code.visualstudio.com/commit:b58957e67ee1e712cebf466b995adf4c5307b2bd/server-linux-x64/stable
After verifying that the download is successful, extract the vscode server by running:
tar -xvzf vscode-server.tar.gz -C ~/.vscode-server
Ensure dependencies are installed:
sudo apt-get update
sudo apt-get install libx11-dev libxkbfile-dev libsecret-1-dev
The issue in this case lies in that the vscode server files are nested incorrectly.
Navigate to the vscode server directory:
cd ~/.vscode-server/bin/<commit-hash>/
ls
If you notice a directory such as vscode-server-linux-x64
instead of expected server files like bin
, extensions
, etc., directly under the <commit-hash>
directory, you've identified the nesting issue.
Navigate into the incorrectly nested directory:
cd vscode-server-linux-x64/
Move all contents up one level to the correct directory:
mv * ../
Return to the correct directory and verify the structure:
cd ..
ls
You should now see the expected files and directories directly under <commit-hash>
.
After adjusting the file structure, reconnect using the Remote - SSH extension in VSCode. It should now recognize the manually installed server and not attempt to download it again.
Upvotes: 1
Reputation: 376
In my case, I had left VS Code open for several weeks without updating, so it was no longer the current version. Closing VS Code and letting it update itself, then trying again resolved the error.
Upvotes: 1