Proxmox - VPN - Allow OpenVPN to create a tun device

Due to built-in security of LXC, trying to setup a tunnel interface inside a container is blocked by default.

ERROR: Cannot open TUN/TAP dev /dev/net/tun

Allow this for a specific container

Add these lines to /etc/pve/lxc/<container-id>.conf:

lxc.cgroup.devices.allow = c 10:200 rwm
lxc.hook.autodev = sh -c "modprobe tun; cd ${LXC_ROOTFS_MOUNT}/dev; mkdir net; mknod net/tun c 10 200; chmod 0666 net/tun"