Proxmox Mac Mini Cluster nested virt bug workaround

May 25, 2018
1
0
15
46
We have a cluster of six Mac Minis in a build farm that's used for doing macOS builds in ephemeral single-use macOS guest VMs. Apple only lets you run two macOS guests at a time, but Mac Minis are super overpowered for this task, so we have lots of extra capacity. So I thought: now that PVE supports arm64, why not _also_ run Proxmox PVE as Linux guests (which have no Apple macOS limit!) alongside our macOS guests so we can run a Ceph cluster and Linux guests easily, etc?

It works pretty well! Almost. To do nested virtualization, you need an M3 or newer chip.

When I first tried it, I used proxmox-kernel-6.17 (6.17.13-1-pve) which worked great.

But anything newer than Linux 6.17 then failed, due to changes in the Linux kernel.

I asked my hard-working friend Claude to bisect which Linux kernel patch broke Promox but over-eager Claude went ahead and "fixed" Linux instead, which I then (with great ambivalence) finally relented and sent to the Linux kernel mailing list.

But the Linux kernel people informed me that it's a known Apple bug in macOS and they don't want to carry hacks to work around it. But there's a workaround: kvm-arm.vgic_v3_group1_trap=1. But that slows things down (a bit) and it might be unnecessary in the future if/when Apple fixes it.

So here's a Debian package you can install on your arm64 Proxmox nodes running on Apple Silicon to conditionally set the kernel parameter if and only if it's detected that you need it: https://github.com/bradfitz/pve-on-macos-nested-virt-fix

Linux kernel thread is linked from that repo.

Hope this helps somebody else!
- Brad