openVPN in the LXC

Editor

Well-Known Member
Apr 26, 2017
108
1
58
Turkey
Hello,

I installed openVPN on the CentOS 7 in LXC but I can't start this service.

I getting this error:

Error:
process started and then immediately exited: ['Sat Mar 3 12:52:57 2018 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)']
service failed to start or returned error status
process started and then immediately exited: ['Sat Mar 3 12:52:58 2018 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)']
service failed to start or returned error status

What can I do for it?
 
I was getting
ERROR: Cannot open TUN/TAP dev /dev/net/tun
Until I added these lines to /etc/pve/lxc/<container-id>.conf

Code:
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"
 
  • Like
Reactions: davide_xeons