Skip to content

Commit ac7218c

Browse files
author
Paul C
committed
fix: UEFI VMs trying PXE boot instead of disk when no ISO attached
OVMF (UEFI BIOS) defaults to PXE boot when no explicit boot order is set. SeaBIOS defaults to disk, so this was never noticed on legacy VMs. When a user removes the ISO after installing their OS, the VM would try PXE → fail → hang at TianoCore screen instead of booting from disk. Fix: always set -boot order explicitly. With boot media: order=dc (CD first). Without: order=c (disk first).
1 parent 9fbb1d8 commit ac7218c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/vms/manager.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,9 +1241,11 @@ impl VmManager {
12411241
}
12421242
}
12431243

1244-
// Boot order: boot media first (for installation), then disk
1244+
// Boot order: always explicit so OVMF (UEFI) doesn't default to PXE
12451245
if has_boot_media {
1246-
cmd.arg("-boot").arg("order=dc");
1246+
cmd.arg("-boot").arg("order=dc"); // CD/USB first, then disk (installation)
1247+
} else {
1248+
cmd.arg("-boot").arg("order=c"); // Disk first (normal boot)
12471249
}
12481250

12491251
write_log(&format!("Launching QEMU: VNC :{} (port {}), KVM: {}", vnc_num, vnc_port, kvm_available));

0 commit comments

Comments
 (0)