You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Desktop stuck on "Connecting to WSL" — getDistroIp picks unreachable Docker bridge IP instead of eth0 #5211
Desktop WSL backend hangs on "Connecting to WSL..." forever. getDistroIpImpl (apps/desktop/src/wsl/DesktopWslEnvironment.ts:691) assumes the first IPv4 in hostname -I output is always the reachable eth0 address. When Docker has created bridge networks in the distro, those sort first and are never reachable from Windows — so the app polls a dead address forever.
Environment
T3 Code (Alpha) 0.0.31, Windows desktop
WSL2 Ubuntu, networkingMode=mirrored
Docker running inside the distro with active bridge networks
Repro
WSL2 + mirrored networking + any docker compose project running (creates a bridge network).
Enable WSL backend (wslBackendEnabled/wslOnly: true) and restart T3 Code.
Stuck on "Connecting to WSL..." indefinitely; restarting doesn't help, same bad IP gets picked every time.
hostname -I returned (example): 172.22.0.1 172.19.0.1 172.17.0.1 192.168.1.219 — the first three are Docker bridge IPs (internal to the WSL VM, never reachable from Windows in any networking mode); the last is the real mirrored eth0 IP, confirmed reachable. The code takes the first match, so it grabs a Docker bridge address whenever one exists.
Confirmed the backend itself was healthy the whole time (listening on 0.0.0.0:3773, curl 127.0.0.1:3773/.well-known/t3/environment → 200 from both WSL and Windows) — this is purely an address-resolution bug, distinct from #3611.
docker network prune doesn't fix it long-term — it just makes the code pick the next Docker bridge IP in the list instead.
Suggested fix
Prefer 127.0.0.1 for the readiness check under mirrored networking (already works), or
Resolve the actual default-route interface inside WSL (ip route show default) instead of trusting hostname -I ordering.
At minimum, log the full candidate list and which one was chosen.
Workaround
None without tradeoffs — any Docker bridge network breaks this, and disabling wslBackendEnabled defeats the feature.
Reacted by Moin Mir, Yassine Guedidi and Sebastien Guillemot
Update: worked around this by disabling wslOnly (native-Windows backend connected reliably, no WSL bridge involved). Re-enabled wslBackendEnabled afterward and it's now also connecting fine in the parallel WSL+Windows ("mixed") backend mode — so whatever was stalling the WSL cold start on my end has since cleared.
Separate observation worth flagging: while chasing this, I also hit cases where the WSL-hosted backend eventually did become reachable on 127.0.0.1 (confirmed via curl, and via /proc/<pid>/wchan showing it stuck in p9_client_rpc — WSL's /mnt/c/ filesystem bridge — rather than crashing), but past the 60s waitForHttpReady deadline. The desktop app never re-polled that already-spawned backend afterward and stayed on the connecting spinner until a manual restart. That's a second, independent gap from the IP-selection bug above: no retry/re-check against a backend that recovers after the readiness deadline.
Closing this out — resolved on my end (T3 now connects reliably in mixed WSL+Windows backend mode). Leaving the diagnosis above in case it's useful if this resurfaces for someone else; the underlying getDistroIp IP-selection issue wasn't fixed upstream, just no longer hitting it here.
Still reproduces on T3 Code (Beta), server 0.1.7, Windows 11 arm64, with networkingMode=mirrored. Docker Engine runs natively in the distro. The #13738 thread says mirrored mode already forces loopback, but that did not happen here.
wsl.exe -d Ubuntu -- sh -c "hostname -I" prints 172.17.0.1 (docker0, interface DOWN) first, then the real eth0 and eth2 addresses. T3 probes http://172.17.0.1:3774/.well-known/t3/environment and times out at 60 s, then 180 s. The backend listens on 0.0.0.0:3774, and http://127.0.0.1:3774/... returns 200 from Windows.
Workaround until a fix lands: put a hostname wrapper in /usr/local/bin, which precedes /usr/bin in the PATH that wsl.exe ... sh -c uses. It prints loopback for hostname -I only:
Fully quit T3 Code, including the tray, and relaunch. The backend became ready right away. The mode must be 755: with sudo tee plus chmod +x under umask 027 the file ended up rwxr-x---, and the shell silently skipped it. Remove the file to undo it. Any script that relies on hostname -I will now see 127.0.0.1.
The #5998 idea of probing 127.0.0.1 alongside the distro addresses would also fix this. Skipping docker0, br-* and veth* entries would fix the selection part.
Activity
9jaGuy commentedon Aug 11, 2026
Update: worked around this by disabling
wslOnly(native-Windows backend connected reliably, no WSL bridge involved). Re-enabledwslBackendEnabledafterward and it's now also connecting fine in the parallel WSL+Windows ("mixed") backend mode — so whatever was stalling the WSL cold start on my end has since cleared.Separate observation worth flagging: while chasing this, I also hit cases where the WSL-hosted backend eventually did become reachable on
127.0.0.1(confirmed viacurl, and via/proc/<pid>/wchanshowing it stuck inp9_client_rpc— WSL's/mnt/c/filesystem bridge — rather than crashing), but past the 60swaitForHttpReadydeadline. The desktop app never re-polled that already-spawned backend afterward and stayed on the connecting spinner until a manual restart. That's a second, independent gap from the IP-selection bug above: no retry/re-check against a backend that recovers after the readiness deadline.9jaGuy commentedon Sep 22, 2026
Closing this out — resolved on my end (T3 now connects reliably in mixed WSL+Windows backend mode). Leaving the diagnosis above in case it's useful if this resurfaces for someone else; the underlying getDistroIp IP-selection issue wasn't fixed upstream, just no longer hitting it here.
dvadovsz commentedon Nov 6, 2026
Still reproduces on T3 Code (Beta), server 0.1.7, Windows 11 arm64, with
networkingMode=mirrored. Docker Engine runs natively in the distro. The#13738thread says mirrored mode already forces loopback, but that did not happen here.wsl.exe -d Ubuntu -- sh -c "hostname -I"prints172.17.0.1(docker0, interface DOWN) first, then the real eth0 and eth2 addresses. T3 probeshttp://172.17.0.1:3774/.well-known/t3/environmentand times out at 60 s, then 180 s. The backend listens on0.0.0.0:3774, andhttp://127.0.0.1:3774/...returns 200 from Windows.Workaround until a fix lands: put a
hostnamewrapper in/usr/local/bin, which precedes/usr/binin the PATH thatwsl.exe ... sh -cuses. It prints loopback forhostname -Ionly:Fully quit T3 Code, including the tray, and relaunch. The backend became ready right away. The mode must be 755: with
sudo teepluschmod +xunder umask 027 the file ended uprwxr-x---, and the shell silently skipped it. Remove the file to undo it. Any script that relies onhostname -Iwill now see127.0.0.1.The
#5998idea of probing127.0.0.1alongside the distro addresses would also fix this. Skippingdocker0,br-*andveth*entries would fix the selection part.