Skip to content

Instantly share code, notes, and snippets.

@bpmct
Created June 12, 2026 12:28
Show Gist options
  • Select an option

  • Save bpmct/285ae02972a9386c6e745c130c4299c1 to your computer and use it in GitHub Desktop.

Select an option

Save bpmct/285ae02972a9386c6e745c130c4299c1 to your computer and use it in GitHub Desktop.
VS Code Remote SSH on NixOS: fix for bundled node ELF interpreter error

VS Code Remote SSH on NixOS — fix for "cannot execute: required file not found"

When connecting VS Code to a NixOS machine via Remote SSH, the server install fails with:

Error installing server: error checking server integrity: failed to run command
".../server/bin/code-server --version" (code 127):
.../server/bin/code-server: line 22: .../server/node: cannot execute: required file not found

Cause

VS Code Remote downloads a pre-built node binary that is dynamically linked against the standard glibc ELF interpreter at /lib64/ld-linux-x86-64.so.2. NixOS does not provide that path by default — all interpreters live in /nix/store.

Fix

Enable programs.nix-ld in your NixOS configuration. It creates /lib64/ld-linux-x86-64.so.2 as a shim that resolves the real glibc interpreter from the Nix store at runtime.

# configuration.nix (or any imported module)
programs.nix-ld.enable = true;

Then rebuild:

sudo nixos-rebuild switch

After the switch, /lib64/ld-linux-x86-64.so.2 exists and points to nix-ld:

/lib64/ld-linux-x86-64.so.2 -> /nix/store/...-nix-ld-2.0.6/libexec/nix-ld

VS Code Remote will now install and connect successfully.

Notes

  • programs.nix-ld also populates /run/current-system/sw/share/nix-ld/lib/ with a broad set of common shared libraries, covering most other pre-built binaries you might run on NixOS (language servers, editors, etc.).
  • This applies to any NixOS machine used as a VS Code Remote SSH target — VMs, bare metal, Incus/LXC, Coder workspaces, etc.
  • No reboot required; nixos-rebuild switch activates it immediately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment