Files
Srilal Sachintha f6104ee5f4 machine: remove stale API socket before starting the host proxy
Since gvisor-tap-vsock v0.9.0 (containers/gvisor-tap-vsock#718),
gvproxy and win-sshproxy no longer delete a leftover unix socket before
listening on it; they only remove it on a clean exit. When the proxy is
killed instead (host shutdown or restart, crash, SIGKILL), the API
socket is left behind and the next proxy fails to bind it:

- WSL: win-sshproxy exits and takes the named pipes with it, while
  `machine start` still reports success.
- Hyper-V, macOS and Linux: gvproxy exits, which also breaks SSH
  forwarding, so `machine start` fails (or hangs on macOS).

Remove the API socket in startNetworking, after cleanupStaleHostForwarder
has handled any orphaned proxy. On WSL a failed delete only warns, since
win-sshproxy serves only the API and SSH goes through wslrelay.

On macOS and Linux, `machine stop` also failed after gvproxy was killed
("looking up PID ...: process does not exist"); treat a missing gvproxy
as already stopped, as the Windows code does.

The "client connect to machine socket" e2e test now also kills the proxy
by the PID from its pid/tid file, restarts the machine and checks the API
again, and runs on Windows too.

Fixes: #29971
Signed-off-by: Srilal Sachintha <SrilalSachintha@Gmail.com>
2026-10-21 22:43:01 +05:30
..
…
…
…
…
…
…
…
…
…
…
…