[libvirt] domain type "kvm" error

Hi all, I use "ubuntu hardy" but I dont think the problem is specific to the distribution I use. I installed KVM and libvirt as described here: https://help.ubuntu.com/community/KVM Following that method, created a domain, which dumps like this: <domain type='qemu' id='1'> <name>xp1</name> ... </domain> Launching the guest is OK, but it is as slow as if I directly launched $ qemu [options] I tried to launch: $ kvm [options] and it is much faster My conclusion is that method on the Ubuntu documentation launches a qemu without the use of kvm. I modified that XML dump, changing "qemu" with "kvm": <domain type='kvm' id='1'> <name>xp1</name> ... </domain> I undefined the domain "xp1" and re-defined it with that new XML file. When I start the new defined domain: virsh # start xp1 libvir: QEMU error : QEMU quit during console startup qemu: unknowm parameter 'boot' in \ 'file=/home/mihamina/xpjohnny.iso,if=ide,media=cdrom,boot=on' error: Failed to start domain xp1 It's a Windows XP domain. My conclusion is: - When domain type is "qemu", qemu is called a certain way, without syntax error - When domain type is "kvm", qemu/kvm is not called the same way and among that, there are syntax errors. How to confirm my conclusion? What to check if it's the case? I already filed a bug https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/252916 but they seem not to have idea of the problem. -- Huile Essentielle de Camphre http://www.huile-camphre.fr Infogerance http://www.infogerance.us (Serveurs, Postes de travail, Développement logiciel)

Rakotomandimby Mihamina wrote:
Hi all, I use "ubuntu hardy" but I dont think the problem is specific to the distribution I use.
I installed KVM and libvirt as described here: https://help.ubuntu.com/community/KVM
Following that method, created a domain, which dumps like this: <domain type='qemu' id='1'> <name>xp1</name> ... </domain>
Specifically what tool did you use to install the VM? That tutorial lists several different methods.
Launching the guest is OK, but it is as slow as if I directly launched $ qemu [options] I tried to launch: $ kvm [options] and it is much faster My conclusion is that method on the Ubuntu documentation launches a qemu without the use of kvm.
I modified that XML dump, changing "qemu" with "kvm": <domain type='kvm' id='1'> <name>xp1</name> ... </domain>
You can't just change the domain type, you also have to change the emulator tag. My guess is, this new 'kvm' command is still using the plain qemu emulator and not '/usr/bin/kvm'
I undefined the domain "xp1" and re-defined it with that new XML file. When I start the new defined domain: virsh # start xp1 libvir: QEMU error : QEMU quit during console startup qemu: unknowm parameter 'boot' in \ 'file=/home/mihamina/xpjohnny.iso,if=ide,media=cdrom,boot=on' error: Failed to start domain xp1
It's a Windows XP domain.
My conclusion is: - When domain type is "qemu", qemu is called a certain way, without syntax error - When domain type is "kvm", qemu/kvm is not called the same way and among that, there are syntax errors.
How to confirm my conclusion?
If you want to see the command lines that libvirt is generating, check out /var/log/libvirt/qemu/{vmname}.log (at least that is the path in fedora). This file is overwritten everytime you attempt to start the VM, so you'll want to check it after each successive run. Hope that helps, Cole

Cole Robinson wrote:
I use "ubuntu hardy" but I dont think the problem is specific to the distribution I use.
I installed KVM and libvirt as described here: https://help.ubuntu.com/community/KVM
Following that method, created a domain, which dumps like this: <domain type='qemu' id='1'> <name>xp1</name> ... </domain>
Specifically what tool did you use to install the VM? That tutorial lists several different methods.
$ sudo virt-install --connect qemu:///system -n xp1 \ -r 512 -f xp1.qcow2 -s 12 -c xp.iso --vnc \ --noautoconsole --os-type windows --os-variant winxp
Launching the guest is OK, but it is as slow as if I directly launched $ qemu [options] I tried to launch: $ kvm [options] and it is much faster My conclusion is that method on the Ubuntu documentation launches a qemu without the use of kvm. I modified that XML dump, changing "qemu" with "kvm": <domain type='kvm' id='1'> <name>xp1</name> ... </domain> You can't just change the domain type, you also have to change the emulator tag. My guess is, this new 'kvm' command is still using the plain qemu emulator and not '/usr/bin/kvm'
Great! I changed it and it runs! I really did not see it.
Hope that helps,
It did! -- Huile Essentielle de Camphre http://www.huile-camphre.fr Infogerance http://www.infogerance.us (Serveurs, Postes de travail, Développement logiciel)

Rakotomandimby Mihamina wrote:
Cole Robinson wrote:
I use "ubuntu hardy" but I dont think the problem is specific to the distribution I use.
I installed KVM and libvirt as described here: https://help.ubuntu.com/community/KVM
Following that method, created a domain, which dumps like this: <domain type='qemu' id='1'> <name>xp1</name> ... </domain>
Specifically what tool did you use to install the VM? That tutorial lists several different methods.
$ sudo virt-install --connect qemu:///system -n xp1 \ -r 512 -f xp1.qcow2 -s 12 -c xp.iso --vnc \ --noautoconsole --os-type windows --os-variant winxp
FYI, the reason you didn't end up with a kvm guest with this command is because you didn't pass the --accelerate flag. It's unfortunate that back compatibility prevents us from just defaulting to kvm, but that's the way it goes :( - Cole

Cole Robinson wrote:
You can't just change the domain type, you also have to change the emulator tag. My guess is, this new 'kvm' command is still using the plain qemu emulator and not '/usr/bin/kvm'
Given that, how will I choose if I want to launch a 32bit or a 64bit VM guest? -- Huile Essentielle de Camphre http://www.huile-camphre.fr Infogerance http://www.infogerance.us (Serveurs, Postes de travail, Développement logiciel)

Rakotomandimby Mihamina wrote:
Cole Robinson wrote:
You can't just change the domain type, you also have to change the emulator tag. My guess is, this new 'kvm' command is still using the plain qemu emulator and not '/usr/bin/kvm'
Given that, how will I choose if I want to launch a 32bit or a 64bit VM guest?
If you are on a 64 bit machine, you don't need a different emulator. KVM emulates the host arch, so you can just install a 32 bit os in the VM, it would be like installing a 32 bit os on a physical 64 bit machine. - Cole

On Sun, Sep 07, 2008 at 11:56:21PM +0300, Rakotomandimby Mihamina wrote:
Cole Robinson wrote:
You can't just change the domain type, you also have to change the emulator tag. My guess is, this new 'kvm' command is still using the plain qemu emulator and not '/usr/bin/kvm'
Given that, how will I choose if I want to launch a 32bit or a 64bit VM guest?
When on a x86_64 host, KVM doesn't emulate a pure 32-bit VM. It just provides a regular x86_64 virtual machine, which happenss to be able to run i686 operating systems, by virtue of the x86_64/i686 instruction set compatability. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Sun, Sep 07, 2008 at 09:10:54PM +0300, Rakotomandimby Mihamina wrote:
Hi all, I use "ubuntu hardy" but I dont think the problem is specific to the distribution I use.
I installed KVM and libvirt as described here: https://help.ubuntu.com/community/KVM
Following that method, created a domain, which dumps like this: <domain type='qemu' id='1'> <name>xp1</name> ... </domain>
Launching the guest is OK, but it is as slow as if I directly launched
This is becuse of the type='qemu' attribute
$ qemu [options] I tried to launch: $ kvm [options] and it is much faster My conclusion is that method on the Ubuntu documentation launches a qemu without the use of kvm.
That is correct.
I modified that XML dump, changing "qemu" with "kvm": <domain type='kvm' id='1'> <name>xp1</name> ... </domain>
You also need to set the 'emulator' path to point to the KVM binary if its not already specified.
I undefined the domain "xp1" and re-defined it with that new XML file. When I start the new defined domain: virsh # start xp1 libvir: QEMU error : QEMU quit during console startup qemu: unknowm parameter 'boot' in \ 'file=/home/mihamina/xpjohnny.iso,if=ide,media=cdrom,boot=on' error: Failed to start domain xp1
IIRC the Ubuntu libvirt is hardcoded to use -drive param for disks if the type is 'kvm'. Latest libvirt will probe to see if this is supported or not before using it.
It's a Windows XP domain.
My conclusion is: - When domain type is "qemu", qemu is called a certain way, without syntax error - When domain type is "kvm", qemu/kvm is not called the same way and among that, there are syntax errors.
Yes & no. Latest libvirt probes for whether -drive is supported, and whether the boot= param is supported. The older version in Ubuntu doesn't do this probe, and just toggles off type=qemu vs type=kvm Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Cole Robinson
-
Daniel P. Berrange
-
Rakotomandimby Mihamina