To change boot options in virt-manager, open the virtual machine's details window, click the lightbulb icon to enter the hardware details view, select the Boot Options section, and check the boxes for the devices you want to include in the boot sequence. You can then drag and drop these devices to prioritize which one the system attempts to load first, such as booting from an ISO image before the virtual hard drive.
Configuring boot options is essential for installing a new operating system, recovering a corrupted system via a Live CD, or ensuring that a VM always starts from the primary disk after an installation is complete. By managing the boot order, you control the sequence in which the virtual firmware searches for a bootable partition or image. This process occurs at the hardware emulation level, meaning it mimics how a physical motherboard handles the boot sequence.
What You'll Need
- A Linux system with
virt-manager(Virtual Machine Manager) installed. - A virtual machine already created (even if it is not yet installed with an OS).
- Administrative privileges (root or a user in the
libvirtgroup) to modify VM configurations. - An ISO image or virtual disk attached to the VM if you intend to boot from specific media.
Step-by-Step
- Launch Virtual Machine Manager: Open the virt-manager application from your desktop environment's application menu. You will see a list of your virtual machines in the main window.
- Open the VM Console: Double-click the specific virtual machine you wish to configure. This opens the console window where you would normally see the VM's screen.
- Enter Hardware Details: In the toolbar of the VM console window, look for the icon that looks like a lightbulb (Show virtual hardware details). Click this icon. This switches the view from the live console to the configuration menu. Note that labels and icons may differ slightly depending on your version of virt-manager and your system's theme.
- Navigate to Boot Options: In the left-hand sidebar of the hardware details view, scroll down the list of hardware components. Click on the entry labeled "Boot Options".
- Select Bootable Devices: In the main panel, you will see a list of all attached hardware that is capable of booting (such as SATA CD-ROMs, VirtIO disks, or IDE drives). Check the box next to every device that you want the VM to consider during the startup process. If a device is not checked, the VM will skip it entirely, even if it contains a bootable operating system.
- Prioritize the Boot Order: Once the desired devices are checked, you must define the order. Click on a device in the list and use the arrow buttons (usually located to the right of the list) to move the device up or down. The device at the top of the list is the first one the VM will attempt to boot from. For example, if you are installing a new OS, move the CD-ROM (ISO) to the top. Once installed, move the Hard Disk to the top to avoid booting into the installer again.
- Apply Changes: After arranging the order, click the "Apply" button at the bottom right of the window. This saves the configuration to the VM's XML definition.
- Verify the Boot: Close the hardware details view by clicking the lightbulb icon again and start the virtual machine. Observe the boot sequence to ensure it loads from the intended device.
Common Mistakes
One of the most frequent errors is forgetting to check the box for the boot device. Many users move a device to the top of the list but leave the checkbox unchecked; in this case, virt-manager ignores the device entirely, often leading to a "No bootable device found" error message on the VM screen.
Another common mistake is leaving the installation ISO as the primary boot device after the operating system has been successfully installed. This results in the VM booting back into the installation menu every time it restarts, forcing the user to manually select the hard drive from a boot menu or return to the hardware settings to change the priority.
Users also frequently confuse the "Boot Options" menu with the firmware settings (BIOS/UEFI). While Boot Options tell virt-manager which devices to present to the firmware, the firmware itself has its own internal settings. If you have a UEFI-based VM, you may still need to enter the UEFI menu (by pressing ESC or F2 during the initial splash screen) to make deeper changes to the boot manager.
Finally, attempting to change boot options while the VM is actively running can sometimes lead to confusion. While virt-manager allows some changes while the VM is live, boot order changes typically require a full shutdown and restart of the guest OS to take effect.
Tips
If you frequently switch between booting from a disk and booting from an ISO for maintenance, consider using the "Boot Menu" shortcut. Instead of changing the permanent order in the hardware settings, you can often press F12 (for BIOS) or a similar key during the boot splash screen to bring up a temporary boot selection menu. This allows you to boot from an ISO once without altering your permanent configuration.
When setting up a new VM, always ensure your virtual disk is listed in the boot options, even if it is currently empty. This ensures that as soon as the installation process writes the bootloader to the disk, the VM is ready to transition from the ISO to the disk boot.
For advanced users, remember that virt-manager is a graphical frontend for libvirt. If you find the GUI limiting, you can use the virsh edit [vm-name] command in the terminal to manually edit the XML configuration. The <boot dev='hd'/> or <boot dev='cdrom'/> tags in the XML correspond directly to the checkboxes you see in the Boot Options menu.
Troubleshooting
If the VM still refuses to boot from the selected device after you have applied the changes, first check if the device is actually attached. For a CD-ROM, ensure that an ISO file is correctly linked in the "CDROM" hardware section. If the path to the ISO is broken or the file has been moved, the boot process will skip that device regardless of its priority.
If you see a message stating "No bootable device," double-check that you have selected the correct firmware. In the "Overview" section of the hardware details, check the "Firmware" dropdown. If you installed an OS using UEFI but the VM is now set to BIOS (or vice versa), the VM will not find the bootloader. You cannot change the firmware type after the VM has been created and the OS installed without potentially breaking the bootloader; you must ensure the firmware matches the installation method.
If the VM hangs at a black screen during boot, try changing the disk bus type. For example, if you are using "VirtIO" and the guest OS does not have the necessary drivers during the boot phase, it may fail to initialize the disk. Switching to "SATA" or "IDE" in the disk settings can sometimes resolve this, although VirtIO is generally preferred for performance once drivers are installed.
If the "Apply" button is greyed out, ensure that you have actually changed a setting. If you have not checked a box or moved an item, the button will remain inactive. If it remains inactive despite changes, try restarting the libvirtd service on your host machine to clear any hung locks on the VM configuration file.
Frequently Asked Questions
Can I change the boot order while the VM is running?
You can change the settings in the interface, but the changes will not affect the current session. The new boot order will only be applied the next time the virtual machine is fully powered off and started again.
What is the difference between BIOS and UEFI boot options?
BIOS (Basic Input/Output System) is the legacy standard that looks for a Master Boot Record (MBR) on the disk. UEFI (Unified Extensible Firmware Interface) is the modern standard that uses a dedicated EFI System Partition (ESP) to load the bootloader. The boot options menu works for both, but the firmware type must match how the OS was installed.
Why is my ISO not showing up in the Boot Options list?
The ISO itself doesn't appear in the list; rather, the virtual CD-ROM drive that holds the ISO does. If you don't see a CD-ROM option, you must first go to "Add Hardware" and add a SATA CD-ROM device to the VM.
How do I boot from the network (PXE)?
To boot from the network, you must have a network interface attached to the VM. Once attached, the network device will appear in the Boot Options list. Check the box and move it to the top of the priority list to enable PXE booting.
Will changing the boot order delete my data?
No, changing the boot order only changes the sequence in which the virtual firmware searches for an operating system. It does not modify the data on your virtual disks or ISO images.