Skip to main content

QEMU UEFI Support (OVMF)

Installation (Alpine Linux)

apk add ovmf
# From edge community
# apk add ovmf -X https://mirrors.aliyun.com/alpine/edge/community/

# Manual Download
curl -O https://mirrors.aliyun.com/alpine/edge/community/x86_64/ovmf-0.0.201908-r1.apk
# Extract bios.bin

Usage

Use -bios to specify the OVMF firmware.

# Basic usage
qemu-system-x86_64 -bios /usr/share/ovmf/bios.bin

# macOS (HVF acceleration)
qemu-system-x86_64 -accel hvf -m 4G -smp 2 \
-net nic -nic user,hostfwd=tcp::2222-:22 \
-drive file=disk.qcow2,if=virtio \
-serial stdio -display cocoa -bios bios.bin

# KVM
qemu-system-x86_64 -accel kvm -m 4G -smp 2 \
-net nic -nic user,hostfwd=tcp::2222-:22 \
-drive file=disk.qcow2,if=virtio \
-serial stdio -bios /usr/share/ovmf/bios.bin -vnc :10

[!TIP] Use -L . to tell QEMU to look for bios.bin in the current directory.

Troubleshooting

  • No Bootable Disk: Use UEFI Shell.
  • Commands: diskpart, wmic diskdrive.