QEMU and macOS Big Sur

January 25, 2021    Article    113 words    1 min read
QEMU logo

If you try to run QEMU under macOS Big Mac Sur with the -machine accel=hvf flag (basically with Apple’s Hypervisor Framework) you’ll get one ugly error; every time hv_vm_create() runs it returns an HV_ERROR. The reason is that the com.apple.vm.hypervisor entitlement (used in macOS 10.15) has been deprecated and replaced by com.apple.security.hypervisor.

You need to sign your binary with the correct entitlement. Add the XML below to an entitlements.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
<plist version="1.0">

After that, sign the QEMU binary with the entitlements.xml file.

$ codesign -s - --entitlements entitlements.xml --force /usr/local/bin/qemu-system-x86_64

Starting QEMU with -machine accel=hvf will work now.