qemu: how to select from which hdd to boot?

13,624

Yes, "sata" device is probed first, but you can change the boot device either "hand-off" with:

-boot order=c

or by manual selection with:

-boot menu=on

Both option can be used thogether:

-boot order=c,menu=on
Share:
13,624

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I want to connect 2 hdds to my qemu virtual machine. One of them is actually a file connected via virtio, and I want it to be the bootable drive. The other is a partition that I want to pass through; I add it through IDE (though I'm not sure if it's the best way to do it). The problem is, as soon as I add the IDE drive, it takes priority in Seabios, and the virtual machine will try to boot from it, ignoring the bootable virtio drive. This can be worked around by using boot menu, but it's tedious. I want to be able to somehow make the virtio drive the default bootable drive, maybe by changing the order in which drives are listed in Seabios, is it possible? The relevant part of the command I start qemu-system-x86_64 with is:

    -device virtio-scsi-pci,id=scsi \
    -drive file=/media/kv/vms/win-qad.img,id=disk,format=raw -device scsi-hd,drive=disk \
    -drive file=/dev/sdg1,id=shared_disk,format=raw -device ide-hd,bus=ide.1,drive=shared_disk \
    
  • falsePockets
    falsePockets over 5 years
    Where did c come from? Am I supposed to put a number or id there?
  • schweik
    schweik over 5 years
    C:\ came from old MS-DOS times as the first harddisk. A: and B: was reserved for floppy, hence 1. HDD was C: . The *nix uses hda hdb hdc ... etc. or sda sdb sdc ... In qemu they probably wanted to proximate the therminology to MS- funs.