SSH in Agent Window Disappears

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In the Agent window, using the command palette to start an SSH session ultimately fails - session vanishes.

Steps to Reproduce

  • Agent Window
  • Open command palette
  • Connect via SSH
  • Enter password
  • Select folder

SSH session disappears
NOTE: this feature works in the IDE mode

Expected Behavior

Chat should open for SSH session.

Operating System

Linux

Version Information

Version: 3.12.17
VS Code Extension API: 1.128.0
Commit: 0fb762053c34788bb7760d5673f8a6d4c8589d50
Date: 2026-07-17T02:53:53.006Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Linux x64 7.0.0-28-generic

Does this stop you from using Cursor

No - Cursor works, but with this issue

A shot in the dark here, but could it be this issue?

Hi Colin, thanks for jumping in!

In the IDE mode, accessing VSCode settings, I see this feature is NOT checked. I don’t believe I can access VSCode settings in the Agent window.

Ah, too bad! I was hopeful.

The next place to look would be Cmd + Shift + P > New Output View and then finding the Remote - SSH output logs of the affected workspace (the workspace may appear as Other Workspace if the connection was never successful).

Any specific errors?

I cleared that log and retried, had a agent examine an I’m including the response. One additional note, this exact SSH connection worked previously, and still works in IDE mode without failure. The agent output makes little sense to me due to my sysadmin ignorance.

Why agent mode fails over SSH

The SSH connection itself is fine — resolveAuthority(ssh-remote) succeeds after ~6 seconds and both sockets connect. The real failure is the agent sandbox helper on the remote machine:

ERROR [isSandboxHelperSupported] Preflight failed: … cursorsandbox --preflight-only

Failed to resolve Linux sandbox backend:

Landlock error: Failed to write /proc/self/uid_map (mapping UID 0 → 1003): Operation not permitted

Bubblewrap error: no root-owned executable ‘bwrap’ was found on PATH

Cursor’s agent tries to run terminal commands inside a sandbox on the remote host, and both available backends fail:

  1. User-namespace/Landlock backend: writing uid_map is denied, which means unprivileged user namespaces are restricted on that server. This is the default on Ubuntu 24.04+ (kernel.apparmor_restrict_unprivileged_userns=1) and on hardened kernels.
  2. Bubblewrap fallback: bwrap isn’t installed on the remote machine.

You can also see the consequence earlier in the log: sandboxSupported=false from the remote host.

Fixes (on the remote server, pick one)

  • Install bubblewrap: sudo apt install bubblewrap — simplest and keeps sandboxing.
  • Or re-enable unprivileged user namespaces: sudo sysctl kernel.apparmor_restrict_unprivileged_userns=0 (persist in /etc/sysctl.d/). This loosens a kernel hardening setting, so bubblewrap is the better option on a shared server.
  • Or, in Cursor, disable the agent sandbox for that remote (Settings → search “sandbox”) so agent commands run unsandboxed — acceptable only if you trust everything the agent runs.

One caveat: this log shows the sandbox preflight failing, which breaks sandboxed command execution in agent mode; if your symptom is something else (e.g., the agent pane not loading at all), grab the “Remote - SSH” and extension host logs from the same session, since nothing else in this excerpt is fatal.

bump

Hey @C_ST,

Could you update Cursor to the latest stable and try Connect via SSH in the Agents Window again? On the current build that flow is landing the remote workspace for me, so I want to check whether this is already sorted on your side.

The sandbox errors in your log are a separate host-side thing (they affect sandboxed shell commands on that machine, not whether the session opens). If it still vanishes after updating, grab Extension Host (Remote) + Window from Cmd+Shift+P > New Output View right after it happens and drop them here.

Hello Mohit,
I tried with 2 different previously saved SSH sessions, this is the failed log from one of them:
2026-07-31 09:58:42.149 [info] Resolving ssh remote authority ‘dockerpi.local’ (Unparsed ‘ssh-remote+dockerpi.local’) (attempt #1)

2026-07-31 09:58:42.154 [info] SSH askpass server listening on /tmp/cursor-ssh-OxNGyv/socket.sock

2026-07-31 09:58:42.155 [info] Using configured platform linux for remote host dockerpi.local

2026-07-31 09:58:42.155 [info] Using askpass script: /home/carter/.cursor/extensions/anysphere.remote-ssh-1.1.13/dist/scripts/launchSSHAskpass.sh with javascript file /home/carter/.cursor/extensions/anysphere.remote-ssh-1.1.13/dist/scripts/sshAskClient.js. Askpass address: /tmp/cursor-ssh-OxNGyv/socket.sock

2026-07-31 09:58:42.159 [info] Launching SSH server via shell with command: cat “/tmp/cursor_remote_install_c155e886-35ff-4036-a07e-13f2573c32d3.sh” | ssh -T -D 44915 dockerpi.local bash --login -c bash

2026-07-31 09:58:42.159 [info] Establishing SSH connection: cat “/tmp/cursor_remote_install_c155e886-35ff-4036-a07e-13f2573c32d3.sh” | ssh -T -D 44915 dockerpi.local bash --login -c bash

2026-07-31 09:58:42.159 [info] Started installation script. Waiting for it to finish…

2026-07-31 09:58:42.159 [info] Waiting for SSH handshake (timeout: 120s). Install timeout: 30s.

2026-07-31 09:58:42.386 [info] Askpass server received request: POST /

2026-07-31 09:58:42.386 [info] Askpass server received request body: {“request”:"[email protected]’s password: ",“requestId”:“30234f65-1f8b-4b5b-80d7-14ccda58bab0”}

2026-07-31 09:58:42.386 [info] Pausing timeout; waiting for askpass response

2026-07-31 09:58:42.386 [info] Received SSH askpass request: [email protected]’s password:

2026-07-31 09:58:45.801 [info] Resuming timeout; askpass response received

2026-07-31 09:58:46.677 [info] (ssh_tunnel) stdout: Configuring Cursor Server on Remote

2026-07-31 09:58:46.677 [info] SSH connection established after 4518ms (first stdout received)

2026-07-31 09:58:46.711 [info] (ssh_tunnel) stdout: Using TMP_DIR: /run/user/1000

2026-07-31 09:58:46.773 [info] (ssh_tunnel) stdout: Locking /run/user/1000/cursor-remote-lock.a8c5c6031742fefcab92b858f1d21978

2026-07-31 09:58:46.782 [info] (ssh_tunnel) stdout: Server script already installed in /home/carter/.cursor-server/bin/linux-arm64/31e8d61c448c7472e371505838a0fe34083dad50/bin/cursor-server

Checking node executable

2026-07-31 09:58:46.786 [info] (ssh_tunnel) stdout: v22.22.1

2026-07-31 09:58:46.820 [info] (ssh_tunnel) stdout: Checking for running multiplex server: /home/carter/.cursor-server/bin/multiplex-server/e0e6952a313d583840d50b387ab40c7bba7e66b79d95be1f22b3e7fc0706ae74.js

2026-07-31 09:58:46.832 [info] (ssh_tunnel) stdout: Running multiplex server: 214698 /home/carter/.cursor-server/bin/linux-arm64/31e8d61c448c7472e371505838a0fe34083dad50/node /home/carter/.cursor-server/bin/multiplex-server/e0e6952a313d583840d50b387ab40c7bba7e66b79d95be1f22b3e7fc0706ae74.js 4256c847-8fcd-4c36-a7e9-d76a91f6dec4 0

2026-07-31 09:58:46.838 [info] (ssh_tunnel) stdout: Multiplex server script is already running /home/carter/.cursor-server/bin/multiplex-server/e0e6952a313d583840d50b387ab40c7bba7e66b79d95be1f22b3e7fc0706ae74.js. Running processes are 214698 /home/carter/.cursor-server/bin/linux-arm64/31e8d61c448c7472e371505838a0fe34083dad50/node /home/carter/.cursor-server/bin/multiplex-server/e0e6952a313d583840d50b387ab40c7bba7e66b79d95be1f22b3e7fc0706ae74.js 4256c847-8fcd-4c36-a7e9-d76a91f6dec4 0

Reading multiplex server token file /run/user/1000/cursor-remote-multiplex.token.a8c5c6031742fefcab92b858f1d21978.e0e6952a313d583840d50b387ab40c7bba7e66b79d95be1f22b3e7fc0706ae74

Multiplex server token file found

2026-07-31 09:58:46.841 [info] (ssh_tunnel) stdout: Reading multiplex server log file /run/user/1000/cursor-remote-multiplex.log.a8c5c6031742fefcab92b858f1d21978.e0e6952a313d583840d50b387ab40c7bba7e66b79d95be1f22b3e7fc0706ae74

2026-07-31 09:58:46.849 [info] (ssh_tunnel) stdout: Checking for code servers

2026-07-31 09:58:46.870 [info] (ssh_tunnel) stdout: Code server script is already running /home/carter/.cursor-server/bin/linux-arm64/31e8d61c448c7472e371505838a0fe34083dad50/bin/cursor-server. Running processes are 214724 sh /home/carter/.cursor-server/bin/linux-arm64/31e8d61c448c7472e371505838a0fe34083dad50/bin/cursor-server --start-server --host 127.0.0.1 --port 0 --connection-token-file /run/user/1000/cursor-remote-code.token.a8c5c6031742fefcab92b858f1d21978 --telemetry-level off --enable-remote-auto-shutdown --accept-server-license-terms

2026-07-31 09:58:46.872 [info] (ssh_tunnel) stdout: Code server log file is /run/user/1000/cursor-remote-code.log.a8c5c6031742fefcab92b858f1d21978

2026-07-31 09:58:46.888 [info] (ssh_tunnel) stdout: d77d75228e242323a3281fd1: start

exitCode==0==

nodeExecutable==/home/carter/.cursor-server/bin/linux-arm64/31e8d61c448c7472e371505838a0fe34083dad50/node==

errorMessage====

isFatalError==false==

multiplexListeningOn==38723==

multiplexConnectionToken==4256c847-8fcd-4c36-a7e9-d76a91f6dec4==

codeListeningOn==42091==

codeConnectionToken==d398434f-c953-4ddd-b9d9-295fc76cc2e0==

detectedPlatform==linux==

arch==arm64==

osVersion==“Ubuntu 25.10”==

osVersionFormat==os-release==

osName==“Ubuntu”==

osVersionId==“25.10”==

osId==ubuntu==

kernelVersion==6.17.0-1021-raspi==

SSH_AUTH_SOCK====

DISPLAY====

2026-07-31 09:58:46.890 [info] (ssh_tunnel) stdout: Unlocking /run/user/1000/cursor-remote-lock.a8c5c6031742fefcab92b858f1d21978

2026-07-31 09:58:46.893 [info] (ssh_tunnel) stdout: d77d75228e242323a3281fd1: end

***********************************************************************

2026-07-31 09:58:46.896 [info] Server install command exit code: 0

2026-07-31 09:58:46.896 [info] Deleting local script /tmp/cursor_remote_install_c155e886-35ff-4036-a07e-13f2573c32d3.sh

2026-07-31 09:58:46.896 [info] (ssh_tunnel) stdout: * This terminal is used to establish and maintain the SSH connection. *

* Closing this terminal will terminate the connection and disconnect *

* Cursor from the remote server. *

***********************************************************************

2026-07-31 09:58:46.896 [info] [forwarding][code] creating new forwarding server

2026-07-31 09:58:46.896 [info] [forwarding][code] server listening on 127.0.0.1:36375

2026-07-31 09:58:46.896 [info] [forwarding][code] Prepared server

2026-07-31 09:58:46.897 [info] [remote-ssh] codeListeningOn (transport=socks; local=127.0.0.1:36375) codeConnectionToken: d398434f-c953-4ddd-b9d9-295fc76cc2e0

2026-07-31 09:58:46.897 [info] [forwarding][multiplex] creating new forwarding server

2026-07-31 09:58:46.897 [info] [forwarding][multiplex] server listening on 127.0.0.1:37153

2026-07-31 09:58:46.897 [info] [forwarding][multiplex] Prepared server

2026-07-31 09:58:46.897 [info] [remote-ssh] multiplexListeningOn (transport=socks; local=127.0.0.1:37153) multiplexConnectionToken: 4256c847-8fcd-4c36-a7e9-d76a91f6dec4

2026-07-31 09:58:46.897 [info] [remote-ssh] Pinging remote server via 127.0.0.1:37153…

2026-07-31 09:58:46.897 [info] [gpg-forwarding] GPG agent forwarding is disabled in settings

2026-07-31 09:58:46.897 [info] [remote-ssh] Resolved exec server. Transport: socks

2026-07-31 09:58:46.897 [info] [remote-ssh] Resolved authority: {“host”:“127.0.0.1”,“port”:36375,“connectionToken”:“d398434f-c953-4ddd-b9d9-295fc76cc2e0”,“extensionHostEnv”:{}}. Transport: socks

2026-07-31 09:58:46.898 [info] Setting up 0 default forwarded ports

2026-07-31 09:58:46.900 [info] [forwarding][multiplex][127.0.0.1:37153 → socks 127.0.0.1:44915 → 127.0.0.1:38723][1a816b82-d7d9-4129-97d3-3fc4857afd82] received connection request

2026-07-31 09:58:46.900 [info] [command][cf17df70-89bf-4147-ab23-8d569e681ff5] Sending command request: {“command”:“echo”,“args”:[“1”],“env”:{},“token”:“4256c847-8fcd-4c36-a7e9-d76a91f6dec4”,“id”:“cf17df70-89bf-4147-ab23-8d569e681ff5”}

2026-07-31 09:58:46.902 [info] [forwarding][code][127.0.0.1:36375 → socks 127.0.0.1:44915 → 127.0.0.1:42091][233d3712-2846-4626-a901-0b4b2c701c46] received connection request

2026-07-31 09:58:46.904 [info] [forwarding][multiplex][127.0.0.1:37153 → socks 127.0.0.1:44915 → 127.0.0.1:38723][1a816b82-d7d9-4129-97d3-3fc4857afd82] forwarding established

2026-07-31 09:58:46.905 [info] [forwarding][code][127.0.0.1:36375 → socks 127.0.0.1:44915 → 127.0.0.1:42091][233d3712-2846-4626-a901-0b4b2c701c46] forwarding established

2026-07-31 09:58:46.913 [info] [command][cf17df70-89bf-4147-ab23-8d569e681ff5] Process exited with code 0

2026-07-31 09:58:46.913 [info] [command][cf17df70-89bf-4147-ab23-8d569e681ff5] Socket close event received

2026-07-31 09:58:46.914 [info] [forwarding][multiplex][127.0.0.1:37153 → socks 127.0.0.1:44915 → 127.0.0.1:38723][1a816b82-d7d9-4129-97d3-3fc4857afd82] remote connection closed

2026-07-31 09:58:46.918 [info] [forwarding][code][127.0.0.1:36375 → socks 127.0.0.1:44915 → 127.0.0.1:42091][1fb7b880-77fb-4072-95c7-37eba650dc0e] received connection request

2026-07-31 09:58:46.922 [info] [forwarding][code][127.0.0.1:36375 → socks 127.0.0.1:44915 → 127.0.0.1:42091][1fb7b880-77fb-4072-95c7-37eba650dc0e] forwarding established

2026-07-31 09:58:46.958 [info] Saved platform linux for remote host dockerpi.local