VS Code Server will not start on an old Linux host because glibc is too old
Could not establish connection to "my-host": The VS Code Server failed to start.Short answer
Since VS Code 1.99 the prebuilt server needs a Linux host with glibc 2.28 or newer and libstdc++ 3.4.25 or newer. Run ldd --version on the host. If it is older, upgrade the distribution, or use the unofficial sysroot workaround. Alpine (musl) hosts are not supported over SSH.
Fix it fast
1Find out which cause you have
Log in to the host in a normal terminal and read the two library versions. The first line of ldd output ends with the glibc version.
ldd --version strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX2Match what you see, then jump to its fix
- 1
ldd --version prints 2.27 or lower (CentOS 7 and Ubuntu 18.04 are the usual hosts).The host's glibc is older than 2.28Fix - 2
The GLIBCXX list from the first step has no GLIBCXX_3.4.25 entry, even though glibc looks fine.libstdc++ is older than 3.4.25Fix - 3
cat /etc/os-release names Alpine.The host uses musl instead of glibc (Alpine)Fix
- 1
What does the error look like?
Could not establish connection to "my-host": The VS Code Server failed to start.Remote - SSH log shows the server download succeeded but the server never starts, on an old distribution
Cause 1 of 3
The host's glibc is older than 2.28
1Check
Compare the number from ldd with the requirement in the VS Code docs: kernel 4.18 or newer, glibc 2.28 or newer.
ldd --version | head -n 1
uname -r2Fix
Move the host to a supported distribution, for example Debian 10, RHEL 8 or Ubuntu 20.04 or newer. If that is impossible, VS Code documents an unofficial workaround: build a sysroot that contains glibc 2.28, install patchelf on the host, and point the server at them with three environment variables.
export VSCODE_SERVER_CUSTOM_GLIBC_LINKER=/path/to/sysroot/lib/ld-linux-x86-64.so.2
export VSCODE_SERVER_CUSTOM_GLIBC_PATH=/path/to/sysroot/lib
export VSCODE_SERVER_PATCHELF_PATH=/path/to/patchelf3Verify
Connect again with Remote - SSH. The docs say patchelf 0.17.x can crash the server, so use 0.18.x or newer.
patchelf --versionConfirmed by code.visualstudio.com
Cause 2 of 3
libstdc++ is older than 3.4.25
1Check
List the GLIBCXX versions the host's C++ runtime provides.
strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_3.4.252Fix
Update the libstdc++ package through the distribution package manager, or upgrade the distribution if no newer package exists. The requirement comes from the VS Code Server itself, so no setting on the client changes it.
# no command: update the libstdc++ package with your distribution's package manager3Verify
The grep now prints a line.
strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_3.4.25Confirmed by code.visualstudio.com
Cause 3 of 3
The host uses musl instead of glibc (Alpine)
1Check
Confirm the distribution.
cat /etc/os-release2Fix
The Linux requirements table lists Alpine as not yet supported over Remote - SSH, although it works in Dev Containers and WSL. Use a glibc-based host for SSH, or open the project through a Dev Container.
# no command: choose a glibc-based distribution for this host3Verify
On a glibc-based host the first step prints a glibc version.
ldd --version | head -n 1Confirmed by code.visualstudio.com
How do I stop it coming back?
- Check the VS Code remote requirements page before choosing a distribution for a long-lived dev host.
- Plan upgrades of hosts that run CentOS 7 or Ubuntu 18.04 style releases before the next VS Code update.
- Keep the sysroot workaround for a stop-gap only: the docs say it is not an officially supported scenario.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Security
VS Code Remote - SSH fails to set up the dynamic port forward
open failed: administratively prohibited: open failed
The connection is made, but VS Code cannot open its tunnel to the VS Code Server on the host.
4 causes, each with a fixSecurity
AuthenticationException: your certificate validation callback returned false
System.Security.Authentication.AuthenticationException
This message means a validation callback was installed, yours or one a library added, and it returned false.
3 causes, each with a fixSecurity
SSH to an EC2 instance fails with Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
ec2-user@ec2-203-0-113-25.compute-1.amazonaws.com: Permission denied (publickey).
On EC2 this error almost always means the instance did not accept your key for that user.
3 causes, each with a fixSecurity
gcloud init cannot finish the sign-in step
Enter authorization code
gcloud init signs in through a browser.
3 causes, each with a fixSecurity
A GitHub Actions SSH deploy step cannot log in to the server
ssh: handshake failed: ssh: unable to authenticate
The runner reached your server but the server refused the login.
4 causes, each with a fixSecurity
SSH to GitHub asks to confirm the host, or hangs on that prompt
ED25519 key fingerprint is SHA256:
SSH has never seen github.com from this machine, so it asks you to trust the server key.
2 causes, each with a fix