Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/desktop
Steps to reproduce
- On Windows with WSL2 in default NAT networking, run a host where Windows → WSL NAT-IP HTTP is filtered but WSL localhost forwarding works (in my case a corporate endpoint security client intercepts traffic to private ranges).
- Enable Settings → WSL backend (dual mode, "WSL only" off) and pick a distro.
- Open the command palette and look for Open WSL folder, or try adding a Linux project.
Expected behavior
The desktop connects to the WSL backend and the WSL environment becomes usable, like VS Code/Cursor Remote-WSL on the same machine.
Actual behavior
The WSL backend process starts and is healthy, but the desktop never marks it ready. resolveWslStartConfig sets httpBaseUrl to the distro's hostname -I IP in NAT mode, and every readiness probe to it fails. "Open WSL folder" never appears and WSL projects can't be added.
Measured from the same Windows host against the same backend:
| From | URL | Result |
|---|---|---|
| inside WSL | http://<wsl-nat-ip>:3774/.well-known/t3/environment |
200 in 4ms |
| Windows | http://127.0.0.1:3774/... (wslhost forwarding) |
200 in 81ms |
| Windows | http://<wsl-nat-ip>:3774/... (what the desktop uses) |
TCP connects, then "connection closed unexpectedly" after ~3.7s |
Routing is correct (the WSL NAT subnet routes via vEthernet (WSL (Hyper-V firewall)), and eth0 is the default route in the distro), so this isn't the wrong-interface case from #5211. The right IP is chosen but isn't reachable over HTTP from Windows.
For comparison, Cursor's Remote-WSL (anysphere.remote-wsl 1.0.13) on the same machine binds its server to 127.0.0.1 inside WSL and always connects from Windows through http://127.0.0.1:<port>, and it works.
Impact
Blocks work completely
Version or commit
0.0.43-nightly.20260925.2269 (also reproduced on the previous stable release); code path unchanged on main @ 2a9832b80
Environment
Windows 11 Enterprise, WSL2 NAT mode (no .wslconfig), Ubuntu 24.04 distro, T3 Code desktop (dual mode: Windows primary + WSL secondary)
Logs or stack traces
# desktop.trace.ndjson — thousands of these, never succeeding
http.client GET http://<wsl-nat-ip>:3774/.well-known/t3/environment exit: Failure
# server-child-wsl_<distro>.log — backend itself is healthy
Listening on http://0.0.0.0:3774Screenshots, recordings, or supporting files
No response
Workaround
Switching WSL to networkingMode=mirrored should make the desktop use loopback, but it changes networking for every distro.
I have a small fix on a branch that I can open as a PR if you want it. For WSL NAT runs it dials 127.0.0.1 first, as VS Code and Cursor do, and keeps the distro IP as a readiness fallback, so hosts where wslhost forwarding is unreliable (the reason for the current behavior) still connect. It's about 60 source lines in DesktopBackendConfiguration.ts and DesktopBackendManager.ts, with focused tests, and I've verified it end to end on the affected machine.
Activity
Ganboo commentedon Sep 26, 2026
Related
juliusmarminge commentedon Sep 26, 2026
The diagnosis matches current
main(unchanged in these files since2a9832b80). In default WSL2 NAT mode,resolveWslStartConfigadvertises the distro address fromgetDistroIp(hostname -I's first IPv4, when that address is not on a Windows interface).waitForHttpReadyprobes only that URL and retries until it answers, so the WSL environment never connects and "Open WSL folder" stays hidden. The backend can still be healthy on0.0.0.0, and Windows127.0.0.1via wslhost is simply never tried.That NAT URL is deliberate. The comment in
resolveWslStartConfigrecords hosts where wslhost forwarding fails and only the distro address works. This report is the inverse: endpoint security drops the NAT address, and localhost forwarding works. It is not #5211 (wronghostname -Ientry). That selection bug is still present, but you already checked that the chosen address is the real eth0 route. #5967 was the same splash without this evidence, so this issue should stay the canonical report.#9066 does not fix this. It still advertises the NAT address, and in local-only mode it binds only that address, which removes the WSL loopback listener this host needs. #10358 would help a local-only setup by advertising
127.0.0.1, but it gives up the distro-IP fallback that other machines need.A small PR is welcome if it stays on this one behavior: keep the
0.0.0.0bind, probe127.0.0.1first, and fall back to the distro IP when loopback does not answer. The URL that succeeds has to be the one the renderer keeps using. Please include a test for each order, and leave #9056's bind-host change out of it.networkingMode=mirroredremains a working workaround because that mode already forces loopback.Ganboo commentedon Sep 26, 2026
Thanks @juliusmarminge made some adjustments and linked my PR above.
Let me know if any changes are necessary.
rntjr commentedon Nov 7, 2026
Another trigger for the same symptom:
ufwenabled inside the WSL distro. Same mechanism as described here (Windows can't reach the distro NAT IP, loopback works), but the block is the Linux firewall rather than endpoint security on Windows.Environment: T3 Code desktop 0.1.7 on Windows, WSL backend enabled, WSL2 default NAT networking,
ufwactive in the distro (default policyINPUT DROP; only22/tcpand60000:61000/udpallowed).Repro:
sudo ufw enable(default rules)Diagnostics:
~/.t3/wsl-runtime/sha256-*/t3 --version→t3 v0.1.7. Started by hand, it logsListening on http://127.0.0.1:3773and prints a pairing URL.curl.exe http://localhost:3773/.well-known/t3/environment→ works (wslhost forwarding)curl.exe http://<distro-ip>:<port>→ timeout (curl: (28)after ~21 s), even againstpython3 -m http.server 8000 --bind 0.0.0.0, so it's not T3-specificping <distro-ip>→ works. ufw allows ICMP echo-request, which makes the network look fine.Get-NetFirewallHyperVVMSetting -Name '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}'→DefaultInboundAction: Allow; no Block rules inGet-NetFirewallHyperVRule. No VPN involved.sudo iptables -S→-P INPUT DROPwith the ufw chains; only--dport 22(tcp) and60000:61000(udp) acceptedWorkaround:
Alternatives:
sudo ufw disable,networkingMode=mirrored, or run the backend manually and connect as a remote environment overlocalhost.The loopback-first probe proposed here would fix this case too. It would also help if the desktop showed a hint after N seconds of failed readiness probes (e.g. "backend started but its distro IP isn't reachable from Windows; check ufw/iptables inside WSL or endpoint security on Windows") instead of an endless spinner.
Carvalh0XYZ commentedon Nov 13, 2026
Another trigger for the same symptom: the WSL Hyper-V firewall blocks inbound traffic to the VM by default on some managed Windows machines.
Environment: T3 Code Nightly
0.1.10-nightly.20261113.4643(Electron 44.10.1) on Windows 11, WSL backend in WSL-only mode, WSL2 default NAT networking. Ubuntu distro withoutufw. No VPN in the path; the Global Secure Access forwarding profile bypasses172.16.0.0/12.Symptom: the desktop stays on "Connecting to WSL…".
desktop.trace.ndjsonshowsGET http://172.17.2.191:3773/.well-known/t3/environmentinterrupted every second. The WSL server is healthy and listens on0.0.0.0:3773.Diagnostics (before the fix):
http://127.0.0.1:3773/.well-known/t3/environment: 200 (wslhost forwarding)http://172.17.2.191:3773/...: timeout.Test-NetConnection -Port 3773→Falseping 172.17.2.191: works, so the network looks fine172.17.0.1reaches port 3773 (nosyn-recventries during the attempt)Get-NetFirewallHyperVVMSetting -PolicyStore ActiveStore→Name {40E0AC32-46A5-438A-A0B2-2B479E8F2E90},DefaultInboundAction: BlockWorkaround (elevated PowerShell):
After the fix: Windows →
http://172.17.2.191:3773/.well-known/t3/environmentreturns 200 in 6 ms, the desktop readiness probe succeeds, and the app connects to the WSL backend.This is a third cause besides endpoint security and
ufwin the distro. All three leave loopback working, so the loopback-first probe from #13745 would fix each of them without a firewall change. #13745 was closed because nobody had a Windows/WSL2 machine for the proof. This machine reproduces the base failure reliably: remove the Hyper-V rule to make the distro IP unreachable whilelocalhoststill works. I can test a fresh PR on it.Karthik-beta commentedon Nov 14, 2026
Opened #36833 with the scope described above:
0.0.0.0bind and probes127.0.0.1first. The distro IP is a fallback in NAT mode only; mirrored mode has no fallback, as before.I tested it on Windows 11 with WSL2 in NAT mode, with the distro IP blocked from Windows. The current code timed out probing only the distro IP. With the fix, the app connected over loopback.
This builds on #13745 by @Ganboo, who is credited as co-author.
Couiz commentedon Nov 15, 2026
Another trigger for the same symptom: Docker bridges inside the distro make mirrored mode look like NAT.
Environment: T3 Code Nightly
0.1.10-nightly.20261115.4736on Windows 11, dual mode (Windows primary + WSL backend), Ubuntu-24.04,.wslconfigwithnetworkingMode=mirrored, Docker Engine installed in the distro.Symptom: after an app restart the WSL environment never connects and all its threads disappear from the UI. The backend child log ends with:
Diagnostics:
0.0.0.0:3774. Windows →http://127.0.0.1:3774/.well-known/t3/environmentreturns 200.hostname -Iin the distro printed the Docker bridges first, then the mirrored addresses:172.24.0.1 172.18.0.1 ... 172.17.0.1 10.10.0.2 192.168.0.164docker0andbr-*have lower interface indexes than the mirroredeth*interfaces. All bridges were DOWN (no containers running).getDistroIptakes the first IPv4 (172.24.0.1). It is not on a Windows interface, soisLocalHostIpv4is false and the desktop dials the bridge address instead of127.0.0.1. That address is not reachable from Windows.127.0.0.1and worked; the address order differed then.So here the mirrored-mode check fails because it looks only at the first address, not because of a firewall. Probing
127.0.0.1first, as #36833 does, should cover this case too (not tested on this machine).Workaround: remove the bridge addresses so a mirrored address comes first, then restart the app:
It comes back after Docker or WSL restarts.
Investigated by Claude Code (claude-fable-5-2) on the affected machine.
dpearson2699 commentedon Nov 30, 2026
Reproduced on the latest nightly with mirrored WSL and Tailscale
Environment: T3 Code
0.1.14-nightly.20261130.5465(win32 x64), WSL2 Ubuntu 26.04, mirrored networking (wslinfo --networking-modereportsmirrored), Tailscale in both Windows and WSL, and T3 Code in WSL-only mode.hostname -I, ahead of the mirrored addresses.http://127.0.0.1:3773/returned HTTP 200. The same request to the WSL Tailscale IP timed out from Windows and returned 200 from inside WSL.The desktop bridge reported the WSL Tailscale IP as the primary backend URL. The desktop's local bearer-token request remained pending during testing. In this build,
getDistroIptakes the first IPv4 fromhostname -I. Because the first address belongs only to the WSL Tailscale interface, the Windows-interface check inresolveWslStartConfigdoesn't select localhost. This looks like the mirrored-mode case reported above with Docker bridges, withtailscale0supplying the first address.I tested a local change to use
127.0.0.1for the WSL backend URL. The token request succeeded and the desktop opened to the normal UI with the New Thread control. This also worked after a normal relaunch. That verifies the loopback path on this setup and is relevant to #36833.