[libvirt] Windows VM doesn't start as Linux one does

Hi, everything is in the subject. I'm running Debian SID with libvirt-bin 0.7.2-3 and virt-manager 0.8.0-2. I had 4 VMs created manually some times ago (Lenny, Ubuntu 9.04, W2k and XPHome) which I migrate to libvirt. Both Linux are booting well, both Windows not: they start but suddenly reboot. On W2K I see the white starting bannier increasing on the bottom off the screen, and when done, reboot. On XPh at the time where the booting Windows screen should appear, VM restart. The I get the famous "Windows hasn't shutdown clearly, do you want to start in safe mode ... aso) On both systems, after first fail reboot, I can try and try again, always the same. If I stared VMs manually, no problem! My start script -which started without any problem my XPHome VM- is: #!/bin/bash AUDIO="es1370" VGA="std" sudo /usr/bin/kvm -localtime -cdrom /dev/scd0 -boot c -hda /media/XP/vdisk.img -hdb /media/XP/vdisk1.img -m 512 -soundhw $AUDIO -vga $VGA\ -net nic,vlan=0 -net vde,vlan=0,sock=/var/run/vde.ctl -usb -smb public -monitor tcp:127.0.0.1:32011,server,nowait & The XML file for the same VM which fail on boot is: <domain type='kvm'> <name>XPHome</name> <uuid>26e5de74-0841-c4b3-4cc1-e0df0f93cb31</uuid> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> <boot dev='hd'/> </os> <features> <pae/> </features> <clock offset='localtime'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <source file='/media/XP/vdisk.img'/> <target dev='hda' bus='ide'/> </disk> <disk type='file' device='disk'> <source file='/media/XP/vdisk1.img'/> <target dev='hdb' bus='ide'/> </disk> <disk type='block' device='cdrom'> <source dev='/dev/cdrom'/> <target dev='hdc' bus='ide'/> <readonly/> </disk> <interface type='bridge'> <mac address='54:52:00:7a:ee:01'/> <source bridge='virbr2'/> </interface> <serial type='pty'> <source path='/dev/pts/6'/> <target port='0'/> </serial> <console type='pty' tty='/dev/pts/6'> <source path='/dev/pts/6'/> <target port='0'/> </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/> <sound model='es1370'/> <video> <model type='cirrus' vram='9216' heads='1'/> </video> </devices> </domain> ~>qemu-img info /media/XP/vdisk.img image: /media/XP/vdisk.img file format: raw virtual size: 6.0G (6442450944 bytes) disk size: 5.8G ~>qemu-img info /media/XP/vdisk1.img image: /media/XP/vdisk1.img file format: raw virtual size: 2.0G (2147483648 bytes) disk size: 268M The disk image from all Linux VMs are also raw. On another server I installed from scratch on LVM partition an XPPro Windows VM without any problem. Thanks for any hint. Regards -- Daniel

On Wed, Nov 11, 2009 at 06:56:37PM +0100, Daniel Huhardeaux wrote:
My start script -which started without any problem my XPHome VM- is:
#!/bin/bash
AUDIO="es1370" VGA="std"
sudo /usr/bin/kvm -localtime -cdrom /dev/scd0 -boot c -hda /media/XP/vdisk.img -hdb /media/XP/vdisk1.img -m 512 -soundhw $AUDIO -vga $VGA\ -net nic,vlan=0 -net vde,vlan=0,sock=/var/run/vde.ctl -usb -smb public -monitor tcp:127.0.0.1:32011,server,nowait &
The XML file for the same VM which fail on boot is:
<domain type='kvm'> <name>XPHome</name> <uuid>26e5de74-0841-c4b3-4cc1-e0df0f93cb31</uuid> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> <boot dev='hd'/> </os> <features> <pae/> </features> <clock offset='localtime'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <source file='/media/XP/vdisk.img'/> <target dev='hda' bus='ide'/> </disk> <disk type='file' device='disk'> <source file='/media/XP/vdisk1.img'/> <target dev='hdb' bus='ide'/> </disk> <disk type='block' device='cdrom'> <source dev='/dev/cdrom'/> <target dev='hdc' bus='ide'/> <readonly/> </disk> <interface type='bridge'> <mac address='54:52:00:7a:ee:01'/> <source bridge='virbr2'/> </interface> <serial type='pty'> <source path='/dev/pts/6'/> <target port='0'/> </serial> <console type='pty' tty='/dev/pts/6'> <source path='/dev/pts/6'/> <target port='0'/> </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/> <sound model='es1370'/> <video> <model type='cirrus' vram='9216' heads='1'/> </video> </devices> </domain>
Can you get the libvirt QEMU args from the log file /var/log/libvirt/qemu/XPHome.log so we can compare them to the args your custom script used. There will probably be some minor difference that's confusing windows 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 :|

Daniel P. Berrange a écrit : Hi Daniel,
On Wed, Nov 11, 2009 at 06:56:37PM +0100, Daniel Huhardeaux wrote:
My start script -which started without any problem my XPHome VM- is:
#!/bin/bash
AUDIO="es1370" VGA="std"
sudo /usr/bin/kvm -localtime -cdrom /dev/scd0 -boot c -hda /media/XP/vdisk.img -hdb /media/XP/vdisk1.img -m 512 -soundhw $AUDIO -vga $VGA\ -net nic,vlan=0 -net vde,vlan=0,sock=/var/run/vde.ctl -usb -smb public -monitor tcp:127.0.0.1:32011,server,nowait &
The XML file for the same VM which fail on boot is:
<domain type='kvm'> <name>XPHome</name> <uuid>26e5de74-0841-c4b3-4cc1-e0df0f93cb31</uuid> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> <boot dev='hd'/> </os> <features> <pae/> </features> <clock offset='localtime'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <source file='/media/XP/vdisk.img'/> <target dev='hda' bus='ide'/> </disk> <disk type='file' device='disk'> <source file='/media/XP/vdisk1.img'/> <target dev='hdb' bus='ide'/> </disk> <disk type='block' device='cdrom'> <source dev='/dev/cdrom'/> <target dev='hdc' bus='ide'/> <readonly/> </disk> <interface type='bridge'> <mac address='54:52:00:7a:ee:01'/> <source bridge='virbr2'/> </interface> <serial type='pty'> <source path='/dev/pts/6'/> <target port='0'/> </serial> <console type='pty' tty='/dev/pts/6'> <source path='/dev/pts/6'/> <target port='0'/> </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/> <sound model='es1370'/> <video> <model type='cirrus' vram='9216' heads='1'/> </video> </devices> </domain>
Can you get the libvirt QEMU args from the log file
/var/log/libvirt/qemu/XPHome.log
so we can compare them to the args your custom script used. There will probably be some minor difference that's confusing windows
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/home/dh USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc -m 512 -smp 1 -name XPHome -uuid 26e5de74-0841-c4b3-4cc1-e0df0f93cb31 -monitor unix:/var/lib/libvirt/qemu/XPHome.monitor,server,nowait -localtime -no-acpi -boot c -drive file=/media/XP/vdisk.img,if=ide,index=0,boot=on -drive file=/media/XP/vdisk1.img,if=ide,index=1 -drive file=/dev/cdrom,if=ide,media=cdrom,index=2 -net nic,macaddr=54:52:00:7a:ee:01,vlan=0,name=nic.0 -net tap,fd=17,vlan=0,name=tap.0 -serial pty -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:0 -k en-us -vga cirrus -soundhw es1370 char device redirected to /dev/pts/6 Running this command in a terminal i get TUNGETIFF ioctl() failed: Bad file descriptor TUNSETOFFLOAD ioctl() failed: Bad file descriptor and VM is *NOT* starting! There is no tap interface but a virbr2. Anyway, it's the same for Linux VMs -I checked in logs- and they start. Thanks for your support. -- Daniel

On Thu, Nov 12, 2009 at 12:54:07PM +0100, Daniel Huhardeaux wrote:
Daniel P. Berrange a écrit :
Hi Daniel,
On Wed, Nov 11, 2009 at 06:56:37PM +0100, Daniel Huhardeaux wrote:
My start script -which started without any problem my XPHome VM- is:
#!/bin/bash
AUDIO="es1370" VGA="std"
sudo /usr/bin/kvm -localtime -cdrom /dev/scd0 -boot c -hda /media/XP/vdisk.img -hdb /media/XP/vdisk1.img -m 512 -soundhw $AUDIO -vga $VGA\ -net nic,vlan=0 -net vde,vlan=0,sock=/var/run/vde.ctl -usb -smb public -monitor tcp:127.0.0.1:32011,server,nowait &
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/home/dh USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc -m 512 -smp 1 -name XPHome -uuid 26e5de74-0841-c4b3-4cc1-e0df0f93cb31 -monitor unix:/var/lib/libvirt/qemu/XPHome.monitor,server,nowait -localtime -no-acpi -boot c -drive file=/media/XP/vdisk.img,if=ide,index=0,boot=on -drive file=/media/XP/vdisk1.img,if=ide,index=1 -drive file=/dev/cdrom,if=ide,media=cdrom,index=2 -net nic,macaddr=54:52:00:7a:ee:01,vlan=0,name=nic.0 -net tap,fd=17,vlan=0,name=tap.0 -serial pty -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:0 -k en-us -vga cirrus -soundhw es1370
The most likely problem here is that the libvirt args have acpi turned off. Add the '<acpi/>' element within <features> in the libvirt XML. That should get rid of the '-no-acpi' flag libvirt added. One more likely problem here is the different of 'cirrus' vs 'std'. Windows hates having its graphics card changed behind its back :-) Try changing the libvirt XML for <video> to 'vga' instead of 'cirrus'. That will make libvirt spawn QEMU with '-vga std' which matches your script.
char device redirected to /dev/pts/6
Running this command in a terminal i get
TUNGETIFF ioctl() failed: Bad file descriptor TUNSETOFFLOAD ioctl() failed: Bad file descriptor
That's not a problem - libvirt passes the file descriptor to QEMU when it starts it. 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 :|

Daniel P. Berrange a écrit : [...]
The most likely problem here is that the libvirt args have acpi turned off. Add the '<acpi/>' element within <features> in the libvirt XML. That should get rid of the '-no-acpi' flag libvirt added.
Yes, that did the trick, thanks!
One more likely problem here is the different of 'cirrus' vs 'std'. Windows hates having its graphics card changed behind its back :-) Try changing the libvirt XML for <video> to 'vga' instead of 'cirrus'. That will make libvirt spawn QEMU with '-vga std' which matches your script.
Done, Windows will now like his new graphic card ;-) -- Daniel
participants (2)
-
Daniel Huhardeaux
-
Daniel P. Berrange