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


Leoyzen

Recommended Posts

  • 2 weeks later...

I usually share here ovmf files updated to the latest stable releases.

Well, this time I didn't and I wont share stable release 202111, because it seems the package has issues with gpu passthrough, most probably related to this pr, merged after that stable release:

https://github.com/tianocore/edk2/commit/ee1f8262b83dd88b30091e6e81221ff299796099

With the stable release I wasn't able to have a video output of the bios, so no bios access.

 

There were also some comments on reddit, for example:

 

So, for who is not able to compile or can't compile the files here are the updated ovmf files, commit 6612ff8 (24/12/2021).

I tested them in mac os 12.1 and kali linux.

I didn't test them in mac os 12.1 after a system update, if they allow for automatic reboot or not (latest working version without this issue for me is v. 202011).

Anyway, if the issue is still there, a forced reboot of the vm solves the issue.

 

These were built with gcc 10; gcc 11 gives errors due to brotli dependency, a working pr was issued, hopefully it will be merged soon.

 

OVMF_commit-6612ff8-24-12-2021.zip

Edited by ghost82
Link to comment

Another topic of interest is sensors, and in particular the ability to monitor temperatures in our mac os vm.

It seems that "it's not possible" to monitor temperatures of cpu(s), even when pa ssed through, because they are not however real cpus, but these can be monitored from the host.

For gpu passthrough, since the host doesn't use it because it's attached to vfio, it can't monitor its temperature: for amd gpu(s) I found RadeonSensor, available here:

https://github.com/aluveitie/RadeonSensor

 

With it, It's possible to monitor the amd gpu temperature from the guest and it works on recent amd gpus, from radeon hd 7000 up to the latest 6000 series.

It is possible to use the builtin widget with only RadeonSensor.kext (to be injected), or to use and inject also SMCRadeonGPU.kext (which depends on RadeonSensor.kext), to export also the gpu temperature to VirtualSMC, so that other third party software, like Sensei, can read that value.

 

Builtin widget:

Widget.png.fb5180931587936190ebd0a5ed117851.png

 

Sensei:

Sensei.png.bc38d13efea3197b66622cdba708e9de.png

 

I don't have any nvme, but it would be useful for others if somebody knows how to read (if it's possible at all) the temperature of the nvme drive, when passed through.

Link to comment
15 hours ago, ghost82 said:

I don't have any nvme, but it would be useful for others if somebody knows how to read (if it's possible at all) the temperature of the nvme drive, when passed through.

If you pass the NVMe device through in its IOMMU group then the hardware is available to the OS.
I can see my drive temps via smartctl so any software should be able to do the same.

Spoiler

=== START OF SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

 

SMART/Health Information (NVMe Log 0x02)

Critical Warning:                   0x00

Temperature:                        35 Celsius

Available Spare:                    100%

Available Spare Threshold:          5%

Percentage Used:                    1%

Data Units Read:                    30,479,282 [15.6 TB]

Data Units Written:                 27,977,046 [14.3 TB]

Host Read Commands:                 507,304,635

Host Write Commands:                400,773,925

Controller Busy Time:               1,011

Power Cycles:                       148

Power On Hours:                     5,730

Unsafe Shutdowns:                   11

Media and Data Integrity Errors:    0

Error Information Log Entries:      46

Warning  Comp. Temperature Time:    0

Critical Comp. Temperature Time:    0

Thermal Temp. 1 Transition Count:   1

Thermal Temp. 1 Total Time:         207

 

  • Like 2
Link to comment

is there a way to change the refresh rate of the display and if not confirmed (like in windows) the refresh rate reverts to the prior value? My default setting is 37,5hz and there is also a 60hz option. 

 

When I was using a vdisk setup some time ago I tried to switch to 60hz, which caused a black screen and I had to reinstall the OS. Since I have a NVME based setup now I don't want to risk a reinstallation. 

 

any advise? 

Link to comment
10 hours ago, doesntaffect said:

any advise? 

Mac os will not give the option to revert the refresh rate like in windows.

However you can reset the display properties:

1. boot into recovery

2. Give following commands:

cd /Volumes/YOURDISK/Users/YOURUSERNAME/Library/Preferences/ByHost/
rm -f com.apple.windowserver.*
rm -f com.apple.preference.displays*

You may need to mount the disk first if you receive error like "read only filesystem" with command 'mount' and options '-uw'

Edited by ghost82
Link to comment

An update on enabling content caching on mac os vm:

one solution is to patch (rename) VMM to something else (XXX) and kern.hv_vmm_present to something else (kern.hv_xxx_present) for mac os big sur 11.3+.

This was coded by @ofawx in his github repo:

https://github.com/ofawx/VmAssetCacheEnable

 

However, user reitermarkus opened an issue in github (https://github.com/ofawx/VmAssetCacheEnable/issues/6), letting us know that the patches break AppleQEMUGuestAgent.

This is because AppleQEMUGuestAgent checks for kern.hv_vmm_present, but if patched in the kernel it will not find it and it will not start.

Unfortunatly, as ofawx reported it's 

Quote

with a kernel patching approach, disguising the various VMM strings in the kernel is going to end up with all-or-nothing outcomes at the application level.

 

After this Acidanthera team included the cache content patch in its FeatureUnlock.kext.

This was not working properly, so after some tests (https://github.com/acidanthera/bugtracker/issues/1910) they implemented the solution in RestricEvents.kext, by patching kern.hv_vmm_present = 0 specifically for the AssetCache process.

With this latest solution both content caching can be enabled and AppleQEMUGuestAgent works as it should.

PR should be implemented soon in the master repo:

https://github.com/acidanthera/RestrictEvents/pull/5

 

and available soon if you want to compile from master, or in the next release version of the kext.

Link to comment

@doesntaffectaare you referring to my latest post?

If so, content caching is useful to share updates among different apple devices, without downloading them from internet.

AppleQEMUGuestAgent is needed if you want to control the vm from the host, using the agent in the guest.

For example command virsh shutdown vmname --mode=agent does a clean shutdown of the vm from the host, using the guest agent, without relying on acpi instructions.

  • Like 1
Link to comment
On 1/5/2022 at 10:42 PM, doesntaffect said:

which allows access to GPU power consumption & temperatures

This is possible for amd gpus < radeon vii, when apple decided for its drivers to stop reporting the temperature directly (but why???).

Vega 10 and older are able to display temperature without any third party kext.

Link to comment
  • 4 weeks later...

Hello!

 

I managed to install HighSierra thanks to the new Macinabox docker version released recently. I also configured it to passthrough my 1050TI GPU and got the sound to work properly. I configured everything using VNC at the beginning and after that thanks to nomachine&/chrome remote desktop. No problems when i connect to the VM through remote control software. The thing is that i lose signal after the apple logo at boot, the samsung tv which is connected through HDMI cable to the GPU loses signal and i get a black screen, although the VM is fully working if i login with nomachine or chrome remote desktop.

 

Any hints? Thanks!

Link to comment
2 hours ago, david279 said:

You installed the nvidia drivers as well?

 

Yes, i installed the 387.10.10.10.40.139 version. I used a github utility that selects the best version for the macos (High Sierra 17G14033).

 

 

1 hour ago, ghost82 said:

And I think you also need boot arg nvda_drv_vrl=1

Make sure you have an up to date high sierra version: 17G14042

Then download and install webdriver v. 387.10.10.10.40.140.

https://images.nvidia.com/mac/pkg/387/WebDriver-387.10.10.10.40.140.pkg

 

I updated the system through Appstore and got to the 17G14033 version, not the xxx042.

 

Regarding the boot_args, i remembered following a guide that specified the nvda_drv=1, but don't recall the _vrl suffix. I'll look into this and try again.


Thx.

Link to comment
16 hours ago, faramir85 said:

17G14033 version, not the xxx042

17G14033 is before 17G14042, so update to the latest.

 

16 hours ago, faramir85 said:

nvda_drv=1

nvda_drv should be for previous nvidia drivers versions; following dortania guide, using v. 387.10.10.10.40.140, use boot arg nvda_drv_vrl=1

Edited by ghost82
Link to comment
  • 2 weeks later...
On 12/27/2021 at 11:55 PM, ghost82 said:

I usually share here ovmf files updated to the latest stable releases.

Well, this time I didn't and I wont share stable release 202111, because it seems the package has issues with gpu passthrough, most probably related to this pr, merged after that stable release:

https://github.com/tianocore/edk2/commit/ee1f8262b83dd88b30091e6e81221ff299796099

With the stable release I wasn't able to have a video output of the bios, so no bios access.

 

There were also some comments on reddit, for example:

 

So, for who is not able to compile or can't compile the files here are the updated ovmf files, commit 6612ff8 (24/12/2021).

I tested them in mac os 12.1 and kali linux.

I didn't test them in mac os 12.1 after a system update, if they allow for automatic reboot or not (latest working version without this issue for me is v. 202011).

Anyway, if the issue is still there, a forced reboot of the vm solves the issue.

 

These were built with gcc 10; gcc 11 gives errors due to brotli dependency, a working pr was issued, hopefully it will be merged soon.

 

OVMF_commit-6612ff8-24-12-2021.zip 937.61 kB · 7 downloads

 

Did you see any reboot issues with the newest update with this ? 12.2 or 12.2.1

Link to comment
6 hours ago, ab5g said:

Did you see any reboot issues with the newest update with this ? 12.2 or 12.2.1

Apart a kernel panic during the last reboot during the update (solved only by rebooting the whole host), which was probably fixed 2 days ago in opencore (fix to msr 35h for ProvideCurrentCpuInfo, in case of -cpu=host) everything is running smooth.

 

Update: Oh sorry, you were referring to ovmf: no, with this in my build, the update is able to reboot automatically, no force reboots needed (apart the kernel panic I described, but it's not ovmf fault).

Edited by ghost82
Link to comment
  • 2 weeks later...

I noticed that acidanthera has it's own audk repository...

It's a forked edk2 repository with added commits from acidanthera's developers, which is synched with edk2.

At the time of writing it's still synched with 202111 stable (usually it's synched with stable after some weeks), maybe we should use that instead of the original edk2 repo, for better support (?).

I will compile and share it too once it's synched with 202202.

 

Update: attached ovmf compiled from audk repo (synched with edk2 stable 202202)

OVMF_AUDK_202202-06-03-2022.zip

Edited by ghost82
  • Like 1
Link to comment
  • 1 month later...

Hi again.

I have both windows and mac VMs on unRaid 6.10.0-rc4.

I've recently swapped a PCI SATA card in order to run Monterey on its own SATA controller, not using my motherboard main Z390 SATA controller, which I want to use exclusively with Windows.

Windows has got allocated all existing resources/controllers except for what Monterey VM has got allocated to himself:

  • [1b73:1100] 7c:00.0 USB controller: Fresco Logic FL1100 USB 3.0 Host Controller (rev 10)
  • [1b4b:9215] 7a:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9215 PCIe 2.0 x1 4-port SATA 6 Gb/s Controller (rev 11)
  • [10de:128b] 07:00.0 VGA compatible controller: NVIDIA Corporation GK208B [GeForce GT 710] (rev a1)
  • [8086:a324] 00:1f.5 Serial bus controller: Intel Corporation Cannon Lake PCH SPI Controller (rev 10)
  • [8086:15bc] 00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (7) I219-V (rev 10)
  • [14e4:43ba] 01:00.0 Network controller: Broadcom Inc. and subsidiaries BCM43602 802.11ac Wireless LAN SoC (rev 01)
  • [144d:a804] 06:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961/SM963

I've used the latest EFI folder (opencore 0.78) from thenickdude and have configured it with opencore debugging versions.

 

I've only added USBToolBox.kext & UTBMap.kext generated from within Windows, (unfortunately the result is the same with or without these files).  

 

I've two Monterey OSs that run perfect in real mode/outside unRaid, plus the USB stick that has this EFI folder is also a Monterey USB installation disk.

 

Now, every time I boot this Monterey VM It doesn't pass the same boot point: "AppleFileSystemDriver: using apfs-preboot-uuid"

IMG_1023.thumb.jpg.208e1d04e9e6fd2e1fff893ecb4364ce.jpg

 

I've read the opencore boot log but I don't any see anything significant that can explain this...

Also uploaded (onto my gdrive) a video (in 240fps) of the whole opencore boot process.

 

What else can I do diagnose this issue ?

 

Thanks in advance for any answers.

 

Tower-UpdateVM.png

Tower-SysDevs.png

Monterey.xml opencore-2022-04-10-091349.txt.zip EFI.zip

Edited by augustopaulo
Link to comment

Try putting the card on a different bus. I run a mac os VM on pop os and usb device would not work when the bus was a high number like 0a. Just something to try.

<hostdev mode="subsystem" type="pci" managed="yes">

<driver name="vfio"/>

<source>

<address domain="0x0000" bus="0x7c" slot="0x00" function="0x0"/>

</source>

<address type="pci" domain="0x0000" bus="0x3" slot="0x00" function="0x0"/>

</hostdev>

<memballoon model="none"/>

</devices>

 

I changed your code from 0a to 3 in the part above, I did not see anything on 3 in your xml.

Link to comment
2 hours ago, david279 said:

Try putting the card on a different bus. I run a mac os VM on pop os and usb device would not work when the bus was a high number like 0a. Just something to try.

<hostdev mode="subsystem" type="pci" managed="yes">

<driver name="vfio"/>

<source>

<address domain="0x0000" bus="0x7c" slot="0x00" function="0x0"/>

</source>

<address type="pci" domain="0x0000" bus="0x3" slot="0x00" function="0x0"/>

</hostdev>

<memballoon model="none"/>

</devices>

 

I changed your code from 0a to 3 in the part above, I did not see anything on 3 in your xml.

Hi david279,

 

Thanks a lot your quick answer and idea.

 

I'm out at the moment, but when back home I'll try your suggestion ;-)

 

Link to comment

Hi @david279,

 

I've now changed the PCI USB controller bus address to 0x03 (removed existing "virtio-net" br0 at same address ) on the VM xml, booted up but unfortunately the result is the same...

 

I've also attached here the Monterey VM log.

 

I've now started to concentrate on one of the last messages in the opencore log: "AAPL: #[EB|LOG:EXITBS:START]", because this is mentioned on Dortania's trouble shooting guide: Stuck on [EB|#LOG:EXITBS:START]

 

Let's see how much I'll go further...

 

Monterey VM log.txt

Link to comment
3 hours ago, augustopaulo said:

Hi @david279,

 

I've now changed the PCI USB controller bus address to 0x03 (removed existing "virtio-net" br0 at same address ) on the VM xml, booted up but unfortunately the result is the same...

 

I've also attached here the Monterey VM log.

 

I've now started to concentrate on one of the last messages in the opencore log: "AAPL: #[EB|LOG:EXITBS:START]", because this is mentioned on Dortania's trouble shooting guide: Stuck on [EB|#LOG:EXITBS:START]

 

Let's see how much I'll go further...

 

Monterey VM log.txt 5.06 kB · 1 download

Try changing the machine type to 6.0

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.