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
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.
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 switchAfter 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.
programs.nix-ldalso 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 switchactivates it immediately.