You are not logged in.

#1 2014-04-05 22:26:28

gizzard
Member
Registered: 2010-08-21
Posts: 25

[SOLVED] QEMU-KVM fails to boot if passed q35 machine type

As I understand it, qemu still uses the PII3X as the default machine type.  I had been using -machine type=q35,accel=kvm for a few weeks to learn more about qemu and KVM.  With this code I could boot a win7 VM and I confirmed the ICH9 chipset appeared in the device manager.

After a system update I am no longer able to pass that command.  I am using the linux-0.2 image located here.

If I enter this code, the system boots normally:

qemu-system-x86_64 -enable-kvm -boot order=c linux-0.2.img

This however does not work and the bios complains that there is no bootable media found (after waiting for pxe):

qemu-system-x86_64 -enable-kvm -boot order=c -M q35 linux-0.2.img

qemu is 1.7.0-2 (built 02/19/14 but this is the only package in pacman's cache)
seabios is 1.7.3.1-2 (built 09/21/13)

I actually tried this on two different machines with the same result.  What can I do next to troubleshoot?  Thanks.

Last edited by gizzard (2014-04-13 15:55:25)

Offline

#2 2014-04-06 13:27:03

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] QEMU-KVM fails to boot if passed q35 machine type

You can do without the option "-boot order=c" since you only provide one boot medium. I believe you mean qemu-system-x86_64 instead of qemu-system-x86 smile

You mention Win7 and linux-0.2.img, later you only mention linux-0.2.img, that's a bit confusing, I suppose you mention the later because it is something everyone has access to. From now on I'll refer to linux-0.2.img.

You may have found a bug _or_ there might be something wrong with the image. I don't have experience with syslinux so I don't know its capabilities, but I find it strange that the disk image doesn't contain any partitions, 'fdisk -l linux-0.2.img' returns an empty list.

The disk is marked as bootable but since there are no partitions something may not work properly.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2014-04-06 15:57:21

gizzard
Member
Registered: 2010-08-21
Posts: 25

Re: [SOLVED] QEMU-KVM fails to boot if passed q35 machine type

R00KIE wrote:

You can do without the option "-boot order=c" since you only provide one boot medium. I believe you mean qemu-system-x86_64 instead of qemu-system-x86 smile

You mention Win7 and linux-0.2.img, later you only mention linux-0.2.img, that's a bit confusing, I suppose you mention the later because it is something everyone has access to. From now on I'll refer to linux-0.2.img.

You may have found a bug _or_ there might be something wrong with the image. I don't have experience with syslinux so I don't know its capabilities, but I find it strange that the disk image doesn't contain any partitions, 'fdisk -l linux-0.2.img' returns an empty list.

The disk is marked as bootable but since there are no partitions something may not work properly.

Thank you for responding!

Yes, I meant x86_64 (I wrote the post from memory).  I edited the first post for clarity.  Also, yes I had been using a win7 VM but when this problem began I went back to the linux-0.2.img because initially I thought the VM was somehow corrupted.  I get the same result with the win7 VM though - with -M q35 it fails to boot, and without it it boots fine.

I just tried a Debian live image and got the same result.  It has a bootable partition:

[gizzard sugaree ~/Downloads] fdisk -l debian-live-7.4-amd64-standard.iso 

Disk debian-live-7.4-amd64-standard.iso: 461 MiB, 483393536 bytes, 944128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x302ade6b

Device                              Boot Start       End Blocks  Id System
debian-live-7.4-amd64-standard.iso1 *       64    944127 472032  17 Hidden HPFS/

[gizzard sugaree ~/Downloads]

Running qemu-system-x86_64 -M q35 -enable-kvm debian-live-7.4-amd64-standard.iso fails to boot, but without the -M q35 it boots instantly to the debian boot menu.

Offline

#4 2014-04-06 16:28:50

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] QEMU-KVM fails to boot if passed q35 machine type

The iso should boot, yes. I did try using -M q35 with a WinXP image I have here and it started to boot (I get blue screens and automatic reboots since lots of things change with -M q35).

One different thing I have however is the specification of the interface type for disks. Try using "-drive file=/path/to/image,if=scsi" or "-drive file=/path/to/image,if=virtio", that seems to make it work for me, it still might make Win7 complain though.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2014-04-08 00:16:17

gizzard
Member
Registered: 2010-08-21
Posts: 25

Re: [SOLVED] QEMU-KVM fails to boot if passed q35 machine type

R00KIE wrote:

The iso should boot, yes. I did try using -M q35 with a WinXP image I have here and it started to boot (I get blue screens and automatic reboots since lots of things change with -M q35).

One different thing I have however is the specification of the interface type for disks. Try using "-drive file=/path/to/image,if=scsi" or "-drive file=/path/to/image,if=virtio", that seems to make it work for me, it still might make Win7 complain though.

I think I'm getting closer thanks to your help.  Adding the if variable allows the debian image to boot using the q35 machine type.  Here are results of some trials (command and result):

1. qemu-system-x86_64 -enable-kvm -cpu host -m 1024 debian-live-7.4-amd64-standard.iso
- boots fine

user@debian:~$ lspci | grep ACPI
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)

2. qemu-system-x86_64 -enable-kvm -cpu host -m 1024 -machine type=q35,accel=kvm debian-live-7.4-amd64-standard.iso
- fails to boot

3. qemu-system-x86_64 -enable-kvm -cpu host -m 1024 -machine type=q35,accel=kvm -drive file=debian-live-7.4-amd64-standard.iso,if=ide
- fails to boot

4. qemu-system-x86_64 -enable-kvm -cpu host -m 1024 -machine type=q35,accel=kvm -drive file=debian-live-7.4-amd64-standard.iso,if=scsi
- boots fine

user@debian:~$ lspci | grep AHCI
00:1f.2 SATA controller: Intel Corporation 82901IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] (rev 02)
user@debian:~$ lspci | grep SCSI
00:03.0 SCSI storage controller: LSI Logic / Symbios Logic 53c895a

4. qemu-system-x86_64 -enable-kvm -cpu host -m 1024 -machine type=q35,accel=kvm -drive file=debian-live-7.4-amd64-standard.iso,if=virtio
- boots fine

user@debian:~$ lspci | grep AHCI
00:1f.2 SATA controller: Intel Corporation 82901IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] (rev 02)
user@debian:~$ lspci | grep SCSI
00:03.0 SCSI storage controller: Red Hat, Inc Virtio block device

I will try these options with the win7 VM and report back.  I may need to recreate it from scratch, so it might take a little while.

Offline

#6 2014-04-13 15:55:13

gizzard
Member
Registered: 2010-08-21
Posts: 25

Re: [SOLVED] QEMU-KVM fails to boot if passed q35 machine type

Mark as solved.  I had to add -bios /usr/share/qemu/bios.bin and the if=scsi (or virtio) options to the qemu command line and I was able to boot the Win7 VM using the q35 machine type.  I also added media=disk (or cdrom), although I'm not sure if this is necessary.  Thanks again for your help.

Offline

#7 2014-11-24 07:25:59

davidshen84
Member
Registered: 2012-01-25
Posts: 8

Re: [SOLVED] QEMU-KVM fails to boot if passed q35 machine type

Just tried. "media" type is required if using "-M q35".

Offline

Board footer

Powered by FluxBB