WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL2 not using host's VPN connection

Open Rechdan opened this issue 4 years ago • 4 comments

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

  1. Connect to the VPN in Windows
  2. Try to access it in Linux

Expected Behavior

  1. Connect to the VPN in Windows
  2. Succeed when using accessing it in Linux

Actual Behavior

  1. Connect to the VPN in Windows
  2. Fails when trying to use it in Linux

Diagnostic Logs

No response

Rechdan avatar Oct 12 '22 15:10 Rechdan

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.

weflower avatar Nov 18 '22 20:11 weflower

@janovesk wrote some blog posts about better solutions: https://janovesk.com/wsl/2022/01/21/wsl2-and-vpn-routing.html

Codym48 avatar Jan 11 '23 04:01 Codym48

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 :)

weflower avatar Jan 11 '23 13:01 weflower

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!