[lxc-users] unable to start qemu-kvm inside lxc container (the host freezes)

Syraxes syraxes at gmail.com
Wed Apr 15 14:17:05 UTC 2015


Hello,

I am trying to start a qemu virtual machine inside a LXC container

(one might wonder why exactly would I want to do this.  The idea is
that I have a complex environment with 6 virtual machines + network
bridges + mysql + some proprietary software ,    and the goal is to
start multiple environments on a computer .  We need processes and
network isolation between the environments.    So starting one qemu is
only the first step ... )


The host is a CentOS 6.6 ,  and the container is also CentOS 6.6 .

Inside the container,  the qemu complained that there is no  /dev/kvm
and  /dev/net/tun  .
So I've created them with mknod   and also added into the container config :
lxc.cgroup.devices.allow = c 10:232 rwm          #   the /dev/kvm
lxc.cgroup.devices.allow = c 10:200 rwm          #   the /dev/net/tun


After these changes,  when I try to start the qemu vm   the host
computer freezes .

Any idea about what am I doing wrong ?
I guess that it's incorrect to give the container access to those
devices.  But is there another way to make the qemu work inside the
lxc container ?


thanks for any info,
Adrian M


More information about the lxc-users mailing list