Cannot ssh into remote server in cursor, works in VS Code

I’m working on a research project at my University, which requires me to SSH into a remote NixOS machine.

I can access the remote environment both via the terminal and in VS Code, but Cursor fails to install the Cursor Server.

Searching for similar issues, I see there are troubles with different extensions. I have tried removing the VS Code-specific extensions, but I still could not get it to work. I’m currently using the “Remote - SSH” extension by Anysphere. I can connect to a different remote server with Cursor, but not this particular one.

This is the output from Cursor when I attempt to connect to the host.
output.txt (730.9 KB)

Again, it works just fine on VS Code, and I have tried removing the cursor server and fresh installing it. No luck. This is really disappointing to me as I would love to use my Cursor Pro subscription to work on this project.

I am on Windows 11 and Cursor version 0.49.6

Hi there, thanks for sharing your logs. To help troubleshoot, could you run in a terminal on the remote machine, and share the output for each of these commands?

uname -a
lsb-release -a
ls -al /home/obo/.cursor-server/bin/0781e811de386a0c5bcb07ceb259df8ff8246a50/node
/home/obo/.cursor-server/bin/0781e811de386a0c5bcb07ceb259df8ff8246a50/node -e 'console.log("hello world")'

From your logs, I see the line:

[Trace  - 00:24:19.180] (ssh_tunnel) stdout: bash: line 300: /home/obo/.cursor-server/bin/0781e811de386a0c5bcb07ceb259df8ff8246a50/node: cannot execute: required file not found

which indicates that there might have been an issue with the download, filesystem, or incompatibility between the download and the remote system.

Thanks!

Hey Ravi, thanks for helping out.
Here are the results from each command.

pinot% uname -a
Linux pinot 6.1.87 #1-NixOS SMP PREEMPT_DYNAMIC Wed Apr 17 09:18:29 UTC 2024 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: NixOS
Description:    NixOS 23.11 (Tapir)
Release:        23.11
Codename:       tapir

pinot% ls -al /home/obo/.cursor-server/bin/0781e811de386a0c5bcb07ceb259df8ff8246a50/node
-rwxr-xr-x 1 obo users 96932096 Apr 24 22:05 /home/obo/.cursor-server/bin/0781e811de386a0c5bcb07ceb259df8ff8246a50/node

pinot% /home/obo/.cursor-server/bin/0781e811de386a0c5bcb07ceb259df8ff8246a50/node -e 'console.log("hello world")'
zsh: no such file or directory: /home/obo/.cursor-server/bin/0781e811de386a0c5bcb07ceb259df8ff8246a50/node

pinot% node -e 'console.log("hello world")'
hello world
pinot%

Hi Oliver, thanks for running these commands. Since you’re running NixOS, could you try the following on your remote machine?

cd /home/obo/.cursor-server/bin/0781e811de386a0c5bcb07ceb259df8ff8246a50
rm node
ln -s $(which node)

(Source: Does not work if target is a nixos · Issue #648 · microsoft/vscode-remote-release · GitHub)

We’ll try to make this work automatically in the next Remote SSH update. But in the meantime, please try the steps above and let me know if it works. Thanks!

Hey Ravi, went ahead and ran those commands and tried following more of the instructions from the linked post. Still getting the same error of cannot execute node. Is there a specific version of Node I should expect from which node?

Hmm ok, I will need to look more into how we can support NixOS in the Anysphere remote SSH extension. In the meantime, could you try installing the Microsoft remote SSH extension (attaching a screenshot) and see if this works?

With that extension, it gets caught in a loop of trying to install the VS Code server, before erroring with the same issue of not finding the required node file.

I also tried the previously mentioned solution of manually removing and reinstalling node to the bin subfolder, but it still hung up on the same thing.

Hi Oliver, we just released v0.0.30 of the anysphere.remote-ssh extension. In this update, we fallback to the system NodeJS (i.e. whatever is returned by which node) if the bundled node doesn’t work for whatever reason. We require NodeJS 20+.

I tested this on NixOS (version 24.11.717822.0c0bf9c05738), and I was able to successfully SSH in through Cursor and open a remote folder. I had to add wget and nodejs to the environment.systemPackages inside the /etc/nixos/configuration.nix, and then run sudo nixos-rebuild switch.

Could you try switching back to the Anysphere Remote SSH extension, and let me know whether this now works for you? You can find it by searching for @id:anysphere.remote-ssh in the extension search box – attaching a screenshot. Thanks!

1 Like