[libvirt-users] libvirt-1.2.17 I can't define lxc container

Daniel P. Berrange berrange at redhat.com
Thu Jul 30 10:57:56 UTC 2015


On Thu, Jul 30, 2015 at 12:49:39PM +0200, Marcin Mirosław wrote:
> Hello!
> 
> I'd like to set up my first lxc container using libvirt. I'd like to
> start using the simplest configuration and next add things I need. So
> I've got xml as below:
>  <domain type='lxc'>
>    <name>vm1</name>
>    <memory>32768</memory>
>    <os>
>  <type>exe</type>
>  <init>/init</init>
>    </os>
>    <vcpu>1</vcpu>
>    <clock offset='utc'/>
>    <on_poweroff>destroy</on_poweroff>
>    <on_reboot>restart</on_reboot>
>    <on_crash>destroy</on_crash>
>  <features>
>    <capabilities policy='on'>
>    </capabilities>
>  </features>
>    <devices>
>  <emulator>/usr/libexec/libvirt_lxc</emulator>
>  <filesystem type='mount'>
>    <source dir='/opt/vm-1-root'/>
>    <target dir='/'/>
>  </filesystem>
>  <interface type='network'>
>    <source network='default'/>
>  </interface>
>  <console type='pty' />
>    </devices>
>  </domain>
> 
> When I try to define container I'm getting:
> virsh # define /tmp/vm1.xml
> error: Failed to define domain from /tmp/vm1.xml
> error: invalid argument: could not find capabilities for ostype=exe
> domaintype=lxc

Are you sure virsh has connected to the LXC driver - most likely
you have connected to QEMU. Try virsh -c lxc:/// or set the
LIBVIRT_DEFAULT_URI=lxc:/// environment variable


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