Skip to content

Instantly share code, notes, and snippets.

@david-marconis
Last active April 24, 2025 08:14
Show Gist options
  • Select an option

  • Save david-marconis/12ece91266102b097bc37dc3fe231e0c to your computer and use it in GitHub Desktop.

Select an option

Save david-marconis/12ece91266102b097bc37dc3fe231e0c to your computer and use it in GitHub Desktop.
WSL vpn-kit quick guide with systemd

WSL vpnkit quick guide

This is a quick guide to set up wsl-vpnkit in WSL using systemd.

This will install wsl-vpnkit as a service in your existing wsl distro as a standalone script.

Make sure you have systemd enabled in WSL.

Find the latest version of wsl-vpnkit here: https://github.com/sakai135/wsl-vpnkit/releases/latest

# Enter latest version number here, eg. VERSION=v0.4.1
VERSION=v0.4.1
# Enter install location of wsl-vpnkit eg DIR=/opt/wsl-vpnkit
DIR=/opt/wsl-vpnkit
sudo mkdir $DIR
# Fetch wsl-vpnkit and install to $DIR
wget https://github.com/sakai135/wsl-vpnkit/releases/download/$VERSION/wsl-vpnkit.tar.gz -O - | sudo tar -xz -C $DIR --strip-components=1 app/wsl-vpnkit app/wsl-gvproxy.exe app/wsl-vm app/wsl-vpnkit.service
# Configure wsl-vpnkit.service to run as a standalone script
sed -e "s|/full/path/to|$DIR|g" -e 's/^#E/E/' -e 's|^\(ExecStart=/mnt.*\)|#\1|' $DIR/wsl-vpnkit.service | sudo tee -a /etc/systemd/system/wsl-vpnkit.service >/dev/null
# Enable and start wsl-vpnkit service
sudo systemctl enable wsl-vpnkit
sudo systemctl start wsl-vpnkit
@zimtkeks
Copy link

Thanks for sharing, very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment