WSL: [BUG] WSL2 loses internet connection when Mobile Hotspt is turned on
Windows Version
Microsoft Windows 11 [Version 21H2] [OS Build 22000.1936)
WSL Version
1.2.5.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
5.15.90.1
Distro Version
Ubuntu 20.04
Other Software
Visual Studio Code 1.77.2 with Remote WSL-Extension 0.77.0
Repro Steps
- Open WSL2 on a Windows 11 machine.
- Connect to the internet.
- Turn on Mobile Hotspot on the same Windows 11 machine.
- Observe that the WSL2 loses internet connection.
Expected Behavior
The WSL2 should maintain its internet connection when the Mobile Hotspot is turned on in the Windows 11 machine.
Actual Behavior
When a user turns on Mobile Hotspot on their Windows 11 machine, the WSL2 loses internet connection and is unable to connect to any external network resources. The WSL2 network adapter appears to be disconnected and cannot be reconnected until the Mobile Hotspot is turned off.
❗ NOTE: This bug only affects WSL2 and NOT the Windows host machine.
Example: Running the sudo apt update && sudo apt upgrade command will fail to update the packages and report errors, as shown below in the screenshots.
Screenshots
Diagnostic Logs
No response
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 3
- Comments: 19 (4 by maintainers)
Awesome thanks! Yes changing the networking mode from NAT to mirrored fixed it for me. I was not aware this was an option.
@LuckyLub : thanks. There are lots of WinNat errors. it’s not clear where winnat is not working with Hotspot supports. I don’t see a Hotspot interface being created - which suggests there’s a separate driver / interface configuration breaking things 😦
Are you able to enable networking mode = Mirroring instead of NAT?
I have the same problem recently. It’s like another problem I had occurred before, which is network broken when VPN is on. And it turns out that the same solution for VPN also works for this Mobile WiFi Hotspot issue: https://github.com/sakai135/wsl-vpnkit