WSL2: Mirrored networking fails to forward correct SSH address
- Dominant language
- Go
- Stars
- 21.9k
- Forks
- 957
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 53
Description
### Description
Corporate VPNs can be restrictive about their network policies and often do not have exceptions for the WSL NAT architecture used by traditional WSL2 VMs, leading to the VM setup stage failing when connected to such VPNs.
Setting `networkingMode=mirrored` allows a bypass for this and allows the Lima instance to be created, however it seems that it remains broken after the fact. Any attempts to SSH will time out. This is because per Microsoft [docs](https://learn.microsoft.com/en-us/windows/wsl/networking), SSH should connect to `localhost` or `127.0.0.1` to communicate with the machine, however in our code we check for the output of `hostname -I` within the VM, which doesn't work for mirrored networking.
It should be a simple fix of just returning localhost when mirrored networking is enabled.
Contributor guide
Research direction
Search the Go code that derives the SSH address from `hostname -I`, then trace how `networkingMode=mirrored` is represented and selected. Verify the SSH path for mirrored WSL2 networking and confirm that it uses localhost while other networking modes retain their existing address behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100