[libvirt-users] TUN/TAP device for lxc guest

I want to run a VPN software inside an lxc guest, but the required TUN/TAP device (/dev/net/tun) is missing in the container. Anyone knows how to enable this device ? Here is the definition XML: <domain type="lxc"> <name>centos</name> <memory unit="MiB">1024</memory> <os> <type>exe</type> <init>/sbin/init</init> </os> <devices> <console type="pty"/> <filesystem type="mount"> <source dir="/virsh/centos"/> <target dir="/"/> </filesystem> <interface type="bridge"> <source bridge="br0"/> <model type="virtio"/> </interface> </devices> </domain> Thanks Yao

On Fri, Mar 28, 2014 at 12:06:41PM +0800, 邓尧 wrote:
I want to run a VPN software inside an lxc guest, but the required TUN/TAP device (/dev/net/tun) is missing in the container. Anyone knows how to enable this device ? Here is the definition XML:
We only create a few device nodes by default: http://libvirt.org/drvlxc.html#devnodes You can ask for more using this syntax: http://libvirt.org/formatdomain.html#elementsHostDevCaps eg <hostdev mode='capabilities' type='misc'> <source> <char>/dev/net/tun</char> </source> </hostdev> Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
邓尧