WSL: callback forward + wslview auto-open (flakes-q3l5)
WSL/Windows (Case 2) side of flakes-mqe9. Chain: Windows → WSL (Ubuntu, home-manager-managed) → ssh host → incus exec → container. Fully declarative because WSL is managed by this repo; wslview (wslu) / cmd.exe /c start opens the Windows default browser from WSL.
Callback (needed for Phase A too)
-
programs.ssh.matchBlocks.mcp-oauth-pc(Host pc pc.* desktop desktop.* 172.22.1.9,LocalForward 3118 10.100.0.100:3118) inpacks/home/host/common/mcp-oauth-forward.nix— host profiles only (in containers CC itself listens on 3118). Windowslocalhost:3118/callback→ WSL localhost forwarding → WSL ssh -L → pc → yolomcp-oauth-bridge(socat eth0:3118 → 127.0.0.1:3118) → CC. - Verified: generated ssh config for
yjparkhas the LocalForward,yj@yolodoes not; in yolo,curl 10.100.0.100:3118/callback?...reaches a stand-in127.0.0.1:3118listener through the bridge. - (2026-10-22: Cloudflare sign-in from the x1 worked end to end with a manual
ssh -L 3118:10.100.0.100:3118; still to see with the managed config once flakes-tnjz is done) Activate home in WSL, then do a real MCP OAuth from yolo (e.g. Cloudflare, flakes-pbel) via Windows → WSL → ssh pc → incus yolo, one click on the printed link. (Confirms WSL2 localhost forwarding of the 127.0.0.1-bound ssh -L, and that the ssh host alias used from WSL matches the Host patterns.) - Direct Windows OpenSSH (unmanaged): add the same block to
%USERPROFILE%\.ssh\configby hand:Host pc pc.* desktop desktop.* 172.22.1.9 LocalForward 3118 10.100.0.100:3118
Phase B — zero-click auto-open (deferred: one click on the OSC link is fine, per user 2026-10-22)
- WSL open-listener that runs
wslview <url>(ensurewsluinstalled in the WSL home profile). - WSL ssh
RemoteForward 10.100.0.1:OPEN localhost:OPEN(bind host bridge IP) so container→gateway:OPEN→tunnel→WSL listener→wslview. - Host sshd
GatewayPorts clientspecified(the one non-flake host tweak) so the -R can bind the bridge IP. - Attach wrapper detects
SSH_CONNECTIONand injectsBROWSER_ROUTEaccordingly; OSC (Phase A) stays the fallback.