Repository navigation
bug(docker): sandboxes never become Ready on WSL 2 + Docker Desktop (supervisor dials 127.0.0.1) #3880
Description
Activity
- addedstate:triage-neededOpened without agent diagnostics and needs triageOpened without agent diagnostics and needs triage
on Sep 29, 2026 - added a commit that references this issue
on Sep 30, 2026 I ran into same issue on macOS
Environment
- macOS 26.6.2, Apple Silicon (M1)
- Docker Desktop 4.76.0, engine 29.5.2
- OpenShell 0.1.2
What happens
openshell statusreports Connected andopenshell doctor checkpasses. Then:openshell sandbox create --name demo --no-auto-providersfails with:
ControlSupervisorStartFailed: Docker supervisor exited before becoming ready ... Startup configuration fetch failed after 5 attempts: failed to connect to OpenShell serverWorkaround
The fix from this issue works on macOS too. I added this to$(brew --prefix)/var/openshell/gateway.toml:[openshell.drivers.docker] grpc_endpoint = "https://host.docker.internal:17670"and ran
brew services restart openshell. After that the sandbox reaches Ready and the first network policy tutorial runs end to end. So this issue is not just limited to to WSL 2. A default install on macOS with Docker Desktop fails the quickstart the same way.📋 triage-agent
Triage Assessment
Classification: validated-bug
Summary
The Docker driver behaves as described. With
grpc_endpointunset, the supervisor container runs with host networking and dials127.0.0.1:<gateway port>. Under Docker Desktop, "host" is the Docker Desktop VM, not the WSL distro, so this default may not reach a gateway bound to the distro's loopback. The reported workaround (grpc_endpoint = "https://host.docker.internal:17670") is consistent with the code: that name is a default server certificate SAN, and the driver leaves non-localhosthostnames to Docker's resolver. Confidence: medium. The code path is confirmed; the WSL failure was not reproduced here.Investigation
- Default endpoint:
crates/openshell-driver-docker/src/lib.rs:885-890and:6512-6515({scheme}://127.0.0.1:{port}). - Supervisor host networking:
lib.rs:4979-4986. Host aliases are added only for IPv4 addresses andlocalhost; other hostnames resolve through Docker (lib.rs:5023-5034). host.docker.internalSAN:crates/openshell-bootstrap/src/pki.rs:32-41.- The driver already detects WSL2 from
docker info(lib.rs:5582-5595), but only uses it for the GPU fallback (lib.rs:877), not for endpoint selection. - Docs:
docs/how-it-works/sandboxes/runtimes.mdx:97says to setgrpc_endpointwhen sandboxes cannot reach host loopback, but gives no value or WSL 2 example. The support matrix lists WSL 2 + Docker Desktop as Experimental. - Error text:
Docker supervisor exited before becoming ready(lib.rs:5380) does not mentiongrpc_endpoint. - Distinct from WSL2 (kernel 6.6.87, Docker Engine): sandbox create fails with "seccomp notification probe: notification launcher disappeared" #3842 (seccomp probe failure earlier in startup). No duplicate found. fix(docker): reach a WSL 2 gateway through Docker Desktop's host alias #3924 from the reporter proposes a fix; it has not been reviewed as part of triage.
Open question for the reporter:
runtimes.mdxstates that Docker Desktop must have host networking enabled (Settings > Resources > Network). Was it enabled in your Docker Desktop when the default configuration failed? This determines whether the loopback default fails even with the documented prerequisite met, or only without it. The docs and error-message gaps apply either way.Impact Signals
- Affected users/scope: Users on Windows with WSL 2 + Docker Desktop and the Docker driver (an Experimental platform in the support matrix). Every sandbox create fails in the reported setup.
- Regression: No evidence of a regression. Supervisor host networking dates to v0.0.100; reported on v0.1.2 (latest), and the code is unchanged on main.
- Workaround: Available: set
[openshell.drivers.docker] grpc_endpoint = "https://host.docker.internal:<port>"and restart the gateway. It is not documented, and the failure message does not point to it. - Evidence quality: Medium. Clear reproduction steps and environment, and code confirms the default behavior. Not reproduced on WSL here, and the Docker Desktop host-networking setting is unconfirmed.
Human Decision Required
Decide whether OpenShell should address this issue. If yes, apply
state:accepted, associate it with a roadmap item, or do both, and decide
whether the work remains human-owned. Either action records acceptance;
roadmap placement additionally records sequencing.
To queue investigation or planning for an unattended agent, also apply
agent:plan-requested. You can instead directly ask an agent to use
create-spikeorbuild-from-issueon this issue; the agent will warn about
missing expected workflow labels and continue without changing them. If no,
close it as not planned and record the rationale.- Default endpoint:
- addedstate:acceptedA maintainer decided OpenShell should pursue this issueA maintainer decided OpenShell should pursue this issuetopic:compatibilityCompatibility-related workCompatibility-related workand removedstate:triage-neededOpened without agent diagnostics and needs triageOpened without agent diagnostics and needs triage
on Oct 1, 2026 Data point for the open question, on macOS: Docker Desktop 4.93.0 (engine 29.8.1), macOS 26.4.1 on Apple Silicon, OpenShell 0.1.2 standalone gateway bound to 127.0.0.1 with the Docker driver and the default
grpc_endpoint.With host networking off,
openshell sandbox createfails withStartup configuration fetch failed after 5 attempts: failed to connect to OpenShell server. After enabling host networking (Settings > Resources > Network) and changing nothing else, the same sandbox starts and runs.openshell doctor checkreported all checks passed in both cases.So on macOS the loopback default works once the documented prerequisite is met.
macOS Homebrew repro (0.1.2, Docker Desktop, host networking off)
Confirmed the same failure and workaround on native macOS (not WSL).
Environment
- macOS Darwin 25.6.0, Apple Silicon (arm64)
- OpenShell 0.1.2 via Homebrew (
install.sh/brew install nvidia/openshell/openshell) - Docker Desktop 29.7.2 (engine
desktop-linux) - Gateway: local Homebrew service, mTLS, bound to
127.0.0.1:17670 - Compute driver: docker (auto-detected)
- Docker Desktop host networking: off (default)
Steps
openshell status→ Connectedopenshell doctor check→ All checks passedopenshell sandbox create --name demo --detach
Result (default config)
Sandbox stuck in
Error/ControlSupervisorStartFailed:Docker supervisor exited before becoming ready; log tail: openshell: log push connect failed: failed to connect to OpenShell server ... Startup configuration fetch failed after 5 attempts: failed to connect to OpenShell serverSupervisor container used
network_mode=hostwithOPENSHELL_ENDPOINT=https://127.0.0.1:17670.
Under Docker Desktop on macOS, host networking is the Docker VM namespace, not the Mac host where the Homebrew gateway listens.Workaround (works end-to-end)
Add to
$(brew --prefix)/var/openshell/gateway.toml:[openshell.gateway] compute_driver = "docker" [openshell.drivers.docker] grpc_endpoint = "https://host.docker.internal:17670"
Then:
brew services restart openshell openshell sandbox delete demo openshell sandbox create --name demo --detach
Sandbox reaches
Ready;openshell sandbox exec -n demo -- uname -asucceeds.Ask
Please extend #3924 (or equivalent) to cover macOS Homebrew + Docker Desktop, not only WSL 2. Alternatively, ship this
grpc_endpointdefault in the Homebrew formula'spost_installgateway.toml so the quickstart works without manual config.Related:
openshell doctor checkpasses even when sandboxes cannot reach the gateway (#4133).- added a commit that references this issue
on Oct 9, 2026 Adding a macOS data point, and a side effect of the workaround above that took a while to trace.
Environment
- macOS 26.6.2, Apple Silicon
- Docker Desktop 4.88.1 (engine 29.8.2)
- OpenShell 0.1.2, installed with install.sh and OPENSHELL_VERSION=v0.1.2, gateway running as the Homebrew service on 127.0.0.1:17670
1. A fresh install reproduces this issue. The first sandbox create fails after about 13 seconds with
ControlSupervisorStartFailed: Docker supervisor exited before becoming readyandStartup configuration fetch failed after 5 attempts: failed to connect to OpenShell server, even thoughopenshell statusreports Connected.2. The workaround makes sandboxes start, but they can no longer reach the host. @arjunkchr, one caution on making this the default: with
[openshell.drivers.docker] grpc_endpoint = "https://host.docker.internal:17670"
sandboxes start in under a second. But inside the sandbox,
host.openshell.internalandhost.docker.internalboth fail to resolve ("No address associated with hostname"), even with a policy that allows them. The sandbox log shows:NET:REFUSE [MED] DENIED host.docker.internal [reason:policy_dns_trusted_gateway_unavailable]3. Cause, from reading the v0.1.2 source. The supervisor takes its trusted host gateway from a
host.openshell.internalline in its own /etc/hosts (detect_trusted_host_gatewayin proxy.rs). The Docker driver only adds that line whengrpc_endpointis an IPv4 literal or localhost (docker_supervisor_host_addressin the Docker driver lib.rs, around lines 4999 to 5009). With a hostname endpoint it returns None, the supervisor container getsExtraHosts=[](confirmed with docker inspect), and every host alias is refused. Pointinggrpc_endpointat the VM host address (192.168.65.254) would add the line, but the generated server certificate has no IP SAN for that address (I checked the SAN list with openssl x509), so I expect TLS verification to fail. I did not test this: I never created a sandbox with that endpoint.So on Docker Desktop for Mac the choice today is: sandboxes do not start (default), or sandboxes start but cannot reach any service on the host (workaround). The supervisor middleware example in the docs (
http://host.openshell.internal:50051) needs exactly that host access.4. What works. Enabling Docker Desktop host networking (Settings, Resources, Network) and keeping the default gateway config, as reported above. Sandboxes start in under a second and reach
host.openshell.internal, and default deny still holds: with a policy allowing one host port, probes to other host ports, the gateway port, public hosts, Docker's host IP and loopback were all refused.Suggestions
- Have the Docker driver add
host.openshell.internalwhengrpc_endpointishost.docker.internal(resolve it when the sandbox is created), or allow the host gateway address to be set in the driver config. - The sandbox runtimes page already says Docker Desktop must have host networking enabled. Surfacing that in the support matrix and the installation page would catch it before the first sandbox create, and troubleshooting entries for
ControlSupervisorStartFailedand the undocumentedpolicy_dns_trusted_gateway_unavailablereason code would help anyone who misses it.
The full timestamped log, with commands, outputs and source links, is public here (entries 13 to 20 and 27): https://github.com/SoniaMehta14/paved-gate/blob/main/docs/openshell/FRICTION_LOG.md
User Story
As a developer on Windows using WSL 2 with Docker Desktop (listed as an experimental platform in the support matrix), I want a default local install to create a working sandbox, so I can follow the quickstart without reverse-engineering the Docker driver's networking.
Problem Statement
With the gateway running as the default systemd user service inside the WSL distro (bound to
127.0.0.1:17670) and Docker Desktop providing the engine, everyopenshell sandbox createfails:The Docker driver defaults
grpc_endpointtohttps://127.0.0.1:<port>and runs the supervisor container withnetwork_mode: host. Under Docker Desktop, the host network is the Docker Desktop VM, not the WSL distro, so the supervisor never reaches the gateway.What I tried:
--network hostcontainer callinghttps://127.0.0.1:17670gets connection refused.eth0address (WSL NAT mode) and pointinggrpc_endpointat it also fails: Docker Desktop containers can't route to the distro address.127.0.0.1(WSL forwards loopback listeners to Windows), and set the Docker driver endpoint tohost.docker.internal. The generated server certificate already includes ahost.docker.internalSAN, and for a non-localhost hostname the driver leaves resolution to Docker, so no other change is needed:With this, sandboxes reach
Readyand the "Run Your First Agent" flow works end to end.Impact / Why This Matters
The installer targets this platform, but the out-of-box result is a hard failure whose message points at connectivity rather than configuration.
runtimes.mdxonly says to "setgrpc_endpointwhen sandboxes cannot reach the gateway on host loopback" and doesn't say what value to use. The obvious guess, the WSL address, doesn't work.This is a different failure from #3842: on WSL kernel 6.18 the seccomp notification probe passes, and sandbox startup fails later, at gateway connectivity.
Acceptance Criteria
openshell sandbox createreachesReadywithout manual config. The fix could be driver detection (for example, Docker Desktop engine plus a WSL kernel defaultinggrpc_endpointtohost.docker.internal), or the Linux installer writing that setting when it detects WSL + Docker Desktop.grpc_endpointfor WSL 2 + Docker Desktop.ControlSupervisorStartFailedmessage for a supervisor that can't reach the gateway mentionsgrpc_endpoint.Reproduction Steps
127.0.0.1).openshell sandbox create --name demo -- echo hifails withControlSupervisorStartFailed.~/.config/openshell/gateway.toml, thensystemctl --user restart openshell-gateway.Ready.Environment