macOS doesn't care much where the installer is stored though, so you can attach the image as sata disk too and it'll work fine.įinally you need the clover disk image. On a real macintosh you'll typically use a usbstick. Attached as sata disk to the q35 ahci controller. This is the system disk where macOS is be installed on. Without that macOS does a wild guess, likely gets it very wrong, and wall clock in your guest runs either way too fast or way too slow. When asking to provide a fixed TSC frequency qemu will store the TSC frequency in a hypervisor cpuid leaf. The invtsc feature is needed because macOS uses the TSC for timekeeping. Using the q35 machine type here, and the cutting edge edk2 builds from my firmware repo. hvm /usr/share/edk2.git/ovmf-圆4/OVMF_CODE-pure-efi.fd /var/lib/libvirt/qemu/nvram/macos-test-org-base_VARS.fd The xmlns:qemu entry is needed for qemu-specific tweaks, that way we can ask libvirt to add extra arguments to the qemu command line. Here are snippets of my libvirt config, with comments explaining the important things: With the result that macOS doesn't boot, even though ovmf itself shows no signs of trouble.
Older OVMF versions trip over a recent qemu update and provides broken ACPI tables to the OS then.
macOS 10.12.4 requires fixes for the qemu applesmc emulation which got merged for qemu 2.10. macOS versions up to 10.12.3 work fine in qemu 2.9. Version 2.10 (or newer) strongly recommended. So, if something goes wrong recovering is a lot easier. The advantage of having a separate disk only for clover is that you can easily update clover, downgrade clover and tweak the clover configuration without booting the virtual machine.
I've created a script which uses guestfish to generate a disk image from a clover iso image, with a custom config file. You can then dd the usb stick to a raw disk image. You can create a bootable usbstick using the createinstallmedia tool shipped with the installer. Here is how my setup looks like.įirst a bootable installer disk image. I've choose to use the Clover EFI bootloader instead. One is to add apple-specific features to OVMF, as described by Gabriel L. There are various approaches to run macOS as guest under kvm.