Skip to content

fix(qemu): swap boot order so disk has priority over ISO#135

Merged
reubeno merged 1 commit intomicrosoft:mainfrom
kgodara912:kgodara/iso_boot_order
Apr 30, 2026
Merged

fix(qemu): swap boot order so disk has priority over ISO#135
reubeno merged 1 commit intomicrosoft:mainfrom
kgodara912:kgodara/iso_boot_order

Conversation

@kgodara912
Copy link
Copy Markdown
Contributor

UEFI/OVMF respects bootindex on every boot. Previously the ISO had bootindex=1 (highest) and the disk bootindex=2, causing the VM to always boot the ISO — even after the installer wrote an EFI bootloader to disk.

Give the disk bootindex=1 and the ISO bootindex=2. On first boot the firmware tries the empty disk, finds no bootloader, and falls through to the CD-ROM so the installer runs normally. After installation the firmware finds the new bootloader on disk and boots from it directly.

UEFI/OVMF respects bootindex on every boot. Previously the ISO had
bootindex=1 (highest) and the disk bootindex=2, causing the VM to
always boot the ISO — even after the installer wrote an EFI bootloader
to disk.

Give the disk bootindex=1 and the ISO bootindex=2. On first boot the
firmware tries the empty disk, finds no bootloader, and falls through
to the CD-ROM so the installer runs normally. After installation the
firmware finds the new bootloader on disk and boots from it directly.

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 30, 2026 17:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates QEMU argument generation so that, when an install/live ISO is attached, the VM prioritizes booting from disk and treats the ISO as a fallback—addressing UEFI/OVMF behavior where bootindex is honored on every reboot.

Changes:

  • Swap bootindex priorities so the disk uses bootindex=1 and the install ISO uses bootindex=2.
  • Update inline documentation in RunOptions and the runner’s boot-order comment to describe the new behavior.
  • Update the QEMU runner test expectations to match the new boot order.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/utils/qemu/qemu.go Changes bootindex assignment so disk is always first and ISO is fallback; updates comments to explain UEFI/OVMF behavior.
internal/utils/qemu/qemu_test.go Adjusts the test case name and expected argument fragments to match the new bootindex ordering.

Comment thread internal/utils/qemu/qemu.go
Comment thread internal/utils/qemu/qemu.go
@reubeno reubeno merged commit 434d397 into microsoft:main Apr 30, 2026
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants