This article was transcribed by SimpRead, original URL www.hacktech.cn
Original: Unable to connect to Ubuntu 18.04 after VS Code 1.99 | Akkuman’s Tech Blog
Background
VS Code Remote Development shows the error: The remote host doesn’t meet the prerequisites for running VS Code Server.
Root Cause
Back in early 2023 or 2024, VS Code encountered a similar issue. The official goal was to drop support for older systems. However, this change came without prior notice and was quite sudden. Later, Microsoft released a fix allowing continued use of older systems until Q1 2025, giving users time to upgrade.
Then, in the changelog for version 1.97, Microsoft announced that starting from version 1.99, connections to older systems for remote development would no longer be allowed.
However, an official workaround has been provided:
See https://aka.ms/vscode-remote/faq/old-linux
Solution After May 22, 2025
It appears the issue has resurfaced. Currently, the most stable solution involves using Linuxbrew. Below is the Linuxbrew-based approach—using bash as an example. If you’re using zsh or another shell, refer to homebrew | Mirror Usage Help | Tsinghua University Open Source Mirror.
For overseas environments, run:
/bin/bash -c "$(curl -fsSL https://github.com/Homebrew/install/raw/master/install.sh)"
Then install patchelf:
brew install patchelf
Execute the following commands:
echo >> ~/.bashrc
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/brew.git"' >> ~/.bashrc
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/homebrew-core.git"' >> ~/.bashrc
echo 'export HOMEBREW_API_DOMAIN="https://mirrors.aliyun.com/homebrew-bottles/api"' >> ~/.bashrc
echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.aliyun.com/homebrew/homebrew-bottles"' >> ~/.bashrc
source ~/.bashrc
export HOMEBREW_INSTALL_FROM_API=1
# Download and install Homebrew from Alibaba Cloud mirror
git clone https://mirrors.aliyun.com/homebrew/install.git brew-install
/bin/bash brew-install/install.sh
rm -rf brew-install
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
source ~/.bashrc
Legacy Solution
The official workaround previously involved using Crosstool to create an environment with a newer version of glibc, then automatically patching it using patchelf.
However, this requires compiling Crosstool manually, which can be cumbersome.
An alternative method uses Brew to install glibc and patchelf. See: Connect to Unsupported Older Linux servers with VS Code Remote-SSH using Custom glibc & libstdc++ - DEV Community
But Brew is a Ruby-based tool, and its installation can also be complicated.
Below is a simpler approach:
Download glibc
Download patchelf
Go to Releases · NixOS/patchelf and download the appropriate patchelf binary.
Extract it and place bin/patchelf into /usr/local/bin/patchelf on your host machine.
Configure Environment Variables
Add the following lines to ~/.ssh/environment:
echo 'VSCODE_SERVER_CUSTOM_GLIBC_PATH=/home/linuxbrew/.linuxbrew/opt/glibc/lib' >> ~/.ssh/environment
echo 'VSCODE_SERVER_PATCHELF_PATH=/home/linuxbrew/.linuxbrew/bin/patchelf' >> ~/.ssh/environment
echo 'VSCODE_SERVER_CUSTOM_GLIBC_LINKER=/home/linuxbrew/.linuxbrew/opt/glibc/lib/ld-linux-x86-64.so.2' >> ~/.ssh/environment
sudo sed -i 's|#PermitUserEnvironment no|PermitUserEnvironment yes|g' /etc/ssh/sshd_config
sudo systemctl restart sshd
Then execute the command to enable SSH environment variables.
Construct Search Path
Note: This step is essential; otherwise, you may encounter issues such as inability to open terminals.
# Download glibc bottle
curl --disable --cookie /dev/null --globoff --show-error --fail --progress-bar --retry 3 --header 'Authorization: Bearer QQ==' --location --remote-time --output glibc.bottle.tar.gz "https://ghcr.io/v2/homebrew/core/glibc/blobs/sha256:91e866deda35d20e5e5e7a288ae0902b7692ec4398d4267c74c84a6ebcc7cdd9"
# Extract glibc/2.35_1 to /opt
sudo tar -xzf glibc.bottle.tar.gz -C /opt
Important Side Note
Due to potential future issues (such as predefined library search paths in precompiled Linuxbrew glibc leading to missing functionality), it’s recommended to directly install Linuxbrew + glibc. Users in China can follow instructions at homebrew | Mirror Usage Help | Tsinghua University Open Source Mirror for installation, then configure according to Connect to Unsupported Older Linux servers with VS Code Remote-SSH using Custom glibc & libstdc++ - DEV Community.
Re-test
Try reconnecting now.
If connection fails, SSH into the remote machine and run:
env | grep VSCODE
to verify the environment variables are set correctly. If not, check the following files on your remote host:
~/.bashrc/etc/environment~/.profile~/.zprofile~/.bash_profile
Remove any conflicting definitions of these variables if found.
References
- VS Code Server Not Detecting Custom Environment Variables for Old Linux Workaround · Issue #246375 · microsoft/vscode
- Connect to Unsupported Older Linux servers with VS Code Remote-SSH using Custom glibc & libstdc++ - DEV Community
- Remote Development FAQ
- Allow connecting to unsupported Linux remotes, by use of custom glibc and stdc++ libraries · Issue #231623 · microsoft/vscode
- How does homebrew store bottles? · Homebrew · Discussion #4335
- Package core/glibc
