Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Security and hardening

VS Code Server will not start on an old Linux host because glibc is too old

ErrorCould 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.

  • Applies to VS Code 1.99 and later, Remote - SSH, Ubuntu 20.04 and later, RHEL 8 and later
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 GLIBCXX
  2. 2Match what you see, then jump to its fix

    1. 1ldd --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. 2The 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. 3cat /etc/os-release names Alpine.The host uses musl instead of glibc (Alpine)Fix

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 -r

2Fix

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/patchelf

3Verify

Connect again with Remote - SSH. The docs say patchelf 0.17.x can crash the server, so use 0.18.x or newer.

patchelf --version

Confirmed by code.visualstudio.com

Did this fix it?

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.25

2Fix

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 manager

3Verify

The grep now prints a line.

strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_3.4.25

Confirmed by code.visualstudio.com

Did this fix it?

Cause 3 of 3

The host uses musl instead of glibc (Alpine)

1Check

Confirm the distribution.

cat /etc/os-release

2Fix

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 host

3Verify

On a glibc-based host the first step prints a glibc version.

ldd --version | head -n 1

Confirmed by code.visualstudio.com

Did this fix it?

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

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.