If you are trying to install OpenVPN onto a Proxmox LXC container and the install keeps failing, its due to the module not being activated on the Proxmox node.
To correct the problem, login to your ROOT Proxmox node, (Not the LXC container) and edit the default configuration file for all LXC containers. If you don’t want to enable this feature for all LXC containers (including future ones) you can edit just the config of that specific VM.
The default config file for all VM’s is located at: /etc/lxc/default.conf
VM specific config files are located at: /etc/pve/lxc/(vmid)/(vmid).conf
where is the ID number of your vm.
Add lxc.cgroup.devices.allow = c 10:200 rwm
to the end of the file. (It’s the same for both the global config and the config of just the vm)
Now log out of the Proxmox node and SSH into your LXC container. You will have to add a few lines to the linux boot file so that it executes the tun/tap device on every boot.
Go to the /etc/rc.local
file and add these lines of code before the @exit line.
if ! [ -c /dev/net/tun ]; then
mkdir -p /dev/net
mknod -m 666 /dev/net/tun c 10 200
fi
Now after a full reboot you should have a working tun/tap interface so you can install OpenVPN on your LXC Container.
This was tested on the latest version of Proxmox at the time of writing this post.
this helped me get pritunl up and running, thanks!
[…] https://vroomtech.io/enable-tuntap-in-a-proxmox-lxc-container/ […]
[…] Source : Enable Tun/Tap in a Proxmox LXC Container | VroomTech.io […]
[…] https://vroomtech.io/enable-tuntap-in-a-proxmox-lxc-container/ […]
Hello,
rc.local is not enabled be default since the use of linux’s sysctl.
Here is the workaround to make the rc.local appear after a reboot:
printf ‘%s\n’ ‘#!/bin/bash’ ‘exit 0’ | sudo tee -a /etc/rc.local
sudo chmod +x /etc/rc.local
sudo reboot
Source: https://askubuntu.com/questions/886620/how-can-i-execute-command-on-startup-rc-local-alternative-on-ubuntu-16-10
Cheers, otherwise great tutorial, thanks for the help Nick!
[…] https://vroomtech.io/enable-tuntap-in-a-proxmox-lxc-container/ […]