Skip to content

bug(docker): sandboxes never become Ready on WSL 2 + Docker Desktop (supervisor dials 127.0.0.1) #3880

Description

@fede-kamel

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, every openshell sandbox create fails:

ControlSupervisorStartFailed: Docker supervisor exited before becoming ready
... Startup configuration fetch failed after 5 attempts: failed to connect to OpenShell server

The Docker driver defaults grpc_endpoint to https://127.0.0.1:<port> and runs the supervisor container with network_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:

  • A --network host container calling https://127.0.0.1:17670 gets connection refused.
  • Binding the gateway to the distro's eth0 address (WSL NAT mode) and pointing grpc_endpoint at it also fails: Docker Desktop containers can't route to the distro address.
  • Working configuration: keep the gateway on 127.0.0.1 (WSL forwards loopback listeners to Windows), and set the Docker driver endpoint to host.docker.internal. The generated server certificate already includes a host.docker.internal SAN, and for a non-localhost hostname the driver leaves resolution to Docker, so no other change is needed:
[openshell]
version = 2

[openshell.drivers.docker]
grpc_endpoint = "https://host.docker.internal:17670"

With this, sandboxes reach Ready and 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.mdx only says to "set grpc_endpoint when 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

  • On WSL 2 + Docker Desktop, a default install plus openshell sandbox create reaches Ready without manual config. The fix could be driver detection (for example, Docker Desktop engine plus a WSL kernel defaulting grpc_endpoint to host.docker.internal), or the Linux installer writing that setting when it detects WSL + Docker Desktop.
  • Or, at minimum, the installation and runtime docs describe the working grpc_endpoint for WSL 2 + Docker Desktop.
  • The ControlSupervisorStartFailed message for a supervisor that can't reach the gateway mentions grpc_endpoint.

Reproduction Steps

  1. Windows 11, WSL 2 in NAT networking mode, Docker Desktop with WSL integration enabled.
  2. Install OpenShell 0.1.2 inside the distro and run the gateway as the user service (default bind 127.0.0.1).
  3. openshell sandbox create --name demo -- echo hi fails with ControlSupervisorStartFailed.
  4. Add the TOML above to ~/.config/openshell/gateway.toml, then systemctl --user restart openshell-gateway.
  5. Repeat step 3. The sandbox becomes Ready.

Environment

  • OpenShell 0.1.2 (CLI and gateway from the release assets)
  • Ubuntu on WSL 2, kernel 6.18.x-microsoft-standard-WSL2, networkingMode=nat
  • Docker Desktop, engine 29.4.1
  • Compute driver: docker; gateway: local systemd user service with mTLS

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions