MacOS Monterey as VM on TrueNAS Scale

Joined
Nov 16, 2023
Messages
5
Alright I am installing Big Sur on Treunas as we speak Hopefully it works but it should at this point.
Wrting this now so I don't forget. Thanks for @Straafe for sharing this CLI settings.
(I will try ventura later but Big Sur is what was recommended by the script). I am on a Dell R320 with Xeon e5-2470v2 server.

So I simply create a VM via the GUI, don't start it yet
- use Linux as the Guest Operating System and
- create a new ZVOL for the main disk of 64 GB (min 50GB, I Believe)
- use UEFI boot method
- I added a install image in the GUI but this did not work initially

Then go to devices in the Truenas GUIO for the VM and add both the
- BaseSystem.img and OpenCore-v20.iso as RAW files of AHCI type
- you can remove the CDroms but keep the DISK/ZVTOL you created in the GUI

Then use CLI
in GUI open Shell of Truenas then change the settings of the machine (see earlier comment) the following:
NO # or ' should be present.
1700354036043.png



You should be able to boot into Macintosh recovery.
Now use disk manager to "erase" (really format but never understood Macintosh's naming scheme)
I used the standard options.
GUID partition, APFS and the other standard one.
 

RodyMcAmp

Contributor
Joined
Sep 18, 2014
Messages
102
This might be the way to go for the new beeper mini. I will be trying to piece this together this weekend. I have had this running before but under ESXi.
 

troonas

Dabbler
Joined
Dec 9, 2021
Messages
26
This might be the way to go for the new beeper mini. I will be trying to piece this together this weekend. I have had this running before but under ESXi.
Yep, I use it to run the mautrix-imessage matrix bridge. The dev says they’ve got a new bridge that just uses APIs directly without needing a mac, but it isn’t open source yet. It will be eventually, but no timeline yet.
 
Joined
Nov 16, 2023
Messages
5
Hi all, little follow up as I do this a second time, this time with Ventura, first one was with Big Sur:
If you are getting permission denied to access the opencore.iso, you want to check permissions of libvirt-qemu user. i had to add "builtin_users" to "Auxiliary Groups" for the user before it launched. see link:

You also NEED to select CPU as Penryn, not qemu32.
edit:
none of this worked, so take it with a grain of salt
 
Last edited:
Joined
Nov 16, 2023
Messages
5
Also, here is the CLI information in text format so it can be copied directly instead of copied off a screenshot:
all the white spaces matter here. first line is not indented, everything after that is 1 space in.

command_line_args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
-smbios type=2 -device '{"driver":"usb-kbd","id":"input1","bus":"usb.0","port":"2"}'
-global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
-cpu Penryn,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+fma4,+bmil,+bmi2,+xsave,+xsaveopt,+rdrand,check

This isn't working just yet. I am now stuck on the apple logo when selecting the install. Will update as I go.
 
Last edited:

marshes

Cadet
Joined
Jun 25, 2023
Messages
4
I'm also trying to spin up a MacOS VM on Cobia. I'm also hung on the Apple logo, trying a few different combos to see if I can get the installer to start.
 

marshes

Cadet
Joined
Jun 25, 2023
Messages
4
edit: was able to get Ventura to boot and seems to be stable. The install process seemed pretty straight forward, except the installer wouldn't reboot the VM automatically (anyone know why?). So each time the installer seemed to freeze, I just shut it down, started it back up and selected the newly created disk. Had to do this maybe 4 times throughout the process. I also used the full img for Ventura created from Nick's OSX-KVM github.

The config I got working for my system is as follows:

Code:
# command_line_args: -cpu Haswell-noTSX,kvm=on,vendor=GenuineIntel,+invtsc,+hypervisor,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check 
#   -usb -device usb-kbd -device usb-tablet -device '{"driver":"usb-kbd","id":"input1","bus":"usb.0","port":"2"}'                                                   
#   -global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off                                                                         
#   -device isa-applesmc,osk="SECREToskOMITTED"                                                                     
#   -smbios type=2    


I had to omit machine: q35 as I couldn't get the VM to boot with that config in and couldn't figure out an args combo that would work.

This is now running on TrueNas Scale Cobia / 23.10.1

HW is AMD Ryzen 5 PRO 5650GE with Radeon Graphics w/ 64 GiB of ram.

Next up, I want to see if I can connect to this VM directly outside of TrueNas's web UI. That's also something new to me, and could use some guidance on how to set that up. I just setup realVNC which I used a long time ago, and will do what I want.

Screen Shot 2024-01-01 at 10.58.50 AM.png
 
Last edited:
Joined
Nov 16, 2023
Messages
5
edit: was able to get Ventura to boot and seems to be stable. The install process seemed pretty straight forward, except the installer wouldn't reboot the VM automatically (anyone know why?). So each time the installer seemed to free, I just shut it down, started it back up and selected the newly created disk. Had to do this maybe 4 times throughout the process. I also used the full img for Ventura created from Nick's OSX-KVM github.

The config I got working for my system is as follows:
Glag its working. Im not having any luck with a large combo of arguments. I also rebuilt all my images. and I moved to using the OSK-KVM image. Im not sure what I did the first time but at this point Im still stuck on the boot screen. I've rebuilt the machine a few times as well. Im not sure what Im missing... I'll give this a few more tries later....

Ok Its working. The arguments seemed to have been a red herring.
Turns out my RAM/CPU settings were too aggressive?
NOT Working:
1 VCPU , 8 cores, 2 threads, 16G Ram, 12G Ram min
Working:
1 VCPU , 6 cores, 2 threads, 12G Ram, 6G Ram min
 
Last edited:

Nicholas Flamy

Dabbler
Joined
Feb 25, 2023
Messages
28
I am getting this error when starting.

This is when I have the command line argument as host. If I set it to Haswell-noTSX or Penryn both do the same thing.
 

Attachments

  • Screenshot_20240110_125551_Chrome.jpg
    Screenshot_20240110_125551_Chrome.jpg
    75.1 KB · Views: 54
  • Screenshot_20240110_125516_Termius.jpg
    Screenshot_20240110_125516_Termius.jpg
    98 KB · Views: 38
  • Screenshot_20240110_125452_Termius.jpg
    Screenshot_20240110_125452_Termius.jpg
    97.7 KB · Views: 37
  • Screenshot_20240110_125421_Termius.jpg
    Screenshot_20240110_125421_Termius.jpg
    100.1 KB · Views: 35
  • Screenshot_20240110_125115_Chrome.jpg
    Screenshot_20240110_125115_Chrome.jpg
    80.6 KB · Views: 53

Nicholas Flamy

Dabbler
Joined
Feb 25, 2023
Messages
28
I am getting this error when starting.

This is when I have the command line argument as host. If I set it to Haswell-noTSX or Penryn both do the same thing.
Holy crap, it was just that it didn't like that order.

THIS WORKED:
edit: was able to get Ventura to boot and seems to be stable. The install process seemed pretty straight forward, except the installer wouldn't reboot the VM automatically (anyone know why?). So each time the installer seemed to free, I just shut it down, started it back up and selected the newly created disk. Had to do this maybe 4 times throughout the process. I also used the full img for Ventura created from Nick's OSX-KVM github.

The config I got working for my system is as follows:

Code:
# command_line_args: -cpu Haswell-noTSX,kvm=on,vendor=GenuineIntel,+invtsc,+hypervisor,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check 
#   -usb -device usb-kbd -device usb-tablet -device '{"driver":"usb-kbd","id":"input1","bus":"usb.0","port":"2"}'                                                   
#   -global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off                                                                         
#   -device isa-applesmc,osk="SECREToskOMITTED"                                                                     
#   -smbios type=2    


I had to omit machine: q35 as I couldn't get the VM to boot with that config in and couldn't figure out an args combo that would work.

This is now running on TrueNas Scale Cobia / 23.10.1

HW is AMD Ryzen 5 PRO 5650GE with Radeon Graphics w/ 64 GiB of ram.

Next up, I want to see if I can connect to this VM directly outside of TrueNas's web UI. That's also something new to me, and could use some guidance on how to set that up. I just setup realVNC which I used a long time ago, and will do what I want.
 

Nicholas Flamy

Dabbler
Joined
Feb 25, 2023
Messages
28
Should I make a YouTube video going through the steps or will it draw attention from Apple and be a bad idea? I just deleted the VM and the images and did it all again successfully, so it is reproducible.
 

Kailee71

Contributor
Joined
Jul 8, 2018
Messages
110
Why not do a step-by-step, numbered, right here? Youtube vids are hard work to pause-play while you play along. Much better to just have a simple 1-2-3 recipe here, no?

K.
 

Nicholas Flamy

Dabbler
Joined
Feb 25, 2023
Messages
28
Why not do a step-by-step, numbered, right here? Youtube vids are hard work to pause-play while you play along. Much better to just have a simple 1-2-3 recipe here, no?

K.
Personally, when following a written guide, I often find problems where I'm not sure about something like the indentation or the exact location of stuff, so I like videos because it helps me confirm things like where exactly does something need to go and how much indentation and what should I expect from every step. And to type super detailed about it may take longer than if I just make a video about it and explain everything I know about each step.
 

Nicholas Flamy

Dabbler
Joined
Feb 25, 2023
Messages
28
Personally, when following a written guide, I often find problems where I'm not sure about something like the indentation or the exact location of stuff, so I like videos because it helps me confirm things like where exactly does something need to go and how much indentation and what should I expect from every step. And to type super detailed about it may take longer than if I just make a video about it and explain everything I know about each step.
Anyone who knows their stuff well enough already has all the written resources, but for someone like me, a video guide is perfect as I'm not as experience with this. This is actually the first time I'm setting up a VM (other than my failed attempt at setting up a Minecraft server OS) which is probably a bad idea that I started with one of the most difficult things to create a VM of (MacOS Sonoma) rather than starting with some Linux distribution just to learn how it works, but hey, I have a working MacOS VM. All I need to do now is fix up my AppleID.
 

Nicholas Flamy

Dabbler
Joined
Feb 25, 2023
Messages
28
Anyone who knows their stuff well enough already has all the written resources, but for someone like me, a video guide is perfect as I'm not as experience with this. This is actually the first time I'm setting up a VM (other than my failed attempt at setting up a Minecraft server OS) which is probably a bad idea that I started with one of the most difficult things to create a VM of (MacOS Sonoma) rather than starting with some Linux distribution just to learn how it works, but hey, I have a working MacOS VM. All I need to do now is fix up my AppleID.
Sorry that I'm making a chain of comments, but I wanted to add, I'm a visual and hands-on learner so seeing it be done and/or trying things until it works and learning this way is what usually works for me so for anyone out there like me I think the video would help.
 

eseanq

Dabbler
Joined
Mar 25, 2019
Messages
39
I'm also trying to spin up a MacOS VM on Cobia. I'm also hung on the Apple logo, trying a few different combos to see if I can get the installer to start.
I'm also hung up at this part. I'm guessing I need to edit the config files? Not quite sure how to do that though
 

Nicholas Flamy

Dabbler
Joined
Feb 25, 2023
Messages
28
I'm also hung up at this part. I'm guessing I need to edit the config files? Not quite sure how to do that though
Did you edit the TrueNAS config?



Edit 1:
You start by going to TrueNAS shell, then enter the CLI:
`sudo cli`

Then we'll first get to the vm service:
`service vm`

Then check what VMs you have, we need the id, if this is the first ever vm created on the machine it will be 1 I think:
`query`

Then now that we have the id we cane edit the config (I put the number pne for this command, if your id for your MacOS VM is different then put that number instead):
`update 1`

Now you'll be in the text editor. Look around this topic and you'll find the info you need. I can provide more if you need it. Also, you have to delete the hashtags in front of whatever you change for it to save. Then hit escape and then select yes to save and hit enter.


Edit 2:
So in my screenshots I blurred out the osk. It's the same for every Mac so Google how to find it, it can be found anywhere, technically Apple could get mad about it being shared so that's why I redacted it.

Here's what worked for me:
```
command_line_args: -device isa-applesmc,osk="<redacted>"
-smbios type=2 -device '{"driver":"usb-kbd","id":"input1","bus":"usb.0","port":"2"}'
-global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
-cpu Haswell-noTSX,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc
```

I took some example screenshots:
(Notice in the screenshots I deleted the hashtags to edit the config. I hit backspace 3 times for each one, deleting 2 spaces and the hashtag. Not sure if deleting the two spaces is necessary but doing this every time has worked every time for editing this correctly.)
 
Last edited:

eseanq

Dabbler
Joined
Mar 25, 2019
Messages
39
Did you edit the TrueNAS config?




You start by going to TrueNAS shell, then enter the CLI:
`sudo cli`

Then we'll first get to the vm service:
`service vm`

Then check what VMs you have, we need the id, if this is the first ever vm created on the machine it will be 1 I think:
`query`

Then now that we have the id we cane edit the config (I put the number pne for this command, if your id for your MacOS VM is different then put that number instead):
`update 1`

Now you'll be in the text editor. Look around this topic and you'll find the info you need. I can provide more if you need it. Also, you have to delete the hashtags in front of whatever you change for it to save. Then hit escape and then select yes to save and hit enter.
Ah yeah, I seemed to overlook that post. I was able to edit the config and I tried a few combinations that have been scattered in these posts as well as what was listed on Nicks. Some combinations allow me to save the file, but once I go back into it to check none of the edits are saved.
 

Nicholas Flamy

Dabbler
Joined
Feb 25, 2023
Messages
28
Ah yeah, I seemed to overlook that post. I was able to edit the config and I tried a few combinations that have been scattered in these posts as well as what was listed on Nicks. Some combinations allow me to save the file, but once I go back into it to check none of the edits are saved.
2 things:
Did you delete the hastags?
Did you hit escape, and then use the arrow yes to select Yes, and hit enter?
 

eseanq

Dabbler
Joined
Mar 25, 2019
Messages
39

Attachments

  • Screen Shot 2024-02-03 at 4.47.03 PM.png
    Screen Shot 2024-02-03 at 4.47.03 PM.png
    481.1 KB · Views: 35
  • Screen Shot 2024-02-03 at 4.47.09 PM.png
    Screen Shot 2024-02-03 at 4.47.09 PM.png
    498.2 KB · Views: 33
  • Screen Shot 2024-02-03 at 4.47.16 PM.png
    Screen Shot 2024-02-03 at 4.47.16 PM.png
    453.7 KB · Views: 35
Top