Leaderboard (728 x 90)

Thursday, May 6, 2010

How to allow container to use device on hardware node in Virtuozzo Container?

Make sure the device has been already loaded on the hardware node using lsmod. If doesn't load, using modprobe command to load it.

Example:
# lsmod | grep tun
If it is not there, use
# modprobe tun


run the command on hardware node
vzctl set 101 --devices c:10:200:rw --save

where

101 means container ID 101 will be granted permissions to use the device
c:10:200:rw means allow read/write permissions over character device with major number 10 and minor number 200

Then run the command
vzctl exec 101 mknod /dev/net/tun c 10 200

where /dev/net/tun
is device file for character device with major number 10 and minor number 200

Check for major number and minor number of the device for devices.txt in kernel documentation.

No comments:

Post a Comment