WSL2 not using host's VPN connection
Version
Microsoft Windows [versão 10.0.22621.674]
WSL Version
- [X] WSL 2
- [ ] WSL 1
Kernel Version
5.10.16
Distro Version
Debian 11
Other Software
No response
Repro Steps
- Connect to the VPN in Windows
- Try to access it in Linux
Expected Behavior
- Connect to the VPN in Windows
- Succeed when using accessing it in Linux
Actual Behavior
- Connect to the VPN in Windows
- Fails when trying to use it in Linux
Diagnostic Logs
No response
There is a suggested workaround here: https://learn.microsoft.com/en-us/windows/wsl/troubleshooting#wsl-has-no-network-connectivity-once-connected-to-a-vpn
but that isn't a great solution, since it requires you to do it and revert every time you connect the VPN.
@janovesk wrote some blog posts about better solutions: https://janovesk.com/wsl/2022/01/21/wsl2-and-vpn-routing.html
Thanks @Codym48!. Since I was using WSL2 to run Docker anyway, I ended up using a Docker package called wsl-vpnkit and having it start automatically with the distro.
It might do something similar to the post but I was lazy and didn't look into it much after I got it working :)
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.
Thank you!