openvpn--ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2) [SOLVED]

stgraber, [SOLVED]

Using your original suggestion and running the following on the host fixed the problem.
chmod 666 /dev/net/tun

Thanks for your assistance…

So for a recap for anyone else having this problem:
Add the following to your container config file in /var/lib/lxc/[container]/config

lxc.mount.entry = /dev/net/tun dev/net/tun none bind,create=file

Then start the container and check the host /dev/net/tun permissions:

$ ls -l /dev/net/tun
crw-rw-rw- 1 root root 10, 200 Apr 21 20:15 /dev/net/tun

NOTE: I didn’t need this step on a second container host I am running. The permissions were correct. However, if they are not 666 as above run (on the host):

chmod 666 /dev/net/tun

2 Likes