Install Tailscale on WSL2

Add RSS feed to Reader and sync to Readwise.

Tailscale is your own personal VPN that opens up a lot of possibilities. A private VPN gives you access to all your devices even when you’re not connected to the same local network. Tailscale gives your device a “static” IP that you can use to connect to it from anywhere. This lets you set up applications like Nextcloud or Pi-hole on a PC on your local network and access it externally safely and without any complicated router configs, opening ports, DNS setup, etc. Along with a static IP, you can also optionally set up a hostname for your device that gives you access to your device using a hostname instead of an IP, i.e, you can access your computer with http://my-home-pc instead of http://100.x.x.x.

This post assumes that you’ve installed WSL2 with Ubuntu. For other distros, the Tailscale set up instructions are similar and download repo and instructions can be found on the Tailscale website.

Install Tailscale on WSL2

  • If you haven’t already, install WSL2 (Ubuntu) on Windows
  • Sign-up for Tailscale
  • Install Tailscale on WSL2 Ubuntu using the instructions from the Download Tailscale page.
  • After installation run sudo tailscaled
  • Run sudo tailscale up
  • Open the authentication link in your browser and confirm login
  • You can get your Tailscale IP using tailscale ip -4
  • Tailscale is now running

Tailscale cannot run as a service when installed in WSL2, so you will need to run sudo tailscaled and sudo tailscale up when you restart WSL2 or your PC.

Troubleshooting

  • After installing Tailscale, WSL2 may have issues resolving DNS. So you may encounter issues where if you try to ssh user@example.com in WSL2, you will be unable to connect when previously you could. This is because Tailscale changes the resolv.conf in your WSL2. You can fix this using the instructions in this gist: Fix WSL2 DNS Resolution.

This post is part of series about using Tailscale & WSL2 for Nextcloud and Pi-hole. See the other posts:

Comments

2 responses to “Install Tailscale on WSL2”

  1. Martin Fitzpatrick avatar
    Martin Fitzpatrick

    This is brilliant, just what I was looking for. Just one comment – if you run “sudo tailscaled”, it will sit in the foreground and hold up your console window. Instead you could run “sudo nohup tailscaled &”, which will cause it to run in the background and free up your console window.

    1. Veesar avatar

      Thank you. And thanks for the tip!

Leave a Reply

Your email address will not be published. Required fields are marked *