If you try to install openvpn server to an LXC container, you will get following error:
ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
This is related with the design decision of unprivileged containers which can’t create device nodes.
In order to solve this problem, you should do bind-mount that device node from the host system.
Follow the steps:
- Learn container id from Proxmox Gui (for example 102)
- Connect your proxmox host system from ssh
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
- Save the file and run
pct stop 102and
pct start 102commands
Note: If you’re using Openvpn Access Server (for included gui) and you’re using stock Debian9 Proxmox templates, you also need to install net-tools package because start script requires
ifconfigbinary which is not coming with standard install anymore!