Lucas Janin | Headscale & Tailscale - Proxmox LXC Installation - Lucas Janin

Headscale & Tailscale – Proxmox LXC Installation

3 January 2025
  • headscale-tailscal-lxc-featured

Here’s how to install Tailscale on a Proxmox LXC with a Headscale server. This post is available in French too.

For an easy installation, I used one of the tools of the beautiful Proxmox VE Helper-Scripts suite. This script must be executed directly in the terminal of the Proxmox interface. Be careful, do not execute in the terminal of the LXC.

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/misc/add-tailscale-lxc.sh)"

Select the LXC container(s) for which you want to install Tailscale

If you encounter this mistake:

tailscale Failed to connect to local Tailscale daemon for /localapi/v0/profiles/; systemd tailscaled.service not running. Error: dial unix /var/run/tailscale/tailscaled.sock: connect: no such file or director

This means that there has been a snapshot of the LCX and that the LXC config must be edited by hand in the Proxmox terminal (or via ssh):

nano /etc/pve/lxc/LXCNUMBER.conf

Move these lines into the first part, before the snapshot.

lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file

Then, in a terminal of the LXC, execute this command:

tailscale up --login-server https://hs.xxxx.xxx --accept-dns=false

Retrieve the value of mkey, then open a terminal on the Headscale machine and execute this command:

docker exec headscale headscale nodes register --user USERNAME ---key mkey:xxxxxxxxxxxxxxxxxxxxxxxx 

To do this via the HeadPlane interface, on the “Machinery” page, click “Add Device”, add the character string mkey:xxx, choose the user and click “Register”.

You can found more information on this topic on Tailscale documentation.

I invite you to read or return to the Headscale and Tailscale post.

Leave a Reply

Your feedback is valuable for us. Your email will not be published.