[libvirt-users] LXC container driver

Daniel P. Berrange berrange at redhat.com
Wed Feb 12 14:24:13 UTC 2014


On Wed, Feb 12, 2014 at 03:21:18PM +0100, arnaud gaboury wrote:
> I am totally lost in this UID/GID mapping. Maybe all this stuff is
> just beyond my competence.
> 
> For now, I am writing a basic mydomain.xml file following these 3 wiki:
> LXC container from libvirt.org[1]
> Linux containers guide from Rad Hat 7[2]
> getting start with lxc from P.Berrange [3]
> 
> This is the basic .xml file:
> 
> <domain type='lxc'>
>     <name>dahlia</name>
>     <memory>409600</memory>
>     <os>
>         <type arch='x86_64'>exec</type>

NB, you want 'exe' not 'exec'

>         <init>/bin/init</init>                         * systemd is
> default and PID1 is init on my Arch box
>         <vcpu>4</vcpu>
>     </os>
>     <devices>
>         <emulator>/usr/lib/libvirt/libvirt_lxc</emulator>  * it is the
> path on Arch
>         <console type='pty'/>
>     </devices>
> </domain>
> 
> Unfortunately :
> 
> gabx at hortensia ➤➤ /drawer/vm # virsh define dahlia.xml
> error: Failed to define domain from dahlia.xml
> error: internal error: unexpected domain type lxc, expecting one of
> these: qemu, kqemu, kvm, xen
> 
> What is wrong ?

You didn't specify any URI for the hypervisor so libvirt will have
guessed on. From the error it sounds like it guessed QEMU instead
of LXC. Either use  virsh -c lxc:///, or set LIBVIRT_DEFAULT_URI=lxc:///
or edit your libvirt.conf to set a default

  http://libvirt.org/uri.html#URI_libvirt
 
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 :|




More information about the libvirt-users mailing list