[Support] SpaceinvaderOne - Macinabox


Recommended Posts

On 2/4/2024 at 9:26 AM, iamtim2 said:

So I’m a bit of a unraid noob but been running bare metal and proxmox hackintosh’s for a while now so fairly confident editing plist files and opencore bootloader.

 

Having recently built a new unraid server to replace my creaking and old Synology NAS, I figured I may as well get MacOS running on it as it’s on all the time anyway and I wouldn’t need to flash up my gaming PC/Hackintosh every time I needed to do something.

 

Fast forward, I have unraid running great with loads of dockers etc, and following spaceinvaderone’s excellent tutorials, a fully working Big Sur vm with passed through WiFi card, USB PCI-E card and GPU (RX580)

 

As I’d been running Ventura on Proxmox for ages, I thought I’d tinker with the vm to see if I could get Ventura running. There seems to be no guide out there to show you how to do this and all the searching I did pointed at a couple of Docker options that were limited in functionality. I have skimmed through this thread so apologies if it's already covered! Anyway……a long while later - success

 

My setup is an intel server; Xeon E5 2697 v4 running on an ASUS X99-E WS motherboard with 128GB 2300 ECC memory. There is no reason why an AMD setup shouldn’t also work with a few tweaks. Here’s what I did:

 

1.    I used the ‘backup vm’ app from community applications to backup my BigSur vm

 

2.    I then stopped all PCI-E passthrough to the vm to mitigate any issues with passthrough breaking during the install. There is a bug in the current version of unraid where if you deselect GPU passthrough and go back to VNC, you will get the ‘guest has not initialised the display’ message and won’t be able to do anything. Luckily, I had a copy of the vm xml prior to passing through the GPU and just copied it back to the vm. I then tweaked the cpu cores and memory, reran the mackinabox helper script and that fixed the problem. There is a thread if you search for the no display error that tells you how to fix the xml but it was simpler for me to just copy back the original from the initial BigSur install.

 

3.    I then created a new user script and copied the script content from spaceinvaderone’s helper script. I then changed the custom xml entries that the script injects into the vm xml when run. I got the new values from Nick Sherlocks excellent tutorial on installing Ventura on proxmox: https://www.nicksherlock.com/2022/10/installing-macos-13-ventura-on-proxmox/ This is where you may be able to use the AMD values for CPU arguments if running an AMD CPU. Essentially, I changed my script to use the Intel CPU argument 

echo "<qemu:arg value='host,kvm=on,vendor=GenuineIntel,+invtsc,+hypervisor'/>" | tee --append /tmp/"$XML"4.xml

 

This replaced the old line:

echo "<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'/>" | tee --append /tmp/"$XML"4.xml

 

This then passes the CPU through to the vm and doesn’t do any CPU emulation.

 

4.    I then used Opencore Configurator to mount the EFI partition and delete all the unnecessary kexts (as I’m using a Fenvi T919 WiFi/Bluetooth card that is natively supported in Ventura, I didn’t need all the bluetooth or wifi/broadcom kexts)

 

5.    I updated all the kexts to the latest versions, especially Lilu, Whatevergreen, AppleALC and VirtualSMC. Follow the guide at https://dortania.github.io/OpenCore-Install-Guide/

 

6.    Macinabox uses an old version of opencore (0.7.8) and the latest version is 0.9.7 so next it was time to update opencore and my EFI folder and files. 

 

7.    I downloaded the latest version of opencore from https://github.com/acidanthera/OpenCorePkg/releases

 

8.    I downloaded Propertree plist editor (https://github.com/corpnewt/ProperTree), used propertree to open the config.plsit from the BigSur EFI disk (mount the disk with opencore configurator as shown in spaceinvaderone’s install video). Then open the sample.plist in the Docs folder of the opencore download, place side by side

 

9.    I followed the opencore install guide (I used Intel HEDT/Broadwell-E under the configs sidebar) but follow whichever guide matches your CPU. The thing to bear in mind is I’m passing through the CPU to the vm as ‘host’, so the vm see’s my real CPU not as an emulated Intel ‘Penryn’ CPU in the current BigSur mackinabox vm. The motherboard is obviously emulated but I followed the guide for X99 (my actual motherboard) where motherboard parameters are used and it seemed to work. You may need to tweak slightly?

 

10. There is quite a bit of discrepancy between the Dortania guide and some of the settings in the mackinabox BigSur config.plist so I used the guide as the main reference, changing values where it told me to but where it was a bit ambiguous, I matched the settings from the mackinabox config.plist.

 

11. Once all the edits to the sample.plist was done, I renamed it config.plist and saved it to my desktop. I then followed the guide to build the EFI folder, finally adding the new config.plist once done.

 

12. I then replaced the BigSur EFI folder with the newly constructed EFI folder with the new config.plist and updated kexts and driver files.

 

13. I rebooted the vm to check it all worked and BigSur booted fine but now running on Opencore 0.9.7.

 

14. Next, I opened up a terminal window and used the command 

 

This downloads the latest Ventura install app into your applications folder

 

15. I Then simply went to the downloaded file in applications, double clicked and followed the prompts to install Ventura over the top of Big Sur

 

16. To my complete surprise, it went through the full update with no errors and I was able to boot into Ventura 13.6.4

 

17. I renamed the vm from 'Mackinabox Big Sur' to 'Ventura'. If you use qcow2 in the macinabox docker configuration when creating the initial vm you’ll have a problem when renaming. There is a bug that messes up the disk setting in the xml when renaming a vm, changing it from qcow2 to raw. If you try and now boot, you go straight to a UEFI screen and your boot disk can’t be seen. You need to go into the xml and change the disk type back to qcow2 in the line that starts <driver name=

<devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writeback'/>
      <source file='/mnt/user/domains/BigSur/macos_disk.img'/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>

 

18. I then came across another issue where when passing through the USB, WiFi and RX580 again, I just got a black screen. I checked my settings and they were the same as before so I was a bit stumped. I then compared the original BigSur xml with working passthrough, to the new Ventura xml and noticed that some of the lines had subtly changed for some reason. I replaced all the lines below the second <devices> </disk> entry from the BigSur xml in the Ventura xml. Voila! GPU passthrough now works.

 

19. Any changes from now on, as long as I used the updated helper script are fine and the vm performs fine.

 

20. I used GenSMBIOS (https://github.com/corpnewt/GenSMBIOS) to generate serials etc for an iMAC19,1 mac type and all iMessage services, handoff and Airdrop work fine. The Opencore guide tells you how to do this.

 

There’s an issue with the latest kernel that causes a crash when connecting the WiFi to an encrypted WiFi net (works fine with WiFi with no password) so I can’t connect the WiFi but I’m running hard wired so not an issue for me and all iServices seem to work fine.

 

I did a second update of another macinabox BigSur install to Sonoma and that also works following the guide above but Sonoma has dropped support for Broadcom cards and I had issues with Bluetooth that I couldn't seen to fix even with the OpenCore Legacy Patcher workaround so that was a non-starter for me and Ventura is fine for my needs

 

Hopefully this mini guide will help others to get Ventura (or Sonoma) up and running on unraid.

I was able to install Monterey using spaceinvaders video - but for some reason Ventura or Sonoma will not install. I show it downloading, preparing, the goes to the apple logo with progress but then it boots to boot menu with choice of Macintosh HD, Monterey, Recovery to choose from... I choose Monterey and check version and it's still Monterey

Link to comment

Although I have got Ventura working under Unraid, I wasn't very happy with the performance. The GUI was laggy, I was getting frequent micro pauses with the mouse cursor and UI elements such as scrolling windows and it just generally seemed a bit slow! I also had a couple of lock ups that took the whole server down with it.

 

I love Unraid for the NAS side and docker handling but I'm finding it a bit disappointing as a hypervisor for running VM's

 

A windows 11 VM wasn't that great either.

 

After a bit of investigation I tried a couple of things:

1.  I installed Ventura as a bare metal install and with 128GB RAM and 18 cores, it runs butter smooth, so not a hardware issue but BM is no good as I need the NAS functionality.

2.  I installed proxmox and then installed Ventura as a VM with the same RAM and core count as the VM running under Unraid. As with the Unraid VM, my RX580 is passed through and the VM disk is hosted on an NVME drive. Performance is night and day. Under proxmox, the VM runs very smooth, no glitches or slowdowns and no crashes despite identical settings and hardware passed through.

 

Conclusion, unraid running on my server does not do VM's very well! This is obviously an N of 1 and it might just be me 🙂 

 

I therefore took a different tack and probably off topic in this thread but I now have unraid hosted as a VM in proxmox with my disk controllers passed through along with an Nvidia Quadro p400 for Plex transcoding. As a NAS, it is working really well, and running a 10 disk pool (zfs) and 12 docker containers without a hitch for a week now.

 

Best of all, I'm able to run MacOS Ventura in a proxmox VM at the same time as Unraid with excellent performance. 

Link to comment
5 minutes ago, PicPoc said:

Thank you for the report.

To be sure :

Did you install Promox on unRAID, and install MacOS on Promox ?

 

No, other way around. Proxmox as a bare metal install.

MacOS and Unraid are running alongside each other as VM's under Proxmox

Edited by iamtim2
Link to comment
25 minutes ago, iamtim2 said:

Conclusion, unraid running on my server does not do VM's very well!

Do not take it bad, but it must be something else..both unraid and proxmox use qemu to do virtualization and the host os cannot make such a difference.

Link to comment
On 2/13/2024 at 1:21 PM, DWomack said:

Looking for an annotated user script that will remove all of what Macinabox has touched, so a new macinabox can be created.

 

A script would be much better than touch this, and this, delete this, etc.

 

Maybe the script could remove all VMs and the dockers necessary.

 

Sure I can stumble through all the steps, but a script that always works without mistakes would be much better.

 

Thanks to iamtim2 for posting his guide above.

This seems to work, you guys have comments?

 

I made this an UnRaid User Script:

 

#!/bin/bash
#description=This script completely removes all references to the BigSur_VM
#foregroundOnly=true
#arrayStarted=true
#name=remove_macinabox_BigSur_VM

# Replace "name_of_VM" with the actual name of your VM

echo VM_NAME="Macinabox BigSur"
VM_NAME="Macinabox BigSur"
echo

sleep 2

# Undefine the VM (remove it from libvirt)

echo virsh undefine --nvram "$VM_NAME"
virsh undefine --nvram "$VM_NAME"
echo

sleep 2

# Delete the VM's XML configuration file
# Navigate to the directory where VM XML files are stored
# Usually located at /etc/libvirt/qemu/
# Delete the XML file corresponding to your VM
# For example:

echo ls -la /etc/libvirt/qemu/
ls -la /etc/libvirt/qemu/
echo

# echo rm /etc/libvirt/qemu/"$VM_NAME".xml
# rm /etc/libvirt/qemu/"$VM_NAME".xml
# echo

sleep 2

# Restart the libvirt service
# This step ensures that the changes take effect
# You can restart the entire server or just the libvirt service
#
# For example:
# systemctl restart libvirtd
#
# Or since this is Slackware:
# /etc/rc.d/rc.libvirt restart

echo /etc/rc.d/rc.libvirt restart
/etc/rc.d/rc.libvirt restart
echo

sleep 2

# Optionally, you can also delete the VM's disk image
# Locate the VM disk image and delete it
# For example:
# rm /mnt/user/domains/"$VM_NAME"/disk.img

echo rm -r /mnt/user/domains/"$VM_NAME"
rm -r /mnt/user/domains/"$VM_NAME"
echo

sleep 2

echo rm -r /mnt/user/isos/BigSur-install.img
rm -r /mnt/user/isos/BigSur-install.img
echo

sleep 2

echo rm /mnt/user/system/custom_ovmf/*
rm /mnt/user/system/custom_ovmf/*
echo

sleep 2

# Notify any relevant services or users about the VM removal
# You can customize this part based on your setup
# For example, send a notification using Unraid's built-in notification system:
# /usr/local/emhttp/webGui/scripts/notify -i normal -s "VM $VM_NAME removed"

# Clean up any other associated files or directories as needed

echo rm -r /boot/config/plugins/user.scripts/scripts/1_macinabox_vmready_notify
rm -r /boot/config/plugins/user.scripts/scripts/1_macinabox_vmready_notify
echo

sleep 2

echo rm -r /boot/config/plugins/user.scripts/scripts/1_macinabox_helper
rm -r /boot/config/plugins/user.scripts/scripts/1_macinabox_helper
echo

sleep 2

# Done! The VM traces should now be completely removed.

# Remember to make this script executable:
# chmod +x /path/to/your/script.sh

echo Script complete!

 

Is there a way to script stopping and deleting…

the macinabox docker

the vm

the macinabox docker template

 

If I want to start a fresh, I want to just run a script.  

Edited by DWomack
Added info
Link to comment
10 hours ago, Kev600 said:

I was able to successfully install BigSur! :)
Now - Does this work? 
image.png.9d5e0abfb37cd5054f47703820a41f11.png

The current Macinabox has a very old version of Opencore (0.7.8) so you'll have to upgrade opencore to a much newer version (latest is 0.9.8) and update drivers and kexts. Just trying to apply the update to the newly created Big Sur install will fail.

 

I wrote a basic guide here: https://forums.unraid.net/topic/84601-support-spaceinvaderone-macinabox/?do=findComment&comment=1364505 (previous page) on how I got Ventura working and I also got Sonoma working but Sonoma is much pickier about hardware as Apple has dropped support for quite a lot of legacy hardware in the continuing push with Apple Silicon, especially Broadcom WiFi adapters. There are some workarounds in Sonoma using Opencore Legacy Patcher but these didn't work for me.

 

Mileage will vary depending on hardware, intel or AMD CPU etc, but if BigSur works well for you and any passed through hardware, Ventura will work but Sonoma will probably require quite a lot of fiddling.

  • Like 1
Link to comment
5 hours ago, PicPoc said:

@iamtim2 :

Thank you for this contribution 

Do you have any solution to install macOS without (live) download ? With a macOS IMG like a USB install key ?
...Specialy for poor internet connections.

I don't but there are guides to create a MacOS USB installer. You could create the installer then pass the USB through to the VM. You still need to download the .img in the first place

Link to comment
20 minutes ago, iamtim2 said:

I don't but there are guides to create a MacOS USB installer. You could create the installer then pass the USB through to the VM. You still need to download the .img in the first place

Yep', I know how to create it, but I can't detect "macOS USB installer" to install...

 

Link to comment
8 hours ago, Kev600 said:

Thanks @iamtim2 :)

 

Any idea on the missing sound?

Are you passing through a GPU? If you are, you have to make some edits to the xml to ensure both the graphics and sound portion of the GPU are on the same virtual PCIe slot. Spaceinvaderone has a good tutorial on this in his advanced GPU passthrough video.

 

https://youtu.be/QlTVANDndpM?si=q0MefOd-abbb4wk6

 

I don't know about sound if not passing through hardware but I expect the VM is too laggy to use without it anyway.

Link to comment
On 1/20/2021 at 10:17 AM, WPCom said:

Would anyone know why I can not pass my internet connection through to the mac VMs? I have tried all the diffrent OS installs, and I can not get past the reinstall macOS because it does not propperly pass through nic.

 

Thoughts? or am I missing somthing obvious?

Is there anything new about this yet? I'm trying to install Big Sur and I get the message "An Internet connection is required to install macOS"

I've already tried different variants under the VM's network interface.

Thank you in advance for your help!

Link to comment

Hello everyone , i'm a new user of unraidOS , my graphic card is an RTX 4070 wich isn't compatible with mac os so i use VNC

How am i suposed to get my VM screen on the host screen ?
I mean i can acces to the VM using web interfaces but i would like to get the VM on my graphic card output 

Link to comment

Hello everyone,

I managed to install Big Sur and logged into the cloud and app store also worked.

I also updated Opencore to the latest 0.9.8 and also updated the KEXTE accordingly.

I then installed Ventura, which also worked without any problems!

Now I would like to pass on my GPU as it is useless without video acceleration.

I bought a Radeon Pro WX 4100 a long time ago specifically for this purpose.
 
But I want to run the VM headless most of the time, i.e. remotely, for example. via VNC, Parsec etc.

How do the settings have to be made?

If I simply add the WX 4100 as a second card with a sound card and run the helper script and then start the VM, I only get to the Apple logo and the loading bar only goes up to about 2/5 after that nothing happens.

Can any of you who also use VNC and GPU provide your XML as an example?

 

Thank you!

Link to comment

When try to install Macinabox, I got below error message, can anyone help me. I don't have any problem in installing other dockers or plugin in App Market, I am running 6.12.8

 

///docker run
  -d
  --name='macinabox'
  --net='bridge'
  --privileged=true
  -e TZ="Asia/Shanghai"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Tower"
  -e HOST_CONTAINERNAME="macinabox"
  -e 'flavour'='Big Sur'
  -e 'vminstall'='Auto install'
  -e 'vdisksize'='100G'
  -e 'vdisktype'='raw'
  -e 'opencore'='stock'
  -e 'replaceopencore'='no'
  -e 'overridenic'='no'
  -e 'VMIMAGES'='/mnt/user/domains/'
  -e 'ISOIMAGES'='/mnt/user/isos/'
  -e 'injectfixxml'='yes'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/SpaceinvaderOne/Docker-Templates-Unraid/master/spaceinvaderone/docker_icons/Macinabox.png'
  -v '/mnt/user/domains/':'/domains':'rw'
  -v '/mnt/user/isos/':'/isos':'rw'
  -v '/mnt/user/appdata/macinabox':'/config':'rw'
  -v '/mnt/user/system/custom_ovmf/':'/customovmf/':'rw'
  -v '/boot/config/plugins/user.scripts/scripts':'/userscripts':'rw' 'spaceinvaderone/macinabox'

Unable to find image 'spaceinvaderone/macinabox:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp [2600:1f18:2148:bc02:445d:9ace:d20b:c303]:443: connect: network is unreachable.
See 'docker run --help'.

The command failed.///

Link to comment

Evening all, thanks @SpaceInvaderOne for this vm.

Install went great and running fine, however i cannot get internet working at all, i am not new to bare metal hackintosh but this has me stumped.

I also passed through my intel wifi, and inserted Airportitlm kext and snapshot the config plist (unfortunately with OCC, as propertree will not run on this version of BigSur) and its not showing or enabled.

Any help with this please.

 

Sorted: Macinabox defaults helper script do not work for me but editing the xml with the following has:

 

<interface type='bridge'> <mac address='xx:xx:xx:xx:xx:xx'/> <source bridge='br0'/> <model type='e1000-82545em'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </interface>

Edited by OldManBeard
Problem Solved
Link to comment

Anyone having what I assume is kernel panic issues? 
 

I have other Linux VM’s running without issue but after starting the big sur installer and it's been running for a while the sever crashes as requires a manual reboot. System remains stable until I start this install again 

Link to comment

Macinabox VMs do not show on console.

Installed Macinabox, followed Squid's and chozeur's tutorials, ran into install issues (it just froze at 12 minute mark on install) and had to restart from the beginning .

 

I removed Macinabox Monterey VM through the VM edit tab and then also manually in domains folder.  Then removed Macinabox docker and also removed it from unRAID appdata folders.  I also removed Macinabox docker template by using the "add container" button.

Every time I go to re-install Macinabox, Macinabox shows as a docker, but none of the Monterey or Big Sur VMs show or their files, as did with first install.

What have I messed up?!?!

Edited by RadRom
Link to comment
4 hours ago, RadRom said:

Macinabox VMs do not show on console.

Installed Macinabox, followed Squid's and chozeur's tutorials, ran into install issues (it just froze at 12 minute mark on install) and had to restart from the beginning .

 

I removed Macinabox Monterey VM through the VM edit tab and then also manually in domains folder.  Then removed Macinabox docker and also removed it from unRAID appdata folders.  I also removed Macinabox docker template by using the "add container" button.

Every time I go to re-install Macinabox, Macinabox shows as a docker, but none of the Monterey or Big Sur VMs show or their files, as did with first install.

What have I messed up?!?!

Did you run the vm setup script from the user scripts section? If so what was the output 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.