-- Leo's gemini proxy

-- Connecting to gmi.runtimeterror.dev:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en-US

💻 [runtimeterror $]

2020-10-07

Fixing WSL2 connectivity when connected to a VPN with wsl-vpnkit



I was pretty excited to get WSL2 and Docker working on my Windows 10 1909 [1] laptop a few weeks ago, but I quickly encountered a problem: WSL2 had no network connectivity when connected to my work VPN.

[1] WSL2 and Docker working on my Windows 10 1909

Well, that's not *entirely* true; Docker worked just fine, but nothing else could talk to anything outside of the WSL environment. I found a few open issues for this problem in the WSL2 Github [2] with suggested workarounds including modifying Windows registry entries, adjusting the metrics assigned to various virtual network interfaces within Windows, and manually setting DNS servers in `/etc/resolv.conf`. None of these worked for me.

[2] WSL2 Github

I eventually came across a solution here [3] which did the trick. This takes advantage of the fact that Docker for Windows is already utilizing `vpnkit` for connectivity - so you may also want to be sure Docker Desktop is configured to start at login.

[3] here

The instructions worked well for me so I won't rehash them all here. When it came time to modify my `/etc/resolv.conf` file, I added in two of the internal DNS servers followed by the IP for my home router's DNS service. This allows me to use WSL2 both on and off the corporate network without having to reconfigure things.

All I need to do now is execute `sudo ./wsl-vpnkit` and leave that running in the background when I need to use WSL while connected to the corporate VPN.


Image: Successful connection via wsl-vpnkit

Whew! Okay, back to work.




---


📧 Reply by email



Related articles


Quick Salt State to Deploy Netdata

Tailscale Feature Highlight: SSH, Serve, and Funnel

I Ditched vSphere for Proxmox VE

---


Home

This page on the big web

-- Response ended

-- Page fetched on Fri May 10 08:24:45 2024