[WSL2][Policy&Network] OpenShell gateway unreachable from sandbox containers on Docker Desktop WSL (binds to 127.0.0.1:8080)
Description
On Docker Desktop + WSL2, nemoclaw onboard step [2/8] fails at the sandbox-bridge reachability probe because the OpenShell Docker-driver gateway binds to 127.0.0.1:8080 (WSL distro internal loopback) instead of an interface reachable from sandbox containers.
Docker Desktop routes containers' host.openshell.internal:host-gateway to the Docker Desktop virtual host bridge 192.168.65.254, not to the WSL distro's loopback, so the probe always fails with Connection refused. This blocks all Docker Desktop WSL users — including the wsl-x86 GitLab CI runner — from completing onboard. 100% reproducible.
Note: this is independent of NVB#6331355 / #5512 (Docker GPU patch CDI failure at [6/8]). That bug is only reached AFTER [2/8] is fixed. Until this gateway-binding bug is fixed, the GPU-patch bug is masked because onboard never gets past [2/8] on a clean Docker Desktop WSL host.
Environment
Device: Custom Windows desktop (hostname 2u1g-b650-0151), NVIDIA GeForce RTX 5090 32 GB
OS: Windows 11 host + WSL2 Ubuntu 24.04.4 LTS (kernel 6.6.114.1-microsoft-standard-WSL2)
Architecture: x86_64
Node.js: v22.22.3
npm: 10.9.8
Docker: Docker Desktop (WSL2 backend) — docker-desktop runtime
OpenShell CLI: openshell 0.0.44
NemoClaw: v0.0.65
OpenClaw: N/A (onboard never reaches sandbox creation — fails at [2/8])
Steps to Reproduce
-
On a Windows 11 host with Docker Desktop (WSL2 backend) + Ubuntu 24.04 distro, ensure a clean state:
nemoclaw uninstall --yes || true -
As the test user, make sure
nvidia-smiis on PATH so GPU is detected (otherwise the no-GPU path skips ahead — see "no-GPU branch" note in Logs):echo 'export PATH="/usr/lib/wsl/lib:$PATH"' >> ~/.bashrc && source ~/.bashrc nvidia-smi # should print the RTX 5090 / GPU info -
Run the non-interactive curl install:
export NVIDIA_INFERENCE_API_KEY=nvapi-... NEMOCLAW_NON_INTERACTIVE=1 \ NEMOCLAW_INSTALL_TAG=v0.0.65 \ NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1 \ bash -c 'curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash' -
Watch
[1/8]preflight pass all checks (gateway port 8080 reported "available"). -
Watch
[2/8]start the OpenShell Docker-driver gateway, then fail the post-start sandbox-bridge reachability probe.
Expected Result
On Docker Desktop WSL, the OpenShell gateway should bind to an interface reachable from sandbox containers via host.openshell.internal:host-gateway — either 0.0.0.0:8080 or the Docker Desktop bridge interface. The sandbox-bridge probe should succeed and onboard should proceed to [3/8].
Actual Result
[2/8] Starting OpenShell gateway
Starting OpenShell Docker-driver gateway...
Gateway log: ~/.local/state/nemoclaw/openshell-docker-gateway/openshell-gateway.log
✗ Sandbox containers cannot reach the gateway at host.openshell.internal:8080.
The probe used Docker's host-gateway route, matching Docker Desktop/VM-backed Docker.
Restart Docker and the OpenShell gateway, then re-run `nemoclaw onboard`.
Onboard aborts. The gateway process is left running on the host, still bound to 127.0.0.1:8080 — so restarting Docker does not fix it (the restart-and-rerun hint is misleading on this platform).
Logs
=== Gateway log (~/.local/state/nemoclaw/openshell-docker-gateway/openshell-gateway.log) ===
2026-06-16T10:11:43.676892Z WARN openshell_server::cli: TLS disabled — listening on plaintext HTTP
2026-06-16T10:11:43.676930Z WARN openshell_server::cli: Neither mTLS (--tls-client-ca) nor OIDC (--oidc-issuer) is configured — the gateway has no authentication mechanism
2026-06-16T10:11:43.676933Z INFO openshell_server::cli: Starting OpenShell server bind=127.0.0.1:8080
2026-06-16T10:11:43.690983Z INFO openshell_server: Using compute driver driver=docker
2026-06-16T10:11:43.710963Z INFO openshell_server: Server listening address=127.0.0.1:8080
2026-06-16T10:11:43.710972Z INFO openshell_server: TLS disabled — accepting plaintext connections
=== Bind verification (WSL host side) ===
$ ss -lntp 2>/dev/null | grep 8080
LISTEN 0 128 127.0.0.1:8080 0.0.0.0:* users:(("openshell-gatew",pid=3486889,fd=15))
^^^^^^^^^ only loopback, not 0.0.0.0
=== Reachability probe from sandbox-container's perspective ===
$ docker run --rm --add-host host.openshell.internal:host-gateway alpine \
sh -c 'getent hosts host.openshell.internal; \
wget -qO- http://host.openshell.internal:8080/health 2>&1; echo exit=$?'
fdc4:f303:9324::254 host.openshell.internal host.openshell.internal
wget: can't connect to remote host (192.168.65.254): Connection refused
exit=1
=== WSL distro IPv4 address (for contrast) ===
IPv4 address for eth0: 172.24.173.136
Diagnosis:
- Gateway binds to 127.0.0.1:8080 inside the WSL distro.
- Sandbox containers on Docker Desktop WSL route `host.openshell.internal`
via `host-gateway` to Docker Desktop's virtual host bridge
(192.168.65.254), NOT to the WSL distro's loopback.
- 192.168.65.254 != 127.0.0.1 → Connection refused, 100% of the time.
No-GPU branch note:
- If nvidia-smi is NOT on PATH (e.g. gitlab-runner without /usr/lib/wsl/lib
in PATH), preflight follows the no-GPU branch and SKIPS the GPU patch,
but still hits the same [2/8] gateway probe failure. Confirmed both with
GPU enabled and GPU disabled on the same host — the gateway-binding bug
is independent of GPU configuration.
Fix direction (suggested):
- On Docker Desktop WSL, bind the gateway to 0.0.0.0:8080 (or to the
Docker Desktop bridge interface) so it is reachable via the
`host-gateway` route. The same WSL-aware branching that preflight
already uses (`Detected container runtime: docker-desktop`,
`Docker Desktop WSL detected; using Docker --gpus compatibility path`)
can drive this.
- The gateway currently has no auth ("Neither mTLS (--tls-client-ca) nor
OIDC (--oidc-issuer) is configured"), so binding to 0.0.0.0 widens the
listening surface — pair with the existing TLS/OIDC config, or restrict
to the Docker Desktop bridge address if that can be enumerated.
Found while debugging WSL CI pipeline failure: https://gitlab-master.nvidia.com/cloud-service-qa/nemoclaw/nemoclaw-test/-/jobs/341956917
Related (independent, not duplicate): NVB#6331355 / #5512 — Docker GPU patch CDI failure at [6/8]. That bug is only reached AFTER this [2/8] gateway bug is fixed.
Confirmed reproducible on Docker Desktop + WSL2; this is a NemoClaw-side bug, not an OpenShell binary default.
Root cause: NemoClaw chooses the gateway bind address and passes it to OpenShell via the OPENSHELL_BIND_ADDRESS env var. In host mode that value is GATEWAY_BIND_ADDRESS, which defaults to 127.0.0.1 (src/lib/core/gateway-address.ts; src/lib/onboard/docker-driver-gateway-env.ts). On Docker Desktop WSL, sandbox containers reach the gateway via the host-gateway route, which resolves to Docker Desktop's bridge rather than the WSL distro loopback, so the [2/8] reachability probe (src/lib/onboard/gateway-sandbox-reachability.ts) fails with Connection refused. There was no Docker-Desktop-WSL branch in the bind-address path.
Notably the containerized compat path already defaults to 0.0.0.0 (src/lib/onboard/docker-driver-gateway-launch.ts), and preflight already detects this host class (src/lib/onboard/wsl-docker-desktop-gpu.ts). Reusing that detection to bind 0.0.0.0 on Docker Desktop WSL resolves the probe. Since the gateway runs without auth, the change keeps the bind widening scoped to this host case and preserves the existing wildcard-bind warning rather than flipping the default everywhere.
Also observed: on probe failure the detached gateway started earlier in onboard is not torn down before exit, leaving an orphaned process; and this issue is independent of and ordered before #5512 (it blocks onboarding before [6/8] is reached).
Opened #5534 with a fix along these lines.
Follow-up for the orphaned-gateway symptom in this report — the gateway left running on the host after onboard aborts, which is what makes the "restart Docker and re-run" hint misleading.
Root cause: when the [2/8] sandbox-bridge probe fails, verifySandboxBridgeGatewayReachableOrExit (src/lib/onboard/gateway-sandbox-reachability.ts) calls process.exit(1) without stopping the gateway that startDockerDriverGateway started/reused/adopted earlier in the same run. The detached gateway stays bound to the loopback address, survives a Docker restart, and collides with the next attempt.
#5536 adds an onUnreachable hook to the probe verifier (fires only on a genuine unreachable result — not the soft probe-unavailable skip, and not a successful probe) and wires it at the three host-mode gateway paths to tear the gateway down via the existing stopDockerDriverGatewayProcess(). Onboarding no longer leaves an orphan, and the re-run guidance becomes accurate.
This is separate from #5534 (the bind-address fix): #5534 prevents the probe from failing on Docker Desktop WSL in the first place, while #5536 covers cleanup for any genuine probe failure on any host.
The root cause of this issue is a short Docker Desktop/WSL host-gateway readiness race during onboarding. The OpenShell gateway is already listening on 127.0.0.1:8080, but the sandbox container’s host-gateway path may not be reachable yet when NemoClaw runs the first probe.
@abhi-0906 has confirmed that retrying gateway probe fixed the issue.