Skip to content

VPN LXC Setup ​

The VPN guest runs Tailscale as a native subnet router and exit node. Its network attachment differs from the other server guests.

Prepare the physical Proxmox host first. For host-specific accounts, scripted setup, and AI recovery procedures, see VPN LXC · Internal Operations.

For another homelab, choose unused guest IDs and addresses, your own gateway and DNS, and storage sized for your workload. Confirm actual inventory and DHCP assignments before creation; a failed ping alone does not prove an address is free.

Guest configuration ​

SettingThis homelab
Guest ID / hostname102 / vpn
Type / OSUnprivileged LXC / Ubuntu 24.04 LTS
CPU / RAM / swap2 cores / 1 GiB / 1 GiB
Root disk10 GiB on local flash storage
Bridge / VLANvmbr0 / tag 5
Address / gateway10.120.5.9/24 / 10.120.5.1
Bootstrap DNS1.1.1.1
Featureskeyctl=1,nesting=1
StartupStart at boot

Create the LXC ​

Download a supported Ubuntu 24.04 LXC template in Proxmox, then select Create CT. Choose unprivileged mode and the configuration above. Attach the interface to a bridge and switch trunk that actually carry VLAN 5. Keep the guest's root disk local; no NAS data mount is needed.

Configure the network through Proxmox. It generates /etc/systemd/network/eth0.network inside this guest; do not create a competing Netplan configuration for the same interface.

Expose the TUN device ​

On the Proxmox host, verify /dev/net/tun exists. With the guest stopped during initial setup, add these entries to /etc/pve/lxc/102.conf, or use the equivalent Proxmox device mapping supported by your release:

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

For a different guest ID, use its own config file. Preserve unrelated configuration and keep the container unprivileged. Start the guest and verify inside it:

sh
ls -l /dev/net/tun
ip -brief address
ip route

The TUN device should be a character device. A missing or inaccessible device prevents the native Tailscale tunnel from working. Do not switch to privileged mode as a generic fix.

Prepare Ubuntu ​

Create a normal sudo-capable administrator and install base tools:

sh
sudo apt update
sudo apt upgrade
sudo apt install ca-certificates curl openssh-server sudo
sudo systemctl enable --now ssh

This LXC shares the physical host's kernel; it does not need QEMU Guest Agent or Docker. Network and service package updates belong inside the guest; host kernel updates belong on Proxmox.

Configure administrative access ​

Create a normal sudo-capable administrator account during installation or from the initial console. Store its password securely. Install only your intended public SSH key while preserving existing keys, then prove a fresh key-authenticated session before disabling password and keyboard-interactive authentication. Inspect sshd -T, validate with sshd -t, and reload ssh.service while keeping the initial session and Proxmox console available.

For a new guest with a proven non-root administrative account, an early SSH drop-in can use:

text
PubkeyAuthentication yes
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin no

Verify a new key login succeeds and password-based login is rejected. The exact lab usernames and reviewed policy files are internal. Do not apply a root-login restriction before a non-root administrator and recovery path work.

Enable remote-access service ​

Follow Tailscale setup for installation, enrollment, persistent forwarding, advertised routes, exit-node approval, and remote-client validation. TUN access alone does not enable routing, and advertising a route does not grant access.

Keep direct LAN administration or the Proxmox console available while changing routing. Router VLAN policy, tailnet access policy, route approval, and guest firewall behavior must agree. A NIC's firewall flag alone does not establish active Proxmox filtering.

Backups and startup checks ​

Set Start at boot deliberately and preserve the physical host's coordinated startup behavior. Configure a protected off-host Proxmox backup with a schedule and retention appropriate to the guest, then test restoration without creating a duplicate active address or identity.

After initial setup or a controlled reboot, confirm network configuration, DNS, key-only access, service health, and the application's primary function. Keep the Proxmox guest console as an out-of-band recovery path. Inspect active backup and storage tasks before maintenance; avoid hard power removal.