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

Syraxes syraxes at gmail.com
Thu Apr 16 08:04:42 UTC 2015


On Wed, Apr 15, 2015 at 5:28 PM, Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> Quoting Syraxes (syraxes at gmail.com):
>> Hello,
>>
>> I am trying to start a qemu virtual machine inside a LXC container
>>
>> 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.
>
> No, it's fine.
>
>> But is there another way to make the qemu work inside the
>> lxc container ?
>
> Yes.  I've done it many times.  The host freezing suggests you
> have a problem with the kvm binary - kvm runs fine outside of
> a container?  You're sure you have the same arch in the container
> as on the host?  If you strace kvm in the container, does it
> give you any clues?

The qemu-kvm works outside of the container.   The arch is the same.
By kvm binary you mean :  the qemu binary , right ?

I'll try to recreate the rootfs of the container using the packages
from a dvd instead of downloading,
to ensure that all the packages are the same version in the host and container.
I need to do this anyway because we need a solution that works offline.


Thanks,
Adrian M


More information about the lxc-users mailing list