[libvirt] Unable to get libvirt working with KVM using direct kernel boot.

Hi, I am trying to get libvirt to manage a KVM virtual machine on Debian squeeze with multiple relevant parts included form unstable (because of need for gpt partition tables, Intel 82576 nic etc). Unfortunately the VM does not seem to boot. I will see a quemu prompt on /dev/pts/1. (Tried pressing c on it, but no difference). Nothing will appear on /dev/pts/2, /dev/pts/3 or when I type virsh console vm1_storage. If I grab the kvm command line generated by libvirt using ps and run it manually, it works fine. (Starts booting after I press c on /dev/pts/1 or remove the -S option from the command line) Libvirt configuration file: <domain type='kvm'> <name>vm1_storage</name> <uuid>29bfac01-b24d-e4ab-e741-f33f7e880d9d</uuid> <memory>4096000</memory> <currentMemory>4096000</currentMemory> <vcpu>6</vcpu> <os> <type>hvm</type> <kernel>/boot/vmlinuz-2.6.30-1-amd64</kernel> <initrd>/boot/initrd.img-2.6.30-1-amd64</initrd> <cmdline>"root=UUID=98d6d3d7-3782-4f6b-a94f-bc0272c0289d ro console=tty0 console=ttyS0,115200n8"</cmdline> </os> <features> <acpi/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='block' device='disk'> <source dev='/dev/vm_lvm/vm01_storage_root'/> <target dev='vda' bus='virtio'/> </disk> <interface type='ethernet'> <mac address='52:54:00:12:34:56'/> <target dev='tap0'/> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target port='0'/> </console> </devices> </domain> KVM command line that I see in ps after running virsh define /etc/libvirt/qemu/vm1_storage.xml virsh start vm1_storage (Works fine after I remove the -S option or press 'c' on quemu monitor on /dev/pts/1): /usr/bin/kvm -S -M pc -m 4000 -smp 6 -name vm1_storage -uuid 29bfac01-b24d-e4ab-e741-f33f7e880d9d -nographic -monitor pty -boot c -kernel /boot/vmlinuz-2.6.30-1-amd64 -initrd /boot/initrd.img-2.6.30-1-amd64 -append "root=UUID=98d6d3d7-3782-4f6b-a94f-bc0272c0289d ro console=tty0 console=ttyS0,115200n8" -drive file=/dev/vm_lvm/vm01_storage_root,if=virtio,index=0,boot=on -net nic,macaddr=52:54:00:12:34:56,vlan=0 -net tap,ifname=tap0,vlan=0 -serial pty -parallel none -usb /var/log/libvirt/qemu/vm1_storage.log shows: LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/ /usr/bin/kvm -S -M pc -m 4000 -smp 6 -name vm1_storage -uuid 29bfac01-b24d-e4ab-e741-f33f7e880d9d -nographic -monitor pty -boot c -kernel /boot/vmlinuz-2.6.30-1-amd64 -initrd /boot/initrd.img-2.6.30-1-amd64 -append "root=UUID=98d6d3d7-3782-4f6b-a94f-bc0272c0289d ro console=tty0 console=ttyS0,115200n8" -drive file=/dev/vm_lvm/vm01_storage_root,if=virtio,index=0,boot=on -net nic,macaddr=52:54:00:12:34:56,vlan=0 -net tap,ifname=tap0,vlan=0 -serial pty -parallel none -usb char device redirected to /dev/pts/1 char device redirected to /dev/pts/2 qemu: loading initrd (0x76055b bytes) at 0x000000007f89f000 Versions in use: kvm 85+dfsg-4 libvirt0 0.6.5-2 libvirt-bin 0.6.5-2 linux-image-2.6.30-1-amd64 Thanks for any ideas.

On Mon, Jul 27, 2009 at 03:07:38PM +0300, Tiit Kaeeli wrote:
Hi,
I am trying to get libvirt to manage a KVM virtual machine on Debian squeeze with multiple relevant parts included form unstable (because of need for gpt partition tables, Intel 82576 nic etc).
Unfortunately the VM does not seem to boot. I will see a quemu prompt on /dev/pts/1. (Tried pressing c on it, but no difference). Nothing will appear on /dev/pts/2, /dev/pts/3 or when I type virsh console vm1_storage.
If I grab the kvm command line generated by libvirt using ps and run it manually, it works fine. (Starts booting after I press c on /dev/pts/1 or remove the -S option from the command line)
libvirt does this automatically, it starts it with -S, does a few things to configure the VM, then runs 'cont' to let CPUs start.
Libvirt configuration file:
<domain type='kvm'> <name>vm1_storage</name> <uuid>29bfac01-b24d-e4ab-e741-f33f7e880d9d</uuid> <memory>4096000</memory> <currentMemory>4096000</currentMemory> <vcpu>6</vcpu>
Always worth setting vcpu=1 just to eliminate SMP as a cause of trouble.
<os> <type>hvm</type> <kernel>/boot/vmlinuz-2.6.30-1-amd64</kernel> <initrd>/boot/initrd.img-2.6.30-1-amd64</initrd> <cmdline>"root=UUID=98d6d3d7-3782-4f6b-a94f-bc0272c0289d ro console=tty0 console=ttyS0,115200n8"</cmdline> </os>
You don't have any <graphics> configured, so console=tty0 is not applicable there - only get a serial console on ttyS0 with this XML config.
<features> <acpi/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='block' device='disk'> <source dev='/dev/vm_lvm/vm01_storage_root'/> <target dev='vda' bus='virtio'/> </disk> <interface type='ethernet'> <mac address='52:54:00:12:34:56'/> <target dev='tap0'/> </interface>
Worth trying to remove the etherenet device too to see if that's a cause of trouble.
<serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target port='0'/> </console> </devices> </domain>
[snip]
Versions in use:
kvm 85+dfsg-4
kvm 85 is a development snapshot release from upstream KVM. IIRC kvm-85 was a particularly buggy one. You should try other KVM versions, either kvm-86/87, etc or better yet, one from the stable upstream releaxe series qemu-kvm-0.10.x Regards, 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 (2)
-
Daniel P. Berrange
-
Tiit Kaeeli