====== 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 83886088388608
* change vcpu and cputune to number of cores you want to use 8
* ProTip: if unsure of your setup. Create fake linux vm and edit gui and then see what XML looks like and copy that.
* change os paths to match custom ovmf location you set in your docker template /mnt/disks/samsung_nvme/system/custom_ovmf/Macinabox_CODE-pure-efi.fd/mnt/disks/samsung_nvme/system/custom_ovmf/Macinabox_VARS-pure-efi.fd
* Change CPU mode line to match above layout... in my case, 8 threads = 4 cores with 2 threads each
* Under Devices: Three disks should look like the following making sure the paths match where those files are
* 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 and