This will guide you through the setup of an OSX machine as an Unraid Virtual Machine using macinabox. This guide will start you off with Monterey (since that is the last currently support OS from macinabox) and then give you the optional steps to upgrade to Ventura. I'm working to see if the same steps work for upgrading to Sonoma. Currently I have GPU passthrough working with a GeForce GT-710 (Monterey), GeForce GT-730 (Monterey), and AMD Radeon 6600 XT (Monterey and Ventura). I also have Intel Bluetooth and Intel Wireless passthrough working (Monterey and Ventura).
From here on out… only edit xml by hand*** NEVER update or save changes using the vm GUI… it will break. It broke my gpu passthru editing the form and then running the helper script each time. I'm sure it was something i messed up… but custom xml editing worked like a charm for me and eliminated all my problems! JUST DON'T MESS WITH IT IF YOU'VE BEEN HAVING PROBLEMS.
<memory unit='KiB'>8388608</memory> <currentMemory unit='KiB'>8388608</currentMemory>
<vcpu placement='static'>8</vcpu>
<cputune>
<vcpupin vcpu='0' cpuset='4'/>
<vcpupin vcpu='1' cpuset='12'/>
<vcpupin vcpu='2' cpuset='5'/>
<vcpupin vcpu='3' cpuset='13'/>
<vcpupin vcpu='4' cpuset='6'/>
<vcpupin vcpu='5' cpuset='14'/>
<vcpupin vcpu='6' cpuset='7'/>
<vcpupin vcpu='7' cpuset='15'/>
</cputune>
<loader readonly='yes' type='pflash'>/mnt/disks/samsung_nvme/system/custom_ovmf/Macinabox_CODE-pure-efi.fd</loader>
<nvram>/mnt/disks/samsung_nvme/system/custom_ovmf/Macinabox_VARS-pure-efi.fd</nvram>
<cpu mode='host-passthrough' check='none' migratable='on'>
<topology sockets='1' dies='1' cores='4' threads='2'/>
</cpu>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source file='/mnt/disks/samsung_nvme/vms/Macinabox Monterey/Monterey-opencore.img'/>
<target dev='hdc' bus='sata'/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source file='/mnt/user/isos/Monterey-install.img'/>
<target dev='hdd' bus='sata'/>
<address type='drive' controller='0' bus='0' target='0' unit='3'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source file='/mnt/disks/samsung_nvme/vms/Macinabox Monterey/macos_disk.img'/>
<target dev='hde' bus='sata'/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</disk>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x0b' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0' multifunction='on'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x0b' slot='0x00' function='0x1'/>
</source>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x1'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0' multifunction='on'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x08' slot='0x00' function='0x1'/>
</source>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x1'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x08' slot='0x00' function='0x3'/>
</source>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x3'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</hostdev>
Monterey should now boot to the bootloader either on your VNC viewer or monitor if using the GT710/730
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source file='/mnt/disks/samsung_nvme/vms/Macinabox Monterey/macos_disk.img'/>
<target dev='hdc' bus='sata'/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
</disk>
<qemu:commandline>
<qemu:arg value='-usb'/>
<qemu:arg value='-device'/>
<qemu:arg value='usb-kbd,bus=usb-bus.0'/>
<qemu:arg value='-device'/>
<qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='type=2'/>
<qemu:arg value='-cpu'/>
<qemu:arg value='Penryn,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+fma4,+bmi1,+bmi2,+xsave,+xsaveopt,+rdrand,check'/>
</qemu:commandline>
to
<qemu:commandline>
<qemu:arg value='-usb'/>
<qemu:arg value='-device'/>
<qemu:arg value='usb-kbd,bus=usb-bus.0'/>
<qemu:arg value='-device'/>
<qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='type=2'/>
<qemu:arg value='-cpu'/>
<qemu:arg value='host,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on'/>
<qemu:arg value='-global'/>
<qemu:arg value='ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'/>
<qemu:arg value='-global'/>
<qemu:arg value='nec-usb-xhci.msi=off'/>
</qemu:commandline>
<qemu:arg value='-cpu'/>
<qemu:arg value='host,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on'/>
to
<qemu:arg value='-cpu'/>
<qemu:arg value='Haswell-noTSX,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on'/>
Links: https://github.com/thenickdude/KVM-Opencore/issues/47, https://www.nicksherlock.com/2022/10/installing-macos-13-ventura-on-proxmox/
Some of these may not apply to you but here's what I had to do to fix certain things as well as some things I did to tidy up my install
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</hostdev>
cp -r Macinabox\ Monterey/ monterey/
cp Macinabox_VARS-pure-efi.fd /etc/libvirt/qemu/nvram/the-vms-UUID-number-here_VARS-pure-efi.fd
cp Macinabox_CODE-pure-efi-fd /usr/share/qemu/ovmf-x64/