[PVE-User] Unable to get openvpn to run in a VE (Container)

Robert Sanderson rwsiv1 at gmail.com
Wed Jul 16 17:39:10 CEST 2008


I have been trying to get openvpn running on a CentOS 4.6 VE 
(Container).  Using information from the OpenVZ Wiki 
(http://wiki.openvz.org/VPN_via_the_TUN/TAP_device) I checked to make 
sure that the tun module was loaded on the HN with the command:

# lsmod | grep tun
tun                    18304  3 vzrst,vzcpt


As you can see, tun is loaded.  Next, I granted container (this VE has 
the ID of 107) an access to TUN/TAP:

vzctl set 107 --devices c:10:200:rw --save
vzctl set 107 --capability net_admin:on --save


I created the character device file inside the container:

vzctl exec 107 mkdir -p /dev/net
vzctl exec 107 mknod /dev/net/tun c 10 200
vzctl exec 107 chmod 600 /dev/net/tun


All of this executed without error.  The /etc/vz/conf/107.conf file now 
has the following lines:

DEVICES="c:10:200:rw "
CAPABILITY="NET_ADMIN:on "


When I try to start openvpn in the VE, the process fails with the 
following log entries:

Jul 16 13:03:25 a-ppsd openvpn[2528]: OPTIONS IMPORT: route options modified
Jul 16 13:03:25 a-ppsd openvpn[2528]: TUN/TAP device tun0 opened
Jul 16 13:03:25 a-ppsd openvpn[2528]: Note: Cannot set tx queue length on tun0: No such device (errno=19)
Jul 16 13:03:25 a-ppsd openvpn[2528]: /sbin/ip link set dev tun0 up mtu 1500
Jul 16 13:03:25 a-ppsd openvpn[2528]: Linux ip link set failed: shell command exited with error status: 255
Jul 16 13:03:25 a-ppsd openvpn[2528]: Exiting



In my research I was able to find plenty of cases where this has worked 
for other OpenVZ users.  Is there something specific to PVE that I need 
to do to get this running?  Any recommendations?

-Bob




More information about the pve-user mailing list