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

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 I can't also find similar problem using web search engine. Maybe someone here can give me advice? Marcin # virsh -V Virsh command line tool of libvirt 1.2.17 See web site at http://libvirt.org/ Compiled with support for: Hypervisors: QEMU/KVM LXC VMWare ESX Test Networking: Remote Bridging Interface udev Nwfilter Storage: Dir Filesystem SCSI LVM Miscellaneous: Daemon Nodedev Secrets Debug Readline Modular

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 :|

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
participants (2)
-
Daniel P. Berrange
-
Marcin Mirosław