Question

How would you set the boot order on KVM when using libvirt/virsh? (Either via config or command)

Était-ce utile?

La solution

Please take a look at the section Operation System booting.

The most common option is the BIOS bootloader where it allows you specifying boot order via changing domain XML. try command virsh edit <your-domain-name> then adjust the boot order with this example (copied from libvirt.org):

<os>
  <type>hvm</type>
  <loader>/usr/lib/xen/boot/hvmloader</loader>
  <boot dev='network'/>
  <boot dev='cdrom'/>
  <boot dev='hd'/>
  <bootmenu enable='yes'/>
</os>

Which means the boot order is:

  1. boot from network like PXE boot
  2. boot from CD-ROM if no PXE boot
  3. boot from local hard disk if no PXE boot nor bootable CD

Autres conseils

If you have multiple hard disks a better solution is to use

<boot order='1'/>

for the first device you want to boot and

<boot order='2'/>

for the 2nd etc

For more information see https://libvirt.org/formatdomain.html#elementsDisks

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top