Can't load KEXT in VMs on M1

Trying to get some minimum development working again, I've been waiting to be able to macOS in VMs on M1.

Currently both VirtualBuddy, and UTM, can install macOS, I can go to Recovery Boot to disable SIP and enable 3rd party extensions.

My M1 runs: ProductVersion: 13.0 BuildVersion: 22A5331f

I've tested VM macOS versions of Monterey and Ventura.

Here is my old kext (known to be working) loaded on M1 (Ventura) bare-metal

250 0 0xfffffe0006b70000 0x862ac 0x862ac org.openzfsonosx.zfs (2.1.0) BE4DF1D3-FF77-3E58-BC9A-C0B8E175DD97 <21 7 5 4 3 1>

The same pkg, using the same steps in the VM, will after clicking Allow, ask to reboot (suspiciously fast), then come up with:

System Extension Error: An error occurred with your system extensions during startup and they need to be rebuilt before they can be used.

Of course clicking Allow just does the same, reboot, fail, ask to approve again, reboot..fail...

Directly on the hardware, the dialog "rebuilding cache" pops up for a few seconds, but with the VMs I do not see it.

I'm unfamiliar with the new system, so I'm not sure which log files to look at, but here is the output from kmtuil log, both at Allow and after reboot:

https://www.lundman.net/kmutil-log.txt

If I was going to make an uneducated guess and pull out some lines by random, maybe:

2022-08-29 20:01:13.169897+0900 0x251      Error       0x0                  100    0    kernelmanagerd: Kcgen roundtrip failed with: Boot policy error: Error creating linked manifest: code BOOTPOLICY_ERROR_ACM
2022-08-29 20:01:13.170200+0900 0x251      Error       0x0                  100    0    kernelmanagerd: Kcgen roundtrip failed checkpoint saveAuxkc: status:error fatalError:Optional("Boot policy error: Error creating linked manifest: code BOOTPOLICY_ERROR_ACM")
2022-08-29 20:01:13.170201+0900 0x251      Error       0x0                  100    0    kernelmanagerd: Kcgen roundtrip failed: missing last checkpoint or errors found
2022-08-29 20:01:13.170242+0900 0x251      Default     0x0                  100    0    kernelmanagerd: Deleting Preboot content

Any work arounds? Loading kexts on my only M1 is a hard way to develop.

This is still an issue, including on the sonoma release. Snapshot API calls are there, but the ability to load kexts is still missing.

Word is that there now is a work-around, if somewhat complicated. I suspect with a bit more time, it will be streamlined down to something nicer.

No change as of 13.6.6 and 14.4.1 . Some signs that Apple may be moving towards implementing it, but still no 3rd-party kexts. For production deployment of the Virtualization Framework, we'd consider it a must-need.

Can't load KEXT in VMs on M1
 
 
Q