Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Remote-SSH from Cursor to this Alpine environment:
Successfully installs and launches the alpine/arm64 Cursor remote server.
Successfully starts the code server and extension host agent.
Successfully sets up SSH port forwarding and initially connects.
…but after some time the code server logs Last EH closed, shutting down and exits. Subsequent reconnect attempts from Cursor then hit “connection refused” on the forwarded localhost port, leading to:
Cursor UI flashing / weird behavior.
Repeated reconnect attempts and failures.
sshd logs showing repeated connect_to 127.0.0.1 port : failed and session closure.
All required Alpine dependencies from your docs (bash, libstdc++, openssh, wget) are installed and working, and cursor-server runs fine when invoked manually.
Steps to Reproduce
Steps to Reproduce
On Windows 11, configure Cursor Remote-SSH to connect to the Alpine host (Home Assistant SSH add-on) as root over ssh using an ED25519 key.
Confirm plain SSH works from PowerShell:
ssh 12-waa # host alias; works with normal interactive shell
In Cursor, use Remote-SSH to connect to the same host.
Connection initially appears to succeed (server installed, logs show “Extension host agent started” and “Launched Extension Host Process”).
After some time / reconnection attempts, the Cursor window flashes; the remote connection becomes unstable / unusable.
Expected Behavior
Cursor’s Remote-SSH connection should remain stable.
The remote code server on the Alpine target should stay running while the client session is active, and reconnects should attach cleanly without “connection refused” errors.
Operating System
Linux
Current Cursor Version (Menu → About Cursor → Copy)
Version: 2.1.34 (system setup)
VSCode Version: 1.105.1
Commit: 609c37304ae83141fd217c4ae638bf5321856500
Date: 2025-11-25T16:35:52.391Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200
Additional Information
Remote server is installed under ~/.cursor-server and starts correctly.
SSH forwarding is established and used successfully.
After a while, the Cursor code server on the remote side logs that the last extension host closed and shuts down.
When Cursor tries to reconnect, it keeps trying to talk to a code-server port that is no longer listening, resulting in:
channel X: open failed: connect failed: Connection refused in SSH logs.
“Failed to connect to Cursor server … Could not re-establish SOCKS forwarding … Failed to connect to Cursor code server.” in the Cursor Remote-SSH log.
UI flashing / unstable remote session.
Key Logs
- Cursor Remote-SSH client log (Windows) – main patterns
(File: Remote - SSH.log – attached)
Cursor downloads and uses the alpine/arm64 build, detects Alpine correctly:
… cursor-reh-alpine-arm64.tar.gz …
detectedPlatform==alpine
arch==arm64
Node checks out:
Checking node executable
…
v20.18.2
Initial server startup and forwarding:
codeListeningOn==37805
[forwarding][code][127.0.0.1:61356 → 127.0.0.1:61347 → 127.0.0.1:37805] socks forwarding established
Later reconnect attempts fail after the server has shut down:
channel X: open failed: connect failed: Connection refused
Failed to connect to Cursor server at http://127.0.0.1:61356 …
Could not re-establish SOCKS forwarding … Failed to connect to Cursor code server.
(There are multiple iterations of “server script already installed”, new codeListeningOn ports, and the same failure pattern.)
- Remote sshd log (on Alpine / HA SSH add-on)
When Cursor tries to use the forwarded code-server port after shutdown:
Accepted publickey for root …
Starting session: command for root from 127.0.0.1 port 35964 id 0
connect_to 127.0.0.1 port 37805: failed.
connect_to 127.0.0.1 port 37805: failed.
…
Connection closed by 127.0.0.1 port 35964
So sshd is honoring the forwarding request but nothing is listening on the target port anymore.
- ~/.cursor-server/data/logs/…/remoteagent.log (remote)
Most recent log (e.g. data/logs/20251125T165841/remoteagent.log):
2025-11-25 16:58:41.714 [info] [CursorProclistService] Native module loaded successfully
2025-11-25 16:58:41.721 [info] Extension host agent started.
2025-11-25 16:58:42.186 [error] [127.0.0.1][4303cc94][ExtensionHostConnection] Unknown reconnection token (never seen).
2025-11-25 16:58:42.194 [error] [127.0.0.1][3c0bff3f][ManagementConnection] Unknown reconnection token (never seen).
2025-11-25 16:58:43.571 [info] [127.0.0.1][dbe2db15][ExtensionHostConnection] New connection established.
2025-11-25 16:58:43.906 [info] [127.0.0.1][dbe2db15][ExtensionHostConnection] <13145> Launched Extension Host Process.
2025-11-25 17:03:41.725 [info] New EH opened, aborting shutdown
2025-11-25 17:17:06.230 [info] [127.0.0.1][83b1bccf][ManagementConnection] New connection established.
2025-11-25 17:17:06.380 [info] [127.0.0.1][3be71dbf][ExtensionHostConnection] New connection established.
2025-11-25 17:17:06.390 [info] [127.0.0.1][3be71dbf][ExtensionHostConnection] <13451> Launched Extension Host Process.
2025-11-25 17:17:06.421 [info] Getting extensions control
2025-11-25 17:17:06.454 [info] [CursorProclistService] Config enabled feature (subsample every 10s)
No crash stack trace; the code server is starting and running.
- /tmp/cursor-remote-code.log.* (remote code server log)
Example (latest: /tmp/cursor-remote-code.log.6ca0869f6193ac0d40fa6ae74ed01260):
Server bound to 127.0.0.1:43041 (IPv4)
Extension host agent listening on 43041
[17:17:14]
[CursorProclistService] Native module loaded successfully
Extension host agent started.
[127.0.0.1][83b1bccf][ManagementConnection] Unknown reconnection token (never seen).
[127.0.0.1][3be71dbf][ExtensionHostConnection] Unknown reconnection token (never seen).
Last EH closed, shutting down
[17:22:14] Last EH closed, shutting down
So the code server explicitly shuts down due to “Last EH closed”, even though the client later attempts to reconnect and reuse it.
It looks like:
On Alpine (inside the HA SSH add-on), the Cursor code server and extension host behave normally at start,
But the server decides there are no extension host connections left and shuts down (“Last EH closed, shutting down”),
While the Windows client still expects to reconnect and reuse that server/port, causing a stale-forward → connection-refused loop and visible UI flicker.
I’m not seeing any missing deps or config problems on the remote side at this point, so this feels like a Remote-SSH / code-server lifecycle or reconnect-token handling bug in Cursor when targeting Alpine in this scenario.
Ask:
Can you confirm whether this environment (Alpine 3.22 via Home Assistant Advanced SSH add-on) is supported for Cursor Remote-SSH?
If yes, can you help interpret why the server is hitting “Last EH closed, shutting down” while the client continues to try reconnecting, and whether there’s a config or flag to keep the server alive while the client is active?
Does this stop you from using Cursor
Yes - Cursor is unusable