My first Hackintosh: Mojave Gigabyte Z390 M Gaming Coffee Lake

Last month I decided to replace my ageing 2015 iMac with my first Hackintosh...and what an experience has it been!  I invested a lot of time in getting it up and running but now it works like a charm and I want to share with you my working configuration.


You may find this useful if you have identical or similar hardware. I will focus on the Clover configuration, drivers and kexts specific to this hardware and provide links to the guides I used for more general info on Vanilla installations.

!IMPORTANT!
Please note that many guides for the Gigabyte Z390 M Gaming use an unsupported memory fix driver called OsxAptioFix2Drv-free2000.efi .  The developer of this driver says that you should never ever use it, as it can cause serious issues to your system (here's his post). After a lot of and trial and error...I managed to use the standard memory fix driver contained in Clover r5033 (OsxAptioFix3Drv.efi) , by changing one little setting in the BIOS!
-----------------------------------------------------------------------------------------------------------
UPDATE TO CATALINA PUBLISHED ON 26 DECEMBER 2019

https://www.briskandwise.com/2019/12/my-first-hackintosh-update-to-catalina.html
------------------------------------------------------------------------------------------------------------

Hardware Components

What works

Frankly, I think everything! iMessage, iCloud, Appstore, Continuity, WiFi, Ethernet, Bluetooth, sleep/wake, restart/shutdown, hardware acceleration of the Intel GPU in "headless mode", USB ports, NVRAM, CPU power management...

Software

  • Clover EFI (version 2.5 r5033)
  • Clover Configurator (5.4.5.0)
  • Hackintool (2.7.1)
  • 8 standard Kexts: you can find the latest versions directly on Github (links below), Hackintool->Installed or Clover Configurator->kext installer
  • 1 custom kext for USBports,  which I created with Hackintool specifically for this mainboard. It activates the 6 USB ports on the back of the mainboard - four USB 3.0, one 3.1 and one USB C- and two USB ports on the case, connected to the USB2.0 header of the mainboard.
  • The config.plist template, that you should further customise (see below)
  • As to the EFI drivers, we are going to use exclusively the ones included in the Clover installer. This should ensure maximum support with Clover also for the future.

Sources and General Instructions for Vanilla Installation

I started my Hackintosh experience with the videos of Morgonaut, which are a good starting point to get a general idea of how things work with Clover & co. (e.g. Build a Perfect Hackintosh - Beginners Tutorial)

I then switched to more complete and technical guides, like CorpNewt's Hackintosh Vanilla Desktop Guide.  For the creation of a minimal config.plist I took Icymind's  Minimal Clover Config  as a basis and further reduced it.

Again from CorpNewt, I used a guide (and a script) for the mapping of USB ports. I eventually switched to Hackintool for that, but I would have not managed without the understanding gained thanks to CorpNewt.

Other resources I used are  /r/hackintosh/ and the forums of tonymacx86.com (though  I am not using Uni or Multibeast) and InsanelyMac, in particular the very insightful posts from RehabMan.

Specific settings,  configurations and considerations

Graphic Card

VideoProc Hardware Info to check Quick Sync acceleration
The Clover configuration proposed in this post is valid only with a discrete graphic card. I am using a Sapphire Pulse RX570, which is in the recommended list from Apple, connected via  Display Port. The embedded Intel IGPU is used in "headless mode", i.e. it does not drive a monitor but provides encoding hardware acceleration to Mojave via Intel Quick Sync.  Should you have a similar Radeon card from the same series (say an RX 560 or RX580), you should still be able to use this configuration.

If you plan to use the Integrated Graphic card only, you can use this post to get some ideas but will definitely have to use different BIOS and Clover settings to make it work.

Personalise the Clover config.plist

Config.plist
The config.plist file I use is really minimal. Entire sections (Acpi, Boot Graphics, CPU, Devices, Disable Drivers, Gui) have been completely removed or cut to the bone. The Kernel and Kext Patches section is de facto disabled (no need for a USB patch, as we have a custom USB kext), but I had to keep the section as a placeholder or the system will not boot.

Before you can use this plist file, you have to customise it with your generated Serial Number, Board Serial Number, UUID and MLB (Please refer to the general instructions above). I am using iMac 19,2  in SMBIOS: you may want to change that if you use different hardware, especially a different CPU generation.

I have removed the verbose boot as the system is now very stable and I do not have to troubleshoot. If you want to enable it to see what's happening behind the scene, just add the -v argument in Boot/Arguments.

BIOS

I am on BIOS revision F7, the latest available at the time of writing.
I tried to stay with the Optimised Defaults to the extent possible, and changed just four settings.
  1. Save&Exit: Load Optimised Defaults and confirm
  2. M.I.T: no changes here. Well talk about the ram settings later.
  3. System: no changes.
  4. BIOS: no changes.
  5. Peripherals:
    1. Super IO: disable Serial Port
    2. USB configuration: enable XHCI Hand-off
  6. Chipset:
    1. Enable Internal Graphics (we use the Radeon, but we need this for HW acceleration)
    2. set DVMT Pre-Allocated to 32M. This single change enabled the use of the standard driver OsxAptioFix3Drv.efi  With the standard setting (64M), I can only boot with the unsupported OsxAptioFix2Drv-free2000.efi (see above)
    3. Other posts suggest to disable VT-d. I left it enabled and all seems to be working fine.
  7. Power: no changes

Clover Install and EFI folder

I am assuming that you have successfully created a USB Install stick following the general instructions for Vanilla installations.

Before the Mojave installation: Install Clover on USB Installer
  1. Open the Clover EFI package (r5033)
  2. click "Change Install Location" and select your USB installer as target disk
  3. click "Customise"
  4. uncheck everything and then check ONLY the following:
    1. Clover for UEFI booting only
    2. Install Clover in the ESP
    3. UEFI Drivers->File System drivers-> ApfsDriverLoader
    4. UEFI Drivers->File System drivers-> VBoxHfs
    5. UEFI Drivers->Memory fix drivers > OsxAptiofix3Drv
    6. UEFI Drivers->Additional drivers > EmuVariableUefi
  5. click Install and complete the installation
  6. mount and open the EFI folder (with Clover Configurator or Hackintool)
  7. copy all the nine kexts above in EFI/CLOVER/kexts/Other
  8. replace the config.plist with your customised one

After the Mojave installation: Install Clover on the main drive, i.e. exactly like before BUT:
    • In step 2 "Change Install Location" and select the drive where Mojave is installed 
    • In step 4 also Install RC scripts on target volume (this is needed together with EmuVariableUefi for proper NVRAM emulation)

RAM settings

In the BIOS settings described above, I have intentionally left the M.I.T section unchanged. The RAM runs at the failsafe speed determined by the mainboard (in my case 2133 MHz at 1.2v).

As my modules are rated to run at 3200 MHz with XMP,  I went into BIOS->M.I.T. -> Advanced Frequency Settings and enabled XMP to Profile 1. This immediately boosted the RAM to 3200 MHz and 1.35v. Mojave correctly recognised the new speed in System Report, Geekbench scores improved, and all seemed to work perfectly ok at a first.

However, two weird behaviours appeared:
  1. wake from sleep took longer and required pressing a key on the keyboard twice, once to wake the system and a second time to get an image on the screen. Before tweaking the RAM, the wake was very fast and completed with one keypress only
  2. after wake from sleep, I got the message "Disk was not ejected properly" if external USB disks were connected
The solution to this was to the set the speed to 2666 MHz, i.e. the fastest on current Macs. This still gives a tangible speed increase compared to stock setting. I also disabled XMP, so the voltage stays at 1.2v. At 2666 MHz, the RAM seems stable at 1.2v and I could see no difference in benchmarks with XMP disabled vs enabled.

To conclude, I changed only one RAM setting in BIOS compared to Optimised Defaults:
  • M.I.T. -> Advanced Frequency Settings->System Memory Multiplier, set to DDR4-2666
A few posts I found on this:
https://www.reddit.com/r/hackintosh/comments/bngrrk/usb_30_drive_ejected_on_sleep_and_remounted_on/
https://www.reddit.com/r/hackintosh/comments/apcijb/a_guide_to_vanilla_hackintosh_from_scratch/
https://github.com/macfanatic77/hackintosh/blob/master/07_Troubleshooting.md

If you find a way to make it work at full speed let me know in the comments!

Enable TRIM for SSD

TRIM was not enabled by default. You can check your drive by opening System Report/Sata or System Report/NVMExpres.  If "TRIM Support: NO" then run "sudo trimforce enable"  from Terminal and follow the instructions on the screen. The system will reboot. Check again in System Report that "TRIM Support: YES"

Extra Info

I originally installed Mojave 10.14.5.  After that, two updates for 10.14.6 were released. I run the updates as I would do on my normal Mac. They eventually installed without problems, but I encountered a strange behaviour. The progress bar got stuck at zero progress and showing 12 or 13 minutes remaining. The system seems not respond and you may be tempted to force a shutdown: please don't, just be patient! The system is not blocked, it will eventually restart after 10-20 minutes with the updates correctly installed.

Conclusion

I am happy to have learned something new and I am satisfied with the results. The system runs reliably and much faster that my 2015 iMac! Once setup, there's really not much maintenance, apart from the occasional Clover and kext refresh prior to a macOS update.

If you found this post useful or have questions, leave a comment below!

Cheers

----------------------------------------------------------------------------------
UPDATE TO CATALINA PUBLISHED ON 26 DECEMBER 2019

https://www.briskandwise.com/2019/12/my-first-hackintosh-update-to-catalina.html

Comments

  1. Thanks for putting this amazing guide and providing all these resources together.
    I am having similar build with Z390 M Gaming and RX 580.
    Yesterday I updated to Catalina and since then my USB ports are not working.

    Have you updated to Catalina? Can you guide me how can I fix the USB Ports?

    ReplyDelete
    Replies
    1. Hello! Yes, I did update to Catalina but I did not experience any problem with USB ports afterwards. If they were working before the update, make sure that your USB kext is in the EFI folder under Clover/kexts/other (as opposed to Clover/kexts/10.xx), or it might not load with a new version of the OS.

      Delete
  2. Thank you for sharing your installation experience. I have a same setup except CPU being i3-9100. I followed your guide, installation was a success. However after clover install to target harddrive (with RC scripts, as instructed in your guide) and moving kexts and config.plist from EFI of USB installer disk to EFI of harddrive, the system booted up without graphic card outputting anything. When I used the USB installer to boot, graphic card works fine. Do you have any idea what this problem might be? I checked that my harddrive EFI is identical to USB installer EFI.

    ReplyDelete
    Replies
    1. en effet moi aussi elle est meme reconnue dans clover au boot / options /et la partie graphic mais il manque le deviceID pour cette carte c'est 0x67FF1002 j ai la meme avec clover configurator j ai pu installer les codes device dfans le config.plist ont obient ensuite Radeon polaris 2GB

      Delete
  3. Now that the RC scripts are installed, you may want to try deleting the EFI folder on the HD and directly copying the one from the USB (including the nvram file if it is there). If the EFI folders are identical, the booting behavior should really be the same! In theory :-)

    ReplyDelete
  4. Thanks for the reply. Yes theoretically it should boot the same way, but it just does not. I cleared HD EFI, then copied whole USB EFI to it. The HD boots everything else except the graphic output (I'm using HDMI) as I can check from Anydesk (Remote Desktop app). I've tried hundreds of times -- RC script first, copy USB EFI, with or without nvram.plist, all the combinations.... so frustrating...

    ReplyDelete
    Replies
    1. The problem is kind of solved, although I have no idea how the solution is related to the problem. I removed the HD EFI nvram.plist file, then set the BIOS to disable my windows HD from booting. (Its original boot order is behind clover HD though). Clover boots up fine and graphic output is normal.
      I guess I will have to swap windows HD and clover HD in BIOS whenever I need windows. Thanks for the help!

      Delete
    2. Glad you found a satisfactory solution!

      Delete
  5. Thank you so much for putting this guide together. I used this guide and successfully installed Catalina. Everything is working as you have said other than my case USB's. 1 is running correctly off the board (as my bluetooth). The other one that's connected to two USB ports is not running correctly. Any ideas on how to perhaps change your USB kexts? It is a USB 3 port but I used an adapter to plug into my USB 2 ports on my motherboard. It actually works in the BIOS but just not in my MacOS.

    Thanks again!

    ReplyDelete
    Replies
    1. Hello Wang!

      That’s normal, as the USB ports on the PC case differ for each model, your mileage using my kext may vary... You might have to create your own customized kext: have a look at the link on mapping USB ports in the section “ Sources and General Instructions for Vanilla Installation”. Hackintool is also very useful!

      Thanks for visiting my website and Cheers!

      Delete
  6. I have the same motherboard with you so I am about to try it your way! All the other guides had failed me..

    What did you do for your "KextsToPatch" settings? (also given that you made your own custom USB kext file, which I am also going to use!)

    Thank you in advance ;)

    ReplyDelete
    Replies
    1. And if you could, could you please please please upload either your current EFI or the EFI you had when you were first setting up? Thank you so much in advance

      Delete
    2. Hello! Regarding the “kexttopatch”, I simply had to leave one disabled entry in the plist. It looks like it would not boot if that section is completely empty. You can download the plist file linked in the post and have look!

      Delete
  7. Any chance you could also upload your EFI folder and related kexts, specifically the USB kext? This would be very helpful for I and others who are following this guide and using the same motherboard as you. Thanks!

    ReplyDelete
    Replies
    1. Nevermind, I see the file now. Thank you much for providing!

      Delete
  8. tks for that, rlly appreciate it :) will try it as soon as I put my hands on the new pc

    ReplyDelete
  9. Sigh, I've got the same MB, and followed this exactly but with some changes from the Vanilla Desktop Guide to apply it to my iGPU (I have an i5-9600k with the UHD 630). I've been trying lots of different things (Unibeast, straight from scratch from the aforementioned guide, etc), but so far all have failed. In fact the only time I've gotten into the installer was via a completely vanilla Unibeast install, which took four restarts and ages to do - but I wasn't able to get the drive to boot after that.

    This one will boot into the Clover launcher but crashes while trying to boot the Mojave installer. I'd really love this to work, since the non-unibeast Clover is much faster and cleaner. The verbose report returns an error I've seen a lot but have still not gotten to the bottom of: AE_AML_UNINITIALIZED_LOCAL. Any idea what that could be?

    ReplyDelete
    Replies
    1. Sorry Erbert, i have no experience with that error message...

      Delete
  10. Thanks for this guide! Plan on doing a very similar build in few weeks time. Can I ask why you can’t just follow the morgonaut tutorial on installing Mojave? Why did you decide to create your own config.list. Thanks.

    ReplyDelete
    Replies
    1. Hi Adam, you can try, but each hardware and configuration has its own specificities!

      Delete
  11. Hi I have pretty much the same specs as you except a i7 9700K and RX 560 I am having a kernel panic when trying to boot into the installer its something to do with memory fix I installed OsxAptioFix3Drv.efi from clover what setting did you have to change in the BIOS?

    ReplyDelete
  12. hello comment fait ont pour l'audio qui est ALC892 merci

    ReplyDelete
  13. bonjour ja i la meme config a part le cpu qui est un I3 /9100f qui ne prend pas en charge la partie graphique de la carte mere malgres ca tout fonctionne sauf L audio je pourrais avoir votre dossier efi car je suis interressé par la partie ACPI / patch et la partie config.plist catalina tourne bien sur du ssd flash hyper rapide et ne prends pas de place voila merci pour le dossier EFI

    ReplyDelete
  14. je suis sur catalina avec cpu I3 / 9100F et GPU Pulse Radeon RX550 2GB avec la news version du bios en F9g j ai essayer la version beta F9k mais pas stable une qui m a bien plus c'est la F9g moddé mais tjrs pas d audio

    ReplyDelete
  15. thx a lot for doing this! Im gonna buy similar components and this could be very helpful!!

    ReplyDelete

Post a Comment

Popular posts from this blog

My first Hackintosh: Update to Catalina Gigabyte Z390 M Gaming Coffee Lake

How I replaced Inbox by Gmail - Trip bundles