VS Code Connection Issues

I use VS code on MacOS (MacBook Air M1) to remotely manage my home server running NixOS. I connect via SSH through Tailscale. I use this flake for the VS code server. This worked flawlessly initially but over the last 2 weeks I’m having constant connection issues. VS Code on the Mac shows a progress bar labelled “Downloading VS Code Server” before throwing this error:

Failed to connect to the remote extension host server (Error: WrappedError(WrappedError { message: “error checking server integrity”, original: “failed to run command "/home/nixos/.vscode-server/cli/servers/Stable-863d2581ecda6849923a2118d93a088b0745d9d6.staging/server/bin/code-server --version" (code 127): Could not start dynamically linked executable: /home/nixos/.vscode-server/cli/servers/Stable-863d2581ecda6849923a2118d93a088b0745d9d6.staging/server/node\nNixOS cannot run dynamically linked executables intended for generic\nlinux environments out of the box. For more information, see:\nhttps://nix.dev/permalink/stub-ld\n” }))

If I keep reloading the VS Code client I will get a successful connection ~ 1/20 times.

I’d appreciate any input.

Solved by The_Laughing_Gnome on reddit, answer is in the error message > Frequently Asked Questions — nix.dev documentation

programs.nix-ld.enable = true

1 Like