Skip to content

Skip SSH remote hosts on Windows - #1110

Merged
thesiti92 merged 1 commit into
mainfrom
remote/14-windows-skip-remote-hosts
Oct 15, 2026
Merged

thesiti92 merged 1 commit into
mainfrom
remote/14-windows-skip-remote-hosts

Conversation

@thesiti92

Copy link
Copy Markdown
Contributor

Starting the remote hosts manager called reviewSshControlDirectory(), which throws on Windows (no uid, no ControlMaster sockets), so every Windows launch hit an unhandled rejection after the first window opened. startRemoteHosts now returns early on win32; every other entry point already treats a missing manager as "Remote hosts are off."

Windows OpenSSH support is a separate follow-up.

Stacked on #1032.

@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 63023fd to be5f439 Compare October 13, 2026 21:49
@thesiti92
thesiti92 added this pull request to stack #1117 October 13, 2026 22:42
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from be5f439 to 21711dd Compare October 13, 2026 22:53
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 21711dd to 87bc2a9 Compare October 13, 2026 22:54
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch 4 times, most recently from 862d5c7 to 66e8d29 Compare October 14, 2026 07:13
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 66e8d29 to f18e7a2 Compare October 14, 2026 14:14
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from f18e7a2 to 1c4116f Compare October 14, 2026 17:27
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch 2 times, most recently from 3457ff5 to 6edcff0 Compare October 14, 2026 17:51
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 6edcff0 to c707aba Compare October 14, 2026 18:03
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from c707aba to 5d0fc37 Compare October 14, 2026 18:21
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch 2 times, most recently from 4b83bd6 to 5e4dbbf Compare October 14, 2026 19:29
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 5e4dbbf to 1c7a20a Compare October 14, 2026 19:36
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 1c7a20a to ef525fe Compare October 14, 2026 19:37
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from ef525fe to 58818f4 Compare October 14, 2026 19:44
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 58818f4 to 4fa6bf4 Compare October 14, 2026 19:53
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 4fa6bf4 to 0875c35 Compare October 14, 2026 19:56
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 0875c35 to 9ea1b9c Compare October 14, 2026 20:06
@thesiti92
thesiti92 removed this pull request from stack #1117 October 14, 2026 20:13
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 9ea1b9c to 85026e8 Compare October 14, 2026 20:44
@thesiti92
thesiti92 changed the base branch from remote/13-dev-remote-updates to remote/12-host-down-surfaces October 14, 2026 20:44
An error occurred while trying to automatically change base from remote/12-host-down-surfaces to remote/11-host-status October 14, 2026 20:58
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 85026e8 to e3f43f0 Compare October 14, 2026 21:52
@thesiti92
thesiti92 changed the base branch from remote/12-host-down-surfaces to main October 14, 2026 21:52
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from e3f43f0 to 5d8b09d Compare October 15, 2026 01:14
@thesiti92
thesiti92 added this pull request to stack #1148 October 15, 2026 01:14
@thesiti92
thesiti92 marked this pull request as ready for review October 15, 2026 01:14
The control directory needs a uid, which Windows lacks, so starting the
hosts manager threw at startup. Windows OpenSSH support comes later.
@thesiti92
thesiti92 force-pushed the remote/14-windows-skip-remote-hosts branch from 5d8b09d to 0787669 Compare October 15, 2026 01:45
@thesiti92
thesiti92 merged commit e284f98 into main Oct 15, 2026
3 checks passed
@thesiti92
thesiti92 deleted the remote/14-windows-skip-remote-hosts branch October 15, 2026 02:12
thesiti92 added a commit that referenced this pull request Oct 15, 2026
Win32-OpenSSH has no ControlMaster, so Windows needs a way to reach a
host without sharing one connection. This adds a direct session (a
`ReviewSshSession` without `controlPath`), following the approach
Remote-SSH took for Windows in microsoft/vscode-remote-release#96:

- each command opens its own connection, with `BatchMode=yes`, so ssh
never prompts;
- one long-lived `ssh -N -T -D 127.0.0.1:<port>` per host; it binds its
SOCKS port only after logging in, which is the ready check;
- `-L` forwards become in-process loopback listeners that tunnel through
that SOCKS port (`reviewSocksForward.ts`);
- the installer's `-R` npm relay runs in its own ssh, and reads the port
from ssh's `Allocated port` line (forced to `LogLevel=INFO`).

Nothing selects direct mode yet except `DEV_FAST_REVIEW_SSH_DIRECT=1` in
development builds. Control mode is unchanged.

Tests: unit tests for the SOCKS forward and the direct args;
`reviewSshDirect.containers.test.ts` runs a real direct master, a
forward to the host's sshd, and a held `-R` round trip against a
container (`WB_TEST_CONTAINERS=1`). The `remote-host` journey reaches
`online` in direct mode. Its later Home step fails at this stack tip in
both modes because the Home rewrite (#1098) removed the table it looks
for.

Stacked on #1110.
thesiti92 added a commit that referenced this pull request Oct 15, 2026
Turns remote hosts back on for Windows laptops (reverting #1110's early
return) with direct sessions from #1113.

- The inbox `%SystemRoot%\System32\OpenSSH\ssh.exe` is used when
present, ahead of an MSYS ssh (Git for Windows) on PATH.
- ssh runs with `windowsHide` and not detached; a detached ssh gets a
console window on Windows.
- Windows needs a key ssh-agent can use and a host already in
known_hosts. A refused key says to use `ssh-add`; an unknown host key
already says to run `ssh <alias>` in a terminal.
- `Include` globs in ssh_config take forward slashes on Windows.
- docs/remote-hosts.md: the Windows setup.

Checked in a Windows 11 VM (24H2, ARM64, inbox OpenSSH 9.5p1) against a
Linux container with the real modules and the Desktop's spawn options:
picks the inbox ssh.exe; exec and the probe run with no prompt and no
window; `uploadFile` is byte-exact into a path with a space; the `-D`
master, a forward to the host's sshd and a held `-R` round trip work; an
unknown host key and an unauthorized key fail fast with ssh's own
messages; an `Include` with a Windows path lists its aliases; no ssh.exe
is left after. A dev build of this branch also ran in that VM (ARM64
Electron), against a Linux host with Whiteboard on its PATH, using an
ssh-agent key: online in 10 s, `/health` through the SOCKS forward, a
killed master recovered in under 2 s, and a normal quit left no ssh.exe.
Dev-only gaps on Windows ARM64, unrelated to this change, kept it from
the UI and the dev install: `run.sh` looks for `review` rather than
`Whiteboard.exe` and hands MSYS paths to node, the curated extensions
and `diffr` have no win32-arm64 target, and the dev pack (`pnpm pack`)
fails there.

Stacked on #1113.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants