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

Marcin Mirosław marcin at mejor.pl
Thu Jul 30 11:06:01 UTC 2015


W dniu 30.07.2015 o 12:57, Daniel P. Berrange pisze:
> 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

Ha! You are absolutly right. I thought that launching virsh I can manage
all types of VM managed by virsh.
Thank you!
Marcin






More information about the libvirt-users mailing list