Adding Tailscale to a container with snapshots fails to properly mount tunnel device #2197

Closed
opened 2025-11-20 05:25:01 -05:00 by saavagebueno · 2 comments
Owner

Originally created by @nikolateslax on GitHub (Oct 28, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

tools/addon/add-tailscale-lxc

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/add-tailscale-lxc.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

📈 Which Proxmox version are you on?

pve-manager/8.3.3/f157a38b211595d6 (running kernel: 6.8.12-7-pve)

📝 Provide a clear and concise description of the issue.

When using the tools/addon/add-tailscale-lxc to add Tailscale to a container with a snapshot, tailscaled will fail to start in the guest because the line that gets appended to $CTID_CONFIG_PATH is appended after the snapshot definition.

🔄 Steps to reproduce the issue.

  1. Create an LXC, I used the regular Proxmox GUI creation dialog with the debian-12-standard_12.7-1_amd64.tar.zst template
  2. Take a snapshot of the container
  3. Run bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/add-tailscale-lxc.sh)" on the Proxmox node
  4. Reboot the container
  5. Run tailscale up in the container

Paste the full error output (if available).

  • Running tailscale up returns an error that the tailscale daemon could not be reached and suggests starting it with systemctl.
  • systemctl status tailscaled shows a status of failed, with the relevant log line:
is CONFIG_TUN enabled in your kernel? `modprobe tun` failed with: modprobe: FATAL: Module tun not found in directory /lib/modules/6.8.12-7-pve`

🖼️ Additional context (optional).

I quickly searched to confirm my suspicions, as I'd dealt with a similar issue before manually adding Tailscale to a container. When I looked at the config file in /etc/pve/lxc/$CTID.conf, I noticed that there are two discrete sections: the main, current configuration, and the configuration at the time of the snapshot in a [square-bracketed] section, like .ini files. The line mounting /dev/net/tun had been appended to the snapshot configuration, instead of the current configuration. I am willing to provide config files and logs, if you should need them beyond what's present here.

To me, the high-level solution is obvious: append the mount line before any opening square brackets. The implementation is beyond me, or I'd submit a PR with the issue. It might be a minor, niche issue that will go unaddressed, but thought it should still be documented. I've already repaired the config on my own node by simply moving the line where it needed to go. Anyone else tinkering with a PVE node will probably also do exactly what I did, but it is still a bug in the script, by technicality. Thank you for your time and contributions.

Originally created by @nikolateslax on GitHub (Oct 28, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? tools/addon/add-tailscale-lxc ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/add-tailscale-lxc.sh)" ### ⚙️ What settings are you using? - [ ] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 📈 Which Proxmox version are you on? pve-manager/8.3.3/f157a38b211595d6 (running kernel: 6.8.12-7-pve) ### 📝 Provide a clear and concise description of the issue. When using the tools/addon/add-tailscale-lxc to add Tailscale to a container with a snapshot, tailscaled will fail to start in the guest because the line that gets appended to $CTID_CONFIG_PATH is appended after the snapshot definition. ### 🔄 Steps to reproduce the issue. 1. Create an LXC, I used the regular Proxmox GUI creation dialog with the `debian-12-standard_12.7-1_amd64.tar.zst` template 2. Take a snapshot of the container 3. Run `bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/add-tailscale-lxc.sh)"` on the Proxmox node 4. Reboot the container 5. Run `tailscale up` in the container ### ❌ Paste the full error output (if available). - Running `tailscale up` returns an error that the tailscale daemon could not be reached and suggests starting it with systemctl. - `systemctl status tailscaled` shows a status of failed, with the relevant log line: ``` is CONFIG_TUN enabled in your kernel? `modprobe tun` failed with: modprobe: FATAL: Module tun not found in directory /lib/modules/6.8.12-7-pve` ``` ### 🖼️ Additional context (optional). I quickly searched to confirm my suspicions, as I'd dealt with a similar issue before manually adding Tailscale to a container. When I looked at the config file in `/etc/pve/lxc/$CTID.conf`, I noticed that there are two discrete sections: the main, current configuration, and the configuration at the time of the snapshot in a [square-bracketed] section, like .ini files. The line mounting `/dev/net/tun` had been appended to the snapshot configuration, instead of the current configuration. I am willing to provide config files and logs, if you should need them beyond what's present here. To me, the high-level solution is obvious: append the mount line before any opening square brackets. The implementation is beyond me, or I'd submit a PR with the issue. It might be a minor, niche issue that will go unaddressed, but thought it should still be documented. I've already repaired the config on my own node by simply moving the line where it needed to go. Anyone else tinkering with a PVE node will probably also do exactly what I did, but it is still a bug in the script, by technicality. Thank you for your time and contributions.
saavagebueno added the not a script issue label 2025-11-20 05:25:01 -05:00
Author
Owner

@MickLesk commented on GitHub (Oct 28, 2025):

You need an Container with tun,

So add this before bash of LXC var_tun=yes

The Script do the same. But snapshots maybe doesnt have it.

@MickLesk commented on GitHub (Oct 28, 2025): You need an Container with tun, So add this before bash of LXC var_tun=yes The Script do the same. But snapshots maybe doesnt have it.
Author
Owner

@tremor021 commented on GitHub (Oct 28, 2025):

Image
@tremor021 commented on GitHub (Oct 28, 2025): <img width="444" height="195" alt="Image" src="https://github.com/user-attachments/assets/7e1933d1-6ec3-48b0-a12a-4d9086ee3bb6" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#2197