Anysphere remote ssh doesn't work well and can't connect to remote hosts. This hasn't happened before when using the VSCode version

  • Remote - SSH Notes
Connection to Cursor server failed: Failed to install the Cursor Server. Please check the logs for more details.
from: Remote - SSH
  • Remote - SSH Output
[Trace  - 07:14:41.501] (ssh_tunnel) stderr: debug1: Remote: /home/zwhy/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding

[Trace  - 07:14:41.517] (ssh_tunnel) stderr: debug1: Remote: /home/zwhy/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding

[Trace  - 07:14:41.517] (ssh_tunnel) stderr: debug1: Sending command: bash --login -c 'echo "CgpUTVBfRElSPSIke1hER19SVU5USU1FX0RJUjotIi90bXAifSIKClNFUlZFUl9DT01NSVQ9ImE5ZGQ0NmNiZDI0OWEzMDA0NGVhYWUxNTI2ZWI2Y2ExZWMyZjc1NjAiClNFUlZFUl9MSU5FPSJwcm9kdWN0aW9uIgpTRVJWRVJfREFUQV9ESVI9IiRIT01FLy5jdXJzb3Itc2VydmVyIgpTRVJWRVJfRElSPSIkU0VSVkVSX0RBVEFfRElSL2Jpbi9hOWRkNDZjYmQyNDlhMzAwNDRlYWFlMTUyNmViNmNhMWVjMmY3NTYwIgpTRVJWRVJfTk9ERV9FWEVDVVRBQkxFPSIkU0VSVkVSX0RJUi9ub2RlIgoKCkNPREVfU0VSVkVSX1NDUklQVD0iJFNFUlZFUl9ESVIvYmluL2N1cnNvci1zZXJ2ZXIiCkNPREVfU0VSVkVSX0xPR0ZJTEU9IiRTRVJWRVJfREFUQV9ESVIvLiRTRVJWRVJfQ09NTUlULmNvZGUubG9nIgpDT0RFX1NFUlZFUl9UT0tFTkZJTEU9IiRTRVJWRVJfREFUQV9ESVIvLiRTRVJWRVJfQ09NTUlULmNvZGUudG9rZW4iCkNPREVfU0VSVkVSX1BJREZJTEU9IiRTRVJWRVJfREFUQV9ESVIvLiRTRVJWRVJfQ09NTUlULmNvZGUucGlkIgpDT0RFX1NFUlZFUl9QUk9DRVNTX0FMTF9WRVJTSU9OU19HUkVQX1BBVFRFUk49IiRTRVJWRVJfREFUQV9ESVIvYmluLy4qL291dC9zZXJ2ZXItbWFpbi5qcyIKQ09ERV9MSVNURU5JTkdfT049CgpNVUxUSVBMRVhfU0VSVkVSX1NDU

[Trace  - 07:14:41.528] (ssh_tunnel) stderr: debug1: client_global_hostkeys_prove_confirm: server used untrusted RSA signature algorithm ssh-rsa for key 0, disregarding

[Trace  - 07:14:41.530] (ssh_tunnel) stderr: debug1: update_known_hosts: known hosts file /home/28678/.ssh/known_hosts2 does not exist
debug1: pledge: network

[Trace  - 07:14:41.530] (ssh_tunnel) stderr: debug1: client_input_channel_req: channel 2 rtype exit-status reply 0
debug1: client_input_channel_req: channel 2 rtype [email protected] reply 0

[Trace  - 07:14:41.530] (ssh_tunnel) stderr: bash: -c: 行 0: 寻找匹配的“'”时遇到了未预期的文件结束符
bash: -c: 行 1: 语法错误: 未预期的文件结尾
debug1: channel 2: free: client-session, nchannels 3
debug1: channel 0: free: port listener, nchannels 2
debug1: channel 1: free: port listener, nchannels 1
Transferred: sent 12288, received 3788 bytes, in 0.1 seconds
Bytes per second: sent 103384.8, received 31870.3
debug1: Exit status 1

[Trace  - 07:14:41.532] (ssh_tunnel): exit: code=1 signal=null
[Error  - 07:14:41.533] Error installing server:
Error: Failed to install the Cursor Server. Please check the logs for more details.
	at Ir (c:\Users\28678\.cursor\extensions\anysphere.remote-ssh-1.0.2\dist\main.js:1:218666)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async c:\Users\28678\.cursor\extensions\anysphere.remote-ssh-1.0.2\dist\main.js:1:269701
[Error  - 07:14:41.533] Error resolving SSH authority
Error: Failed to install the Cursor Server. Please check the logs for more details.
	at Ir (c:\Users\28678\.cursor\extensions\anysphere.remote-ssh-1.0.2\dist\main.js:1:218666)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async c:\Users\28678\.cursor\extensions\anysphere.remote-ssh-1.0.2\dist\main.js:1:269701
  • ChatGPT output
This long echo command is likely an attempt by the cursor plugin to send a Base64 encoded or shell script string via SSH to a remote machine for execution. Due to the presence of quotation marks'... 'in the string, if:

The quotation marks are not properly escaped

The string is truncated during concatenation

There are bugs or environment variables in the plugin that disrupt the original structure

An unexpected file ending error will appear.
  • extensions.json
[
    {
        "name": "anysphere.remote-containers",
        "version": "1.0.4"
    },
    {
        "name": "ms-ceintl.vscode-language-pack-zh-hans",
        "version": "1.96.2024121109"
    },
    {
        "name": "emilast.logfilehighlighter",
        "version": "3.4.0"
    },
    {
        "name": "ms-toolsai.vscode-jupyter-slideshow",
        "version": "0.1.6"
    },
    {
        "name": "ms-toolsai.vscode-jupyter-cell-tags",
        "version": "0.1.9"
    },
    {
        "name": "ms-toolsai.jupyter",
        "version": "2024.11.0"
    },
    {
        "name": "ms-toolsai.jupyter-renderers",
        "version": "1.1.0"
    },
    {
        "name": "vadimcn.vscode-lldb",
        "version": "1.11.5"
    },
    {
        "name": "llvm-vs-code-extensions.vscode-clangd",
        "version": "0.1.33"
    },
    {
        "name": "ms-vscode.cmake-tools",
        "version": "1.20.53"
    },
    {
        "name": "anysphere.cursorpyright",
       "version": "1.0.2"
    },
    {
        "name": "ms-python.vscode-pylance",
        "version": "2024.8.1"
    },
    {
        "name": "anysphere.cpptools",
        "version": "2.0.0"
    },
    {
        "name": "donjayamanne.python-extension-pack",
        "version": "1.7.0"
    },
    {
        "name": "ms-vscode.cpptools-extension-pack",
        "version": "1.3.1"
    },
    {
        "name": "ms-toolsai.jupyter-keymap",
        "version": "1.1.2"
    },
    {
        "name": "ms-vscode.cpptools-themes",
        "version": "2.0.0"
    },
    {
        "name": "llvm-vs-code-extensions.vscode-clangd",
        "version": "0.1.33"
    },
    {
        "name": "nvidia.nsight-vscode-edition",
        "version": "2024.1.34572442"
    },
    {
        "name": "docker.docker",
        "version": "0.7.0"
    },
    {
        "name": "076923.python-image-preview",
        "version": "0.1.2"
    },
    {
        "name": "bierner.markdown-mermaid",
        "version": "1.28.0"
    },
    {
        "name": "ms-toolsai.vscode-jupyter-slideshow",
        "version": "0.1.6"
    },
    {
        "name": "kevinrose.vsc-python-indent",
        "version": "1.21.0"
    },
    {
        "name": "ms-toolsai.vscode-jupyter-cell-tags",
        "version": "0.1.9"
    },
    {
        "name": "ms-toolsai.jupyter-renderers",
        "version": "1.1.0"
    },
    {
        "name": "donjayamanne.githistory",
        "version": "0.6.20"
    },
    {
        "name": "ms-vscode.makefile-tools",
        "version": "0.12.17"
    },
    {
        "name": "ms-vscode.hexeditor",
        "version": "1.11.1"
    },
    {
        "name": "mechatroner.rainbow-csv",
        "version": "3.19.0"
    },
    {
        "name": "bpruitt-goddard.mermaid-markdown-syntax-highlighting",
        "version": "1.7.1"
    },
    {
        "name": "mhutchie.git-graph",
        "version": "1.30.0"
    },
    {
        "name": "shd101wyy.markdown-preview-enhanced",
        "version": "0.8.18"
    },
    {
        "name": "intellsmi.comment-translate",
        "version": "3.0.0"
    },
    {
        "name": "ms-toolsai.datawrangler",
        "version": "1.22.0"
    },
    {
        "name": "ms-python.pylint",
        "version": "2025.2.0"
    },
    {
        "name": "ms-vscode.cmake-tools",
        "version": "1.20.53"
    },
    {
        "name": "ms-vscode.cpptools",
        "version": "1.25.3"
    },
    {
        "name": "ms-python.python",
        "version": "2025.6.1"
    },
    {
        "name": "ms-python.debugpy",
        "version": "2025.8.0"
    },
    {
        "name": "wholroyd.jinja",
        "version": "0.0.8"
    },
    {
        "name": "ms-azuretools.vscode-containers",
        "version": "2.0.2"
    },
    {
        "name": "ms-azuretools.vscode-docker",
        "version": "2.0.0"
    },
    {
        "name": "anysphere.remote-wsl",
        "version": "1.0.1"
    },
    {
        "name": "anysphere.remote-ssh",
        "version": "1.0.2"
    },
    {
        "name": "redhat.vscode-yaml",
        "version": "1.18.0"
    },
    {
        "name": "redhat.vscode-xml",
        "version": "0.29.0"
    },
    {
        "name": "ms-vscode-remote.vscode-remote-extensionpack",
        "version": "0.26.0"
    },
    {
        "name": "ms-vscode-remote.remote-ssh-edit",
        "version": "0.87.0"
    },
    {
        "name": "ms-vscode.remote-explorer",
        "version": "0.5.0"
    },
    {
        "name": "ms-vscode.remote-server",
        "version": "1.6.2025041509"
    }
]
  • device
master : windows 11
remote : ubuntu20.04
network: They all use proxies, but curl google.com works fine

After uninstalling all Anysphere-related plugins, you can restore the environment by manually installing the following extensions:

ms-azuretools.vscode-docker-1.29.6.vsix

ms-vscode-remote.remote-containers-0.397.0.vsix

ms-vscode-remote.remote-ssh-0.113.1.vsix

I connect to the target machine via SSH and use Dev Containers to attach Cursor to a Docker container. These three extensions need to work together as a set for this workflow.

I hope the official team can fix the maintained plugin repository to make it easier for users to use Cursor in this kind of setup.

1 Like

Hi! Thanks for sharing this issue. It looks like the setup command was truncated. On your remote machine, can you run getconf ARG_MAX? This won’t change anything but will help narrow down the cause.

I ran this command both on the host machine and inside Docker containers. Additionally, to rule out environment-specific issues, I tested this on three different remote machines, all running Ubuntu 20.04.5 LTS installed from the official ISO without any onfiguration changes.All of them produced the same result.

zwhy@ThinkStation-P3-Tower:~$ getconf ARG_MAX
2097152

Thank you for your response — I genuinely hope Cursor continues to improve!

Hi @Zwhy2025, could you try upgrading to version 1.0.6 of the Anysphere remote SSH plugin? We changed how the ssh command is launched from Windows to avoid passing really long CLI arguments, which may fix this truncation issue. Would appreciate if you could give it a try.

Of course. I actually tried it right after your update. While I can now connect successfully, I’m still encountering two bugs that prevent me from fully integrating this extension into my workflow:

1. Re-downloading cursor-server on subsequent SSH connections

After a successful connection, reconnecting triggers the following error:


stderr: ln: Failed to create hard link '/run/user/1000/cursor-remote-lock.417ac7906b3030b015884b301a1c5a27': File already exists

To resolve it, I have to either click Reinstall Server or manually delete the hard link:


2. Incompatibility with remote-containers

I typically use the Attach to Running Container feature. Initially, I thought this issue was caused by the Docker extension, but after rolling back to an older version of the SSH extension, the issue disappeared—so I’m not entirely sure of the root cause.

I consulted ChatGPT, which suggested the problem might be related to Node. However, even after installing Node, the issue persisted. Eventually, I reverted to my previous workflow.




Error message:

Error running command remote-containers.attachToRunningContainerFromViewlet:
...
stat: Failed to call stat on '/home/zwhy/.cursor-server/cli/servers/Stable-53b99ce608cba35127ae3a050c1738a959750860/server/node': No such file or directory.
This may be caused by the extension specified in remote-containers.attachToRunningContainerFromViewlet.

That’s everything I’ve observed so far. Please let me know if you need any additional information to help investigate further.

Hi @Zwhy2025, thank you for sharing these issues.

Re: 1. – the stale lockfile could have been left behind by a previous installation. Does this happen every time you connect?

Re: 2. – to use Dev Containers over SSH, you’ll need to use the Anysphere Remote Containers extension. We do not support using the Microsoft Remote Containers plugin with the Anysphere Remote SSH. Attaching a screenshot for the one you’ll want to use:

It’s quite surprising — after updating all recent plugins released by Anysphere, the two issues I reported yesterday are no longer reproducible (in fact, I originally tested them last weekend).

Now it seems there’s only one issue left:

  1. I typically click Attach vscode/cursor to enter the Docker container for development.

  2. The current issue is that it gets stuck on this screen, and I’ll attach the logs below.

Logs:

2025-06-09 20:57:18.264 [info] Resolving dev container authority 'dev-container+7b2273657474696e6754797065223a22636f6e7461696e6572222c22636f6e7461696e65724964223a22376163636131336265333031227d' (attempt #1) container '{"settingType":"container","containerId":"7acca13be301"}'
2025-06-09 20:57:18.264 [info] Using exec server from resolve options
2025-06-09 20:57:18.264 [info] Starting Dev Containers dev-container+7b2273657474696e6754797065223a22636f6e7461696e6572222c22636f6e7461696e65724964223a22376163636131336265333031227d
2025-06-09 20:57:18.277 [info] Copying devcontainer CLI from c:\Users\28678\.cursor\extensions\anysphere.remote-containers-1.0.6\dist\@devcontainers to /tmp/devcontainer-cli-e3c7bf6e-52b9-41e8-b35e-5a4bacb2baee
2025-06-09 20:57:18.311 [info] docker version: Client: Docker Engine - Community
 Version:    28.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.35.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 10
 Server Version: 28.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 nvidia
 Default Runtime: nvidia
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: v1.2.5-0-g59923ef
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
 Kernel Version: 6.8.0-59-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 24
 Total Memory: 46.95GiB
 Name: 2080ti
 ID: c98cbb20-3692-416d-8425-59af76c7cb9a
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http://127.0.0.1:7890
 HTTPS Proxy: http://127.0.0.1:7890
 No Proxy: localhost,127.0.0.1
 Username: zwhy2025
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Registry Mirrors:
  https://6fagoyyy.mirror.aliyuncs.com/
 Live Restore Enabled: false
2025-06-09 20:57:18.312 [info] Inspecting docker container 7acca13be301
2025-06-09 20:57:18.328 [info] Devcontainer CLI written to /tmp/devcontainer-cli-e3c7bf6e-52b9-41e8-b35e-5a4bacb2baee
2025-06-09 20:57:18.332 [info] Copying forwarder.js to /tmp/devcontainer-cli-e3c7bf6e-52b9-41e8-b35e-5a4bacb2baee
2025-06-09 20:57:18.337 [info] Remote user: 
2025-06-09 20:57:18.337 [info] Installing remote server in container...
2025-06-09 20:57:18.338 [info] Install options: {
  "id": "98abe24065765fa84129e6f4",
  "commit": "53b99ce608cba35127ae3a050c1738a959750860",
  "line": "production",
  "extensionIds": [],
  "envVariables": [],
  "serverApplicationName": "cursor-server",
  "forceReinstall": true,
  "killRunningServers": false,
  "serverDataFolderName": ".cursor-server",
  "cursorVersion": "1.0.0",
  "spin": false,
  "settings": {}
}
2025-06-09 20:57:18.338 [info] SSH Agent Forwarding: true
2025-06-09 20:57:18.345 [info] Copying forwarderk8s.js to /tmp/devcontainer-cli-e3c7bf6e-52b9-41e8-b35e-5a4bacb2baee

2025-06-09 21:08:26.781 [info] Resolving dev container authority 'dev-container+7b2273657474696e6754797065223a22636f6e7461696e6572222c22636f6e7461696e65724964223a22376163636131336265333031227d' (attempt #1) container '{"settingType":"container","containerId":"7acca13be301"}'
2025-06-09 21:08:26.781 [info] Using exec server from resolve options
2025-06-09 21:08:26.781 [info] Starting Dev Containers dev-container+7b2273657474696e6754797065223a22636f6e7461696e6572222c22636f6e7461696e65724964223a22376163636131336265333031227d
2025-06-09 21:08:26.794 [info] Copying devcontainer CLI from c:\Users\28678\.cursor\extensions\anysphere.remote-containers-1.0.6\dist\@devcontainers to /tmp/devcontainer-cli-67f033cb-aacf-4231-bdff-93c630adeea4
2025-06-09 21:08:26.828 [info] docker version: Client: Docker Engine - Community
 Version:    28.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.35.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 10
 Server Version: 28.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 nvidia runc
 Default Runtime: nvidia
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: v1.2.5-0-g59923ef
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
 Kernel Version: 6.8.0-59-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 24
 Total Memory: 46.95GiB
 Name: 2080ti
 ID: c98cbb20-3692-416d-8425-59af76c7cb9a
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http://127.0.0.1:7890
 HTTPS Proxy: http://127.0.0.1:7890
 No Proxy: localhost,127.0.0.1
 Username: zwhy2025
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Registry Mirrors:
  https://6fagoyyy.mirror.aliyuncs.com/
 Live Restore Enabled: false
2025-06-09 21:08:26.828 [info] Inspecting docker container 7acca13be301
2025-06-09 21:08:26.843 [info] Devcontainer CLI written to /tmp/devcontainer-cli-67f033cb-aacf-4231-bdff-93c630adeea4
2025-06-09 21:08:26.847 [info] Copying forwarder.js to /tmp/devcontainer-cli-67f033cb-aacf-4231-bdff-93c630adeea4
2025-06-09 21:08:26.856 [info] Remote user: 
2025-06-09 21:08:26.856 [info] Installing remote server in container...
2025-06-09 21:08:26.857 [info] Copying forwarderk8s.js to /tmp/devcontainer-cli-67f033cb-aacf-4231-bdff-93c630adeea4
2025-06-09 21:08:26.858 [info] Install options: {
  "id": "38b79eb58df7541dde0db7ec",
  "commit": "53b99ce608cba35127ae3a050c1738a959750860",
  "line": "production",
  "extensionIds": [],
  "envVariables": [],
  "serverApplicationName": "cursor-server",
  "forceReinstall": true,
  "killRunningServers": false,
  "serverDataFolderName": ".cursor-server",
  "cursorVersion": "1.0.0",
  "spin": false,
  "settings": {}
}
2025-06-09 21:08:26.858 [info] SSH Agent Forwarding: true

Thanks for the help — just one step away now! :folded_hands:

Hi, after waiting for about half an hour, I finally managed to attach to the container — so it does seem to be a network issue.

I then rebuilt the container, and again, it got stuck at the same step (It would be great if there were a progress bar or indicator during the blocking steps). However, as shown in the previous logs, I did set up a proxy. I believe it’s working at least on the SSH side, since the server download was really fast. I also configured proxy settings inside the container’s terminal.

Anyway, it’s working now — so that’s good news!

Although network proxying is definitely a challenge in mainland China, I’m curious:
Does Cursor have any server deployments in Asia?
Right now, both the agent and chat services show around 800ms latency in network diagnostics :sweat_smile:

Thanks again for your continued support — great job!

Hi @Zwhy2025, glad it’s working!

The latest version of the Anysphere Remote Containers extension streams back the logs of the commands it runs, so you’ll know whether it is making progress or is actually stuck. Please see Security | Cursor - The AI Code Editor for a brief overview of where our data and servers are located.

1 Like