** Hackintosh ** Tips to make a bare metal MacOS


Recommended Posts

I think we successfully confused @ghost82

😀

 

- I am running Monterey - my issue now is rebooting the VM , freezes up the unraid server. I have attached some logs from Unraid and Monterey showing the freeze. Couldn't capture much though. Out of ideas for now. I'm running 6.10-RC too. My EFI is 0.7.2

 

My issue is not too urgent. Take a look when you can spare some time. 

Edited by ab5g
Link to comment

@paulmorabi

A lot of errors in the config.plist :)

When you update the bootloader you should always check the config.plist for added/removed entries, and before rebooting, always use ocvalidate to validate the config.plist.

Here was your config.plist verified by ocvalidate:

plist.png.23ed87ff7458b264da4cfa324fb24515.png

 

Try the efi I sent in pm and let me know.

All is updated and config.plist is fixed-

Edited by ghost82
  • Like 1
Link to comment
43 minutes ago, ghost82 said:

@paulmorabi

A lot of errors in the config.plist :)

When you update the bootloader you should always check the config.plist for added/removed entries, and before rebooting, always use ocvalidate to validate the config.plist.

Here was your config.plist verified by ocvalidate:

plist.png.23ed87ff7458b264da4cfa324fb24515.png

 

Try the efi I sent in pm and let me know.

All is updated and config.plist is fixed-

Thank you so much for this. Normally I read the release notes and look at the section for breaking changes but otherwise leave as is (I thought, mistakenly, this would be OK).

 

I have replaced the entire EFI with the one you sent me. It's still freezing on startup.

 

Link to comment
36 minutes ago, ghost82 said:

Oh sorry guys, my bad!! some headache here and I confused :D

The efi I sent for @paulmorabi is ok.

 

@ab5g all I can say is that this may be related to the beta os you are running, we are still at beta 4, I didn't try yet monterey..did you have the same issue with older os (big sur/catalina)?

 

Yeah same issue with BigSur as well. It does not look like anything to do with the OS though. I have tried different unraid versions and different BIOS for the Motherboard - so far the issue doesn't seem to go away. At my wits end !

 

Link to comment
1 minute ago, paulmorabi said:

I have replaced the entire EFI with the one you sent me. It's still freezing on startup.

Try this:

mount the efi, open the config.plist and change "target" to 67.

Reboot and it will freeze

Force shutdown the vm, remount the efi and you will find a log file in the EFI folder: send it to me in pm

Link to comment
14 minutes ago, ghost82 said:

I have no idea...does it freeze really randomly?

Anything useful in the syslog in the unraid diagnostic when it freezes?

 

No - the unraid system freezes only when I shut down the Mac VM. I did provide some logs in the previous page. Nothing on it though. 

  • Like 1
Link to comment
6 minutes ago, ghost82 said:

Shutdown or reboot?Or both?

Sorry if it was already replied, but everytime or random?

 

Maybe related to amd gpu reset bug?Does it shutdown/reboot ok without passing through the gpu?

 

shutdown and reboot both. Doesn't happen often though. It happens only when the VM has been running for a while. I gave up on it for a month in frustration. I've started testing it again - will try to eliminate the possibilities. Thanks for the reply !

Link to comment
  • 2 weeks later...

@ghost82 - I realised one more thing . Some of the instability in the system (sleep/wake) was because I deleted a number of unused controllers which caused the PCIe Device Paths to change.  My config.plist Device properties were referencing the older Device Paths and causing a lock-up / devices not detected after sleep.  After cleaning up - it sleep/wake issues have disappeared. 

 

I am still testing for Unraid hanging on shutting down the VM. It seems to be the reset bug on AMD.I did try the vendor_reset plugin on 6.10-RC1 and ti didn't seem to help. I will try a few other stuff and update you.

 

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

@ghost82 - I realised one more thing . Some of the instability in the system (sleep/wake) was because I deleted a number of unused controllers which caused the PCIe Device Paths to change.  My config.plist Device properties were referencing the older Device Paths and causing a lock-up / devices not detected after sleep.  After cleaning up - it sleep/wake issues have disappeared.

 

 

Just a quick question : do you also put your Unraid to sleep while your VM is also at sleep ? Because that's the one (main) thing I can't solve on my system : Putting macOS to sleep, unraid to sleep, waking up Unraid, then waiking up macOS without it crashing after a few minutes...

If I don't put Unraid to sleep, then the sleep function (pmset 25) of my macOS works just fine.

 

And because the crash after waking up macOS occurs randomly (it can work for for many minutes or crash instantly) I do not know how to begin to search for the problem.. (on the Unraid side or on the VM side...).

 

And should it even work ? (putting the server and the vm to sleep at the same time).

Link to comment
3 minutes ago, bjornatic said:

 

Just a quick question : do you also put your Unraid to sleep while your VM is also at sleep ? Because that's the one (main) thing I can't solve on my system : Putting macOS to sleep, unraid to sleep, waking up Unraid, then waiking up macOS without it crashing after a few minutes...

If I don't put Unraid to sleep, then the sleep function (pmset 25) of my macOS works just fine.

 

And because the crash after waking up macOS occurs randomly (it can work for for many minutes or crash instantly) I do not know how to begin to search for the problem.. (on the Unraid side or on the VM side...).

 

And should it even work ? (putting the server and the vm to sleep at the same time).

 

I don't put the unraid to sleep while the macOS is sleeping. I don't think it would work - its too much to handle I guess. 

I will give it a try in a weeks time and come back to you . BTW what GPU / Motherboard/ CPU and the System Definition are you using ?

 

Link to comment

Nvidia GT 710 / ASUS TUF GAMING X570 / AMD Ryzen 7 2700X - MacPro6,1

 

Everything is passed trough : GPU, 4 Cores, USB controller, and Nvme SSD Controller.

 

And I use hibernatemode 25, which is the most stable but also leeds to a crash enventually.

 

When you say "it's too much to handle", I have the exact same opinion but I'm stubborn and I'm wondering two thing :

- is it working for someone ?

- how to investigate properly the issue ? (because I have no clue)

Link to comment
20 hours ago, bjornatic said:

Nvidia GT 710 / ASUS TUF GAMING X570 / AMD Ryzen 7 2700X - MacPro6,1

 

Everything is passed trough : GPU, 4 Cores, USB controller, and Nvme SSD Controller.

 

And I use hibernatemode 25, which is the most stable but also leeds to a crash enventually.

 

When you say "it's too much to handle", I have the exact same opinion but I'm stubborn and I'm wondering two thing :

- is it working for someone ?

- how to investigate properly the issue ? (because I have no clue)

What OS are you on ? I have dual displays and using a Rx560 - so every-time I reboot the VM I hit the AMD reset bug. The whole system freezes and I have to reboot the Unraid server. I wish I could solve this then perhaps move to what you want to achieve.

Link to comment
1 hour ago, ab5g said:

Noob question - what do you do with these and why is the update important ?

 

OVMF is the bios of our uefi virtual machines: it consists of 2 parts: OVMF_CODE, which is the code of the bios and OVMF_VARS, which is a file where uefi variables are stored.

If you look at your xml template you will find where these 2 files are stored on your pc.

OVMF is updated by edk2 every 3 months, it's like a bios update.

Edited by ghost82
  • Thanks 1
Link to comment

Starting from Monterey beta 5 there's a new issue, which still needs to be solved in opencore.

Update: the issue is server side, it seems that all the smbios with the VMM flag will not get the update with Monterey (Apple, this is odd!!!!) and also smbios with T2 chip; developers are at work.

 

On some SMBIOS, in particular that having a T2 chip, including iMacPro1,1, the OTA delta update will not show; workaround is to download the full installer and upgrade from there.

This will probably not change in next betas and 12.0 release.

More info here:

https://github.com/acidanthera/bugtracker/issues/1769

https://github.com/dortania/OpenCore-Legacy-Patcher/issues/471

Edited by ghost82
  • Thanks 1
Link to comment

I’ll leave it here in case someone runs into the issue - Unassigned devices and NTFS does not play well. So if you have your disk file on a SSD that is NTFS formatted - you’ll get terrible speeds in the macOS VM - spinning beach ball everywhere.  I tore my hair trying to find out the cause of the issue until finally formatting the disk to XFS and restoring the img file to it solved it.

 

 

  • Like 1
Link to comment
On 8/26/2021 at 3:29 PM, ab5g said:

What OS are you on ? I have dual displays and using a Rx560 - so every-time I reboot the VM I hit the AMD reset bug. The whole system freezes and I have to reboot the Unraid server. I wish I could solve this then perhaps move to what you want to achieve.

 

For those suffering issues during restart/shutdown, I can share what worked for me.

 

In config.plist, under NVRAM > boot-args, add 

vti=12

(in reality, you can pick any number you want)

 

VTI is a multiplier the macOS kernel uses to extend the allowable timeout when waiting for cores to synchronise, when running in a virtual machine (this is an oversimplification, but conveys the idea). This isn't needed when running on bare metal, as the kernel can reasonably expect all cores to behave (relatively) predictably. As our VMs are sharing CPU resources with the host, this assumption doesn't hold, so we can extend the allowable time before the macOS kernel panics. Nice that it's built in, too.

 

The number you choose represents the number of times to multiply the default by two (binary left-shifts). Don't set the number too large (<<32), or it will eventually overflow (and cause the effective value to be zero – worse than the default).

 

See here for where I found this solution originally, with more technical details: https://www.nicksherlock.com/2020/08/solving-macos-vm-kernel-panics-on-heavily-loaded-proxmox-qemu-kvm-servers/

 

This resolved all of my occasional panics both during use of the VM day-to-day, and during shutdown/restart of the VM. I think that on my machine, these panics were causing my PCIe devices (GPU [RX580] & USB [ASM3142]) to be left in some undefined state – in turn causing crashes of the Unraid host. Very occasionally, the hardware would detect this (PCIe bus error warnings from iDrac) allowing Unraid to keep working, but would require a full restart to reset the devices and restore the bus. 

 

Good luck!

Edited by ofawx
typo
  • Like 1
  • Thanks 1
Link to comment
17 hours ago, ofawx said:

 

For those suffering issues during restart/shutdown, I can share what worked for me.

 

In config.plist, under NVRAM > boot-args, add 

vti=12

(in reality, you can pick any number you want)

 

VTI is a multiplier the macOS kernel uses to extend the allowable timeout when waiting for cores to synchronise, when running in a virtual machine (this is an oversimplification, but conveys the idea). This isn't needed when running on bare metal, as the kernel can reasonably expect all cores to behave (relatively) predictably. As our VMs are sharing CPU resources with the host, this assumption doesn't hold, so we can extend the allowable time before the macOS kernel panics. Nice that it's built in, too.

 

The number you choose represents the number of times to multiply the default by two (binary left-shifts). Don't set the number too large (<<32), or it will eventually overflow (and cause the effective value to be zero – worse than the default).

 

See here for where I found this solution originally, with more technical details: https://www.nicksherlock.com/2020/08/solving-macos-vm-kernel-panics-on-heavily-loaded-proxmox-qemu-kvm-servers/

 

This resolved all of my occasional panics both during use of the VM day-to-day, and during shutdown/restart of the VM. I think that on my machine, these panics were causing my PCIe devices (GPU [RX580] & USB [ASM3142]) to be left in some undefined state – in turn causing crashes of the Unraid host. Very occasionally, the hardware would detect this (PCIe bus error warnings from iDrac) allowing Unraid to keep working, but would require a full restart to reset the devices and restore the bus. 

 

Good luck!

 

Thank you for the suggestion. I will give it a go soon. For now I have isolated the CPU's that are used by the MacOS VM and I haven't seen a crash yet. I even got the VM to sleep, then Unraid host to sleep ; woke up Unraid and woke up the VM without crash or freeze. 

 

Link to comment
On 9/9/2021 at 9:59 AM, ofawx said:

 

For those suffering issues during restart/shutdown, I can share what worked for me.

 

In config.plist, under NVRAM > boot-args, add 

vti=12

 

Sir, you are an absolute Champion. My hero. My saviour. I do not know who your are, or where you're from but you alone make the internet worth to me. This absolute simple advice solved a two year long mystery : the macos sleep / unraid sleep / unraid wake / macos wake -- macos random crash issue

 

Since two days everything works now flawlessly. Before that, I was about seriously considering buying a mac mini...

 

So. THANK YOU.

  • Haha 1
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.