A blog about tech & coding

Restore WSL2 network connectivity when using a VPN

By Marco on Tue May 17 20221 min readhow to

WSL2 is often used by developers on Windows. However, if you are using WSL for the company you are working for, it might be that the VPN solution may affect network connectivity in WSL, resulting in no internet connectivity.

Luckily, there is a solution that solves this issue: wsl-vpnkit. It is a pre-built Linux distribution that doesn't require changing any settings on the host or admin privileges.

Here's how you use it:

  1. Download wsl-vpnkit.tar.gz from GitHub.
  2. Open a PowerShell prompt and run the following commands:
    wsl --import wsl-vpnkit $env:USERPROFILE\wsl-vpnkit wsl-vpnkit.tar.gz --version 2
    wsl -d wsl-vpnkit
  3. Now run the following command anytime you lose network connectivity when connecting to VPN:
    wsl.exe -d wsl-vpnkit service wsl-vpnkit start

    Alternatively, you can also add this command to your .profile, .bashrc or /.zshrc so that is executed automatically when WSL starts.

Some Fritz!Box modems might have been hijacked

TL;DR: Fritz!Box devices using custom DNS resolution services like Pihole or Adguard might have been compromised by DNS hijacking and using those Fritz!Box devices might be unsafe, especially for Windows users. Update: I updated the article to downscale the severity of the situation. After posting the article on HN, I came to the conclusion based on comments from other HN commenters that the Fritz!Box will not externally resolve *.fritz.box domain names. This it not the case if you use your own

Sun Apr 21 2024

Install Docker in WSL2 with Ubuntu 22.04 LTS

Installing Docker in WSL2 with Ubuntu 22.04 will not go without issues if you don't change the iptables configuration.

Sun May 15 2022