The "No OS" error during OpenBSD installation on KVM typically indicates that the virtual machine cannot boot from the selected media or lacks a valid bootloader. This issue is most commonly caused by incorrect ISO attachment, missing firmware for UEFI booting, or improper disk configuration in the hypervisor settings.
Verifying ISO Attachment and Boot Order
The primary cause of this error is often a simple misconfiguration in how the installation media is presented to the virtual machine. When creating a new VM in tools like Virt-Manager or via command-line
qemu-system-x86_64, you must ensure the ISO file is attached as a CD-ROM device, not as a hard drive. If the ISO is attached as a disk, the BIOS/UEFI may not recognize it as a bootable medium.
Check your VM's hardware configuration to confirm the optical drive is present and enabled. Ensure that the boot order places the CD-ROM before the virtual hard disk. In many cases, the system attempts to boot from an empty virtual disk first, finds nothing, and reports "No OS." You can verify this by entering the VM's firmware setup (usually F2 or Del) and checking the boot priority list. Additionally, ensure the ISO file path is correct and the file is not corrupted. A quick way to test this is to try booting the ISO on a different VM or host to rule out file integrity issues.
Troubleshooting: No Internet on QEMU VM despite Connection Present demonstrates similar attention to detail required when configuring virtual hardware components correctly.
Addressing UEFI Firmware Requirements
OpenBSD has increasingly moved towards UEFI support, especially for newer versions and architectures. If you are attempting to install OpenBSD on a VM configured for UEFI rather than Legacy BIOS, you must provide the necessary OVMF (Open Virtual Machine Firmware) packages. Without these firmware files, the VM will attempt to start but fail to load any operating system, resulting in the "No OS" message.
On Debian-based hosts, install the
ovmf package using
sudo apt install ovmf. On RHEL/CentOS systems, use
yum install edk2-ovmf. Once installed, configure your VM to use UEFI as the firmware type. In Virt-Manager, go to the VM details, select "Overview," and change the Firmware setting from "Default" to "OVMF." For command-line users, add the appropriate OVMF variables to your QEMU arguments. This step is critical because modern OpenBSD installers expect a UEFI environment to function properly.
Checking Disk Configuration and Partitioning
Another common culprit is an improperly formatted virtual disk. The installer needs a clean slate to create partitions. If you have previously attempted an installation or created a disk with incompatible partition tables, the bootloader may fail to initialize. Ensure the virtual disk is unallocated or has a standard GPT/MBR layout compatible with OpenBSD.
If you are using LVM or ZFS on the host, ensure that the block device exposed to the VM is accessible and not locked by another process. Sometimes, residual partition tables from previous attempts can confuse the bootloader. You can check the disk status within the VM console or by inspecting the host's storage pool. Removing and recreating the virtual disk often resolves persistent "No OS" errors related to disk initialization failures.
Ensuring Correct CPU and Architecture Settings
Mismatched CPU models or architecture settings can also prevent the bootloader from executing. OpenBSD requires specific CPU features to run efficiently. If your host CPU is older or lacks certain instructions, you may need to adjust the CPU model passed to the VM. In Virt-Manager, set the CPU mode to "Host Model" to pass through the host's capabilities. This ensures compatibility with the OpenBSD kernel requirements.
Furthermore, verify that the VM architecture matches the ISO you are using. Installing an x86_64 ISO on an ARM VM, or vice versa, will obviously result in a failure to boot. Double-check the download source to ensure you have the correct architecture image for your virtualization platform.
Testing with Minimal Configuration
If the above steps do not resolve the issue, try creating a minimal VM with only one vCPU and 512MB of RAM. Sometimes, complex hardware configurations interfere with the early boot process. Strip down the VM to essential components: one CPU, basic network adapter, and the CD-ROM. If the installation proceeds, gradually add back hardware devices to identify the conflicting component. This methodical approach helps isolate whether the issue lies with specific device passthrough or resource allocation.
Frequently Asked Questions
Why does my VM show "No OS" even with the ISO attached?
This usually happens because the boot order prioritizes the empty virtual hard disk over the CD-ROM. You must manually set the CD-ROM as the first boot device in the firmware settings or hypervisor configuration.
Do I need UEFI for all OpenBSD installations?
While legacy BIOS is still supported, newer versions strongly recommend UEFI for better security and feature support. Using UEFI requires installing OVMF packages on your host system to provide the necessary firmware files.
Can I fix this error without reinstalling the VM?
Yes, if the issue is due to boot order or ISO attachment, you can correct these settings in the VM configuration menu without deleting the virtual machine. However, if the disk is corrupted, you may need to recreate the disk image.
What is OVMF and why is it important?
OVMF stands for Open Virtual Machine Firmware, which provides UEFI support for virtual machines. It is essential for running modern operating systems like OpenBSD that rely on UEFI standards for booting and secure startup processes.
How do I check if my ISO file is corrupted?
You can verify the integrity of the ISO by comparing its SHA256 checksum against the official checksum provided on the OpenBSD website. If the checksums match, the file is intact; otherwise, re-download the image.