Skip to contentSkip to conversation

Failure to boot CDROM with -drive arg

DISCUSSION Daniel P. Berrange 4 participants 13 messages Jul 8, 2008 KVM

lore
Share & tools
lore
#0 lore raw

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500

With the 2nd though, the initial CDROM syslinux loads, but fails to load the graphical menu, and also fails to boot in text mode fallback:

'vesamenu.c32: attempted DOS system call"

(See screenshot: https://bugzilla.redhat.com/attachment.cgi?id=311221 )

I've reproduced this with both KVM 65 and 70, on a Fedora 9 host. The CDROM boot.iso image I'm using here is the Fedora 9 $URL/images/boot.iso from any standard Fedora install tree.

I can only imagine there's something different in the way extboot sets up the CPU/pagetables during cdrom boot, but its rather beyond my skills

This was originally reported by a Fedora user here

https://bugzilla.redhat.com/show_bug.cgi?id=452355

Daniel

Signature · 4 lines
|: 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 :|
#1 lore raw
Quoted 7 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500

"-cdrom /home/berrange/boot.iso" is identical to "-drive file=/home/berrange/boot.iso,index=1,media=cdrom"

with if=ide by default.

Could you try you command line without "boot=on" ?

Quoted 19 lines

With the 2nd though, the initial CDROM syslinux loads, but fails to load the graphical menu, and also fails to boot in text mode fallback:

'vesamenu.c32: attempted DOS system call"

(See screenshot: https://bugzilla.redhat.com/attachment.cgi?id=311221 )

I've reproduced this with both KVM 65 and 70, on a Fedora 9 host. The CDROM boot.iso image I'm using here is the Fedora 9 $URL/images/boot.iso from any standard Fedora install tree.

I can only imagine there's something different in the way extboot sets up the CPU/pagetables during cdrom boot, but its rather beyond my skills

This was originally reported by a Fedora user here

https://bugzilla.redhat.com/show_bug.cgi?id=452355

Daniel

Signature · 3 lines
--------- [email protected] ----------
"L'avenir ne se prévoit pas, il se prépare."
- Maurice Blondel
#2 lore raw
Quoted 9 lines · Laurent Vivier
Quoted 7 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500
Quoted 6 lines

"-cdrom /home/berrange/boot.iso" is identical to "-drive file=/home/berrange/boot.iso,index=1,media=cdrom"

with if=ide by default.

Could you try you command line without "boot=on" ?

Yep, that works - so its clearly something todo with the extboot support

Daniel

Signature · 4 lines
|: 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 :|
#3 lore raw
Quoted 10 lines · Daniel P. Berrange
Quoted 9 lines · Laurent Vivier
Quoted 7 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500
Quoted 8 lines
Quoted 6 lines

"-cdrom /home/berrange/boot.iso" is identical to "-drive file=/home/berrange/boot.iso,index=1,media=cdrom"

with if=ide by default.

Could you try you command line without "boot=on" ?

Yep, that works - so its clearly something todo with the extboot support

I think "boot=on" must be used only with device that are not managed by the bios (scsi, virtio-blk, ...).

We should modify the command line interface to check that...

Laurent

Signature · 3 lines
--------- [email protected] ----------
"L'avenir ne se prévoit pas, il se prépare."
- Maurice Blondel
#4 lore raw
In reply to Daniel P. Berrange
Quoted 6 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500

http://sourceforge.net/tracker/index.php?func=detail&aid=1977971&group_id=180599&atid=893831

Signature · 3 lines
Soren Hansen               | 
Virtualisation specialist  | Ubuntu Server Team
Canonical Ltd.             | http://www.ubuntu.com/
#5 lore raw
Quoted 9 lines · Soren Hansen
Quoted 6 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500

http://sourceforge.net/tracker/index.php?func=detail&aid=1977971&group_id=180599&atid=893831

Ok, so basically this is saying that boot=on only works for media=disk. I really don't like the fact that we now have 2 different ways of flagging bootable disks, depending on whether want to use BIOS boot or extboot.

The management apps shouldn't have to make such a decision - QEMU should be picking the most appropriate choice for us. ie, if we have boot=on with an IDE cdrom, then QEMU should automatically do a BIOS boot instead of extboot. This way if extboot gets improved, QEMU can update its logic to correspond without needing to change all the management apps using QEMU.

Daniel

Signature · 4 lines
|: 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 :|
#6 lore raw
Quoted 15 lines · Daniel P. Berrange
Quoted 9 lines · Soren Hansen
Quoted 6 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500

http://sourceforge.net/tracker/index.php?func=detail&aid=1977971&group_id=180599&atid=893831

Ok, so basically this is saying that boot=on only works for media=disk. I really don't like the fact that we now have 2 different ways of flagging bootable disks, depending on whether want to use BIOS boot or extboot.

Quoted 6 lines

The management apps shouldn't have to make such a decision - QEMU should be picking the most appropriate choice for us. ie, if we have boot=on with an IDE cdrom, then QEMU should automatically do a BIOS boot instead of extboot. This way if extboot gets improved, QEMU can update its logic to correspond without needing to change all the management apps using QEMU.

I agree.

Laurent

Signature · 3 lines
--------- [email protected] ----------
"L'avenir ne se prévoit pas, il se prépare."
- Maurice Blondel
#7 lore raw
In reply to Daniel P. Berrange
Quoted 9 lines · Daniel P. Berrange
Quoted 7 lines · Soren Hansen
Quoted 5 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500

http://sourceforge.net/tracker/index.php?func=detail&aid=1977971&group_id=180599&atid=893831

Ok, so basically this is saying that boot=on only works for media=disk. I really don't like the fact that we now have 2 different ways of flagging bootable disks, depending on whether want to use BIOS boot or extboot.

Semantically, boot=on means "make this the first bootable hard disk". That's not to say that there shouldn't be a check.

If you did:

qemu-system-x86 -drive file=foo.img,boot=on -boot d

You would still boot from the cdrom.

Regards,

Anthony Liguori

Quoted 9 lines

The management apps shouldn't have to make such a decision - QEMU should be picking the most appropriate choice for us. ie, if we have boot=on with an IDE cdrom, then QEMU should automatically do a BIOS boot instead of extboot. This way if extboot gets improved, QEMU can update its logic to correspond without needing to change all the management apps using QEMU.

Daniel

#8 lore raw
Quoted 20 lines · Anthony Liguori
Quoted 9 lines · Daniel P. Berrange
Quoted 7 lines · Soren Hansen
Quoted 5 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500

http://sourceforge.net/tracker/index.php?func=detail&aid=1977971&group_id=180599&atid=893831

Ok, so basically this is saying that boot=on only works for media=disk. I really don't like the fact that we now have 2 different ways of flagging bootable disks, depending on whether want to use BIOS boot or extboot.

Quoted 8 lines

Semantically, boot=on means "make this the first bootable hard disk". That's not to say that there shouldn't be a check.

If you did:

qemu-system-x86 -drive file=foo.img,boot=on -boot d

You would still boot from the cdrom.

So, "boot=on" means in fact "bootable=true"

Regards,
Laurent

Signature · 3 lines
--------- [email protected] ----------
"L'avenir ne se prévoit pas, il se prépare."
- Maurice Blondel
#9 lore raw
Quoted 2 lines · Laurent Vivier

So, "boot=on" means in fact "bootable=true"

I guess. I don't know that the later is more clear. I think the source of the confusion is the entire concept of "first bootable harddisk" which is what -boot c really means.

FWIW, the reason media=cdrom,boot=on doesn't work, is that a CDROM's boot record is in el torito format instead of the traditional BIOS boot sector.

media=cdrom,boot=on would work if the image was a disk image instead of an ISO.

In fact, I'm inclined to think that media=cdrom,boot=on should not be explicitly prohibited because of this fact.

Regards,

Anthony Liguori

Quoted 3 lines

Regards,
Laurent

#10 lore raw
Quoted 12 lines · Anthony Liguori
Quoted 2 lines · Laurent Vivier

So, "boot=on" means in fact "bootable=true"

I guess. I don't know that the later is more clear. I think the source of the confusion is the entire concept of "first bootable harddisk" which is what -boot c really means.

FWIW, the reason media=cdrom,boot=on doesn't work, is that a CDROM's boot record is in el torito format instead of the traditional BIOS boot sector.

Quoted 5 lines

media=cdrom,boot=on would work if the image was a disk image instead of an ISO.

In fact, I'm inclined to think that media=cdrom,boot=on should not be explicitly prohibited because of this fact.

To simplify, I think qemu should ignore "boot=on" when "if=ide".

Laurent

Signature · 3 lines
--------- [email protected] ----------
"L'avenir ne se prévoit pas, il se prépare."
- Maurice Blondel
#11 lore raw
Quoted 9 lines · Laurent Vivier
Quoted 7 lines · Anthony Liguori
Quoted 3 lines · Laurent Vivier

So, "boot=on" means in fact "bootable=true"

I guess. I don't know that the later is more clear. I think the source of the confusion is the entire concept of "first bootable harddisk" which is what -boot c really means.

Quoted 9 lines
Quoted 6 lines

FWIW, the reason media=cdrom,boot=on doesn't work, is that a CDROM's boot record is in el torito format instead of the traditional BIOS boot sector.

media=cdrom,boot=on would work if the image was a disk image instead of an ISO.

In fact, I'm inclined to think that media=cdrom,boot=on should not be explicitly prohibited because of this fact.

To simplify, I think qemu should ignore "boot=on" when "if=ide".

It's necessary to boot from anything other than hda. For instance:

qemu-system-x86_64 -hda foo.img -drive file=boo.img,if=ide,boot=on -boot c

Regards,

Anthony Liguori

Quoted 2 lines

Laurent

#12 lore raw
In reply to Soren Hansen
Quoted 9 lines · Soren Hansen
Quoted 6 lines · Daniel P. Berrange

The following two command lines should be identical from the user's point of view:

# qemu-kvm -cdrom /home/berrange/boot.iso -boot d -m 500
# qemu-kvm -drive file=/home/berrange/boot.iso,if=ide,media=cdrom,index=2,boot=on -m 500

http://sourceforge.net/tracker/index.php?func=detail&aid=1977971&group_id=180599&atid=893831

yes, in fact "media=cdrom,boot=on" is not equal to "-cdrom ... -boot d". "boot=on" means "use bios extension extboot with this drive", and using extboot allows the bios to manage this device and to boot from it.

Laurent

Signature · 3 lines
--------- [email protected] ----------
"L'avenir ne se prévoit pas, il se prépare."
- Maurice Blondel