This is an old revision of the document!
Install MacOS as Unraid Virtual Machine
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).
Preliminary Steps
Clean out all previous failed attempts
delete two helper scripts
remove old macinabox docker
erase appdata/macinabox folder
might be good to clear out old vm files too
If you plan to passthru the 6600xt, you have to do all the install process below on VNC or a GT710/730 and then at the end switch it to the 6600xt. I'll try to point out differences below.
go to Tools → System Devices in unraid to bind passthru devices to VFIO at boot. I also had to tell my bios to NOT use the GPU slot i wanted to passthrough but the more and more i do this, i'm not sure how much of that mattered. Maybe a lot? Maybe not at all?
All this worked for me in legacy mode as that was what my unraid install was already set too. Never tried it in UEFI mode.
Use Macinabox to install Monterey
Operating System Version: Monterey
Install Type: Auto Install
Vdisk Size: 100G (or whatever you want)
Vdisk Type: raw
Opencore stock or custom: stock
Delete and replace Opencore: no
Override default NIC type: no
VM Images Location (x2): wherever you keep it. If not default, you'll need to edit the helper scripts. For me: /mnt/disks/samsung_vm/
Isos Share Location (x2): /mnt/user/isos/
appdata: wherever you keep it. If not default, you'll need to edit the helper scripts. For me: /mnt/disks/samsung_nvme/appdata/macinabox
custom ovmf location (under more settings): wherever you keep it. If not default, you'll need to edit the helper scripts (not sure this one matters because we don't move our NVRAM files initially because we don't use SpaceInvader's helper script once installed… we will, at the end, move the NVRAM and OVMF files to the default locations… and in doing so can set it back to unraid's default OVMF. There appears to be an option now to use unraid's default OVMF files but I have not tested that and just fix it manually later on when I tidy things up). For me: /mnt/disks/samsung_nvme/system/custom_ovmf/
inject helper scripts: Yes
RUN!
Note for Ventura: I don't know if this is required (or even worked correctly) but I manually downloaded the latest OpenCore and tried using the “custom” feature with Macinabox to go straight to the latest OpenCore but I don't think that even did anything/worked/made a difference since I upgraded OpenCore manually anyway before upgrading to Ventura… future installs might answer that.
Finish Creating VM
Go to your user scripts under settings and change the vmready notify script (while [ ! -d ___ ] to match appdata location (if you changed it in step 1 above) then run in background to let you know when ready.
Once the vmready script says you are done downloading… open the helper script and edit the NAME to Macinabox Monterey and the appdata and custom_ovmf locations to the locations that match where you actually have them.
RUN the helper script and your VM should now appear in the VM section as “Macinabox Monterey”
Edit VM
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.
Click on the vm and select edit. Then change to XML view in the top right.
Change memory to whatever you want in both places
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
change vcpu and cputune to number of cores you want to use
<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>
change os paths to match custom ovmf location you set in your docker template
<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>
Change CPU mode line to match above layout… in my case, 8 threads = 4 cores with 2 threads each
<cpu mode='host-passthrough' check='none' migratable='on'>
<topology sockets='1' dies='1' cores='4' threads='2'/>
</cpu>
Under Devices: Three disks should look like the following making sure the paths match where those files are
<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>
Next step is to edit the graphics lines.
If using VNC or installing a 6600xt using VNC… skip this next step. Just continue and future steps will fix the 6600xt.
If using GT710 or GT730 (ie, a GPU supported without needing to change any boot-args):
Erase everything in the <graphics> and <video> tags and add the following block
<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>
change the 0x0b to match whatever unraid says your video card is on (can be found in tools → system Devices).
change the 0x04 to whatever bus is free… 4 was the first open one the XML hadn't used for something else and will likely by fine for you as well.
I also added passthrough Bluetooth controller which unraid said was at 08:00.0, .1, and .3 and that I assigned to 0x05
<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>
I also added passthrough USB controller card that unraid said was at 07:00.0 and that I assigned to 0x06
<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>
I also added passthrough Wi-Fi that unraid said was at 05:00.0 and that I assigned to 0x07
<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>
If passing through an individual mouse and keyboard, use the dummy vm trick and check the boxes for the keyboard and mouse and then copy and paste the appropriate XML code making sure the two busses in the address type lines are not used elsewhere.
SAVE XML and RUN VM!
Install to Virtual Machine
Monterey should now boot to the bootloader either on your VNC viewer or monitor if using the GT710/730
Select macOS Base System. MacOS recovery will start.
Select Disk Utility
Select the correct drive to install on (should match the size of the drive you created)
Select Erase
Give it a Name
Select Erase / Select Done
Quit Disk Utility
Select Reinstall macOS Monterey
Select Continue / Continue / Agree / Agree
Select the disk you named above
Select Continue
MacOS will now install and restart a number of times (4 for me). Select the macOS installer during the first two restarts, and then the name of the disk you created during the next two restarts.
follow Monterey setup steps but don't sign in with Apple ID. we will fix that later.
-
Drag OpenCore Configurator to Applications folder.
Open OpenCore Configurator
Go to Tools → Mount EFI
In the bottom half under EFI Partitions, select the drive (EFI o) and click Mount Partition, put in your password, click Open Partition
A folder should open. Copy the contents to the desktop (Initial installs had two things: EFI and NvVARS… subsequent installs only had the EFI folder)
Unmount that partition
Mount your harddrive (should be the one that has the name you gave it). Open that partition
Copy the file(s) from the desktop into the window that pops up
Delete files on desktop.
UPDATE bootloader: When you opened up OpenCore Configurator it may have told you you were using an older version of boot loader.
While here, lets make smbios
Still in your mounted drive, open EFI/OC/Config.plist
Go to Platform info and next to the “check coverage” button, use the selection list to pick what you want your Mac to “be”
I picked Mac Pro 7,1 (2019) for what it's worth… not sure how much that would affect the rest of this install but i believe i needed this to make my 6600xt work. When i was just using the GT710/730, I selected the Mac Pro Late 2013. I'll be honest, not sure about how much difference this makes but the forums that I used mentioned that the 7,1 worked best for the 6600xt. It also appears to be one of the supported ones for Ventura and maybe higher… but it will require a workaround for a Memory Reporting Issue (see below)
Click the check coverage button to make sure that the serial number it generated for you is not on file… that way Apple services will work since you didn't randomly get an existing Mac Owners number.
Save and close open core window
SHUT DOWN THE VM.
Back on Unraid, edit the XML
change the source file= line on the first disk to be what your actual vm disk is and then erase the other two disks… leaving you with this
<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>
Save changes and start up the VM
update kexts
Open OpenCore Configurator
mount EFI (Tools → Mount EFI → click mount partition next to your drive in bottom section)
open EFI/OC/config.plist
go to Kernel and click on Download/Update kexts
NOTE: it seems with later versions of OpenCoreConfigurator you can use the little icon in the top right to just mount and go straight to your config.plist
select your disk to start up (we will set up auto start to this disk next)
Open OpenCore Configurator
mount EFI (Tools → Mount EFI → click mount partition next to your drive in bottom section)
open EFI/OC/config.plist
go to misc and uncheck show picker
Save and close OpenCore Configurator
Update to Ventura
Once kexts are updated, you should be able to use the appstore Ventura install to update
Open AppStore and search for Ventura and start install process.
Once the computer resets, you want to boot from the new install media drive in the boot picker
It will crash until we fix the xml file of the VM
shut down the vm and edit the xml file in unraid
<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/
Update to Sonoma
After completing all the steps to get a working copy of Ventura… I updated to Sonoma using the Update feature in system preferences.
You can probably follow the steps listed in the above section (Update to Ventura) and just select Sonoma and it will probably upgrade from Monterey to Sonoma… I might check that sometime in the future.
I've been running Sonoma all of 10 minutes now and everything “SEEMS” to work. Will update more as we go!
Wifi seems to cause everything to crash when you select the network tab (may be the same issue that was present in Ventura with having to hard restart the server to get wifi to not radio kill or whatever.
SMB shares are painfully slow to connect / don't work most of the time.
bluetooth doesn't work.
Installing a fresh copy and going straight from Monterey to Sonoma to see if that helps.
Fixes and Tidy Up
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
GPUs
Ultra Wide monitor? (works for Monterey and Ventura and Sonoma)
Apple Login (works for Monterey and Ventura and Sonoma)
-
open it (using same steps as you first used to open OpenCore Configurator) and go to System → Peripherals
Network interfaces should have a en0 but the built in is unchecked (mine was actually checked on future installs so i don't know if the following steps were still required but i did them anyway :D / turns out I had to do this to get Documents and Desktop sync to turn on… or just needed a restart… either way I did it and that fixed that part in Ventura)
open opencore → mount EFI → open config.plist
go to DeviceProperties and select ethernet controller from list of PCI Devices at bottom (if it's not listed already)
click the + on the far bottom right of the right box to add a property to the ethernet controller.
For “key” use: built-in
For “type” use: Data
For “value” use: 01
save and reboot
log in to apple services!
The hackintool technically isn't needed but it provides an easy graphical way to see if that “built-in” check box is checked.
Intel Bluetooth (only follow these steps for an Intel based Bluetooth card) (works for Monterey and Ventura)
-
-
-
unzip all
open opencore → mount EFI → Mount Partition → Open Partition → Go to OC folder
copy IntelBTPatcher.kext and IntelBluetoothFirmware.kext from IntelBluetooth zip file into Kext folder
copy BlueToolFixup.kext from BrcmPatchRAM zip file into Kext folder
copy Lilu.kext from Lilu-1.6.2 zip file into Kext folder
open config.plist → go to Kernel
drag from Kexts folder the .kext files that are NOT in the list under Kernel.
Put IntelBTPatcher above IntelBluetoothFirmware above BlueToolFixup
Uncheck all the rest of the BCRM ones (not using them… i'm using Intel)
Save, reboot, profit.
Intel Wireless (works for Monterey and Ventura until the VM is rebooted… then requires server reboot and will work again until VM rebooted… still working on this one. Sonoma seems to suffer similar issues as Ventura but instead of just not working, it crashes the computer when clicking on “network” in settings.)
-
Unzip folder
open opencore → mount EFI → Mount Partition → Open Partition → Go to OC folder
copy Airportitlwm.kext from zip into Kext folder
open config.plist → go to Kernel
drag from Kexts folder the airportitlwm.kext file in the list under Kernel.
I put it all the way to the bottom.
Go to Misc → Security
Change SecureBootModel to Default
Save → Shutdown
Update VM xml file to passthru the wifi card
<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>
Profit
Fix Memory Modules Misconfigured warning (suppress it) (only required when using Ventura and Sonoma with MacPro7,1)
-
Open OpenCore Configurator and go to Kernel
Go to Download/Update kexts and drag the RestrictEvents.kext file into that window.
Not sure of proper position in the list but I moved it to bottom
Go to NVRAM then UUID (at bottom of list) then boot-args
Add “revpatch=pci revblock=pci” to the list of boot-args
Go to PlatformInfo → DataHub - Generic and check the “AdviseFeatures” block
Save and reboot.
Move VM disks
This one is easy and just puts my mind at ease to create future Mac VMs without overwriting data AND to make everything look the same in my vms folder.
copy the vm folder that contains your macos_disk.img file to it's new name.
cp -r Macinabox\ Monterey/ monterey/
make sure you edit the xml file to point to the new location.
you can also change permissions to match other folders and edit groups and users.
Move NVRAM to normal location.
Point OVMF to normal location.
For this one, you can copy your custom one into the default folder.
cp Macinabox_CODE-pure-efi-fd /usr/share/qemu/ovmf-x64/
OR you can do what I did and use the one that is already in there (unraid's default one) and just follow the next step (make sure you get the one that is the same size).
make sure you edit the xml file to point to the new location.
csr-active-config