Jump to content

How do I create a vanilla macOS installer?


black.dragon74

Recommended Posts

Hello guys,

 

This guide is there to be used as a reference or a starting point for anyone trying to install macOS on a non Apple machine.

 

This guide covers installation using CLOVER as it is very much the standard now. Also, most of the systems nowadays are UEFI enabled and CLOVER can take full advantage of it.

 

Things you will need:

  • An USB Drive with capacity of 16GB or larger (8GB might work too)
  • An existing macOS install (Real mac/Hackintosh)
  • A downloaded macOS Installer
  • An internet connection
  • A little bit of your time

Note: It is not recommended to create a bootable USB using a VM as it corrupts the installer in some cases. Although If you have no other option at your disposal you may try resorting to it. You have been warned.

 

BIOS Settings:

When it comes to installing OS X on a non Apple machine BIOS settings play a very important role. Here are a few common settings that should be changed if they exist

  • VT-d - Disabled (You may use dart=0 if this option is not in the BIOS)
  • DvMT - 64MB (If you can change this setting, please do. If you set DvMT > 64MB you will have to patch framebuffer to take advantage of it)
  • DEP - Enabled
  • SATA Mode - AHCI (Very important)
  • Secure Boot - Disabled
  • Legacy Boot - Disabled (I rarely boot legacy, you may leave it Enabled though, no harms)
  • CSM Module - Disabled (Available as "Launch CSM" on ASUS. You may try toggling it. It tends to help in cases of garbled screen)
  • Fast Boot - Dsiabled
  • Boot from USB - Enabled

Creating the installer USB:

It is obvious but writing it anyway, make sure that if there exists any data on USB drive that will be erased. Take a backup before attempting the steps below.

 

There are two ways of creating the installer USB.

 

1. createinstallmedia Method (can be used on Real Macs. Only method that gives you a OS X recovery partition. Preferred.)

2. BaseBinariesClone Method (Use when trying to boot legacy system or if the above method doesn't work for you.)

 

Please note that we are going to use a install creator utility written by me for both of the above methods. In that:

 

New Way refers to createinstallmedia

Old Way refers to Base Binaries Clone

So, choose your options accordingly.

 

Note: Base Binaries Clone doesn't work for 10.13.x or above

 

Getting the script:

`

Open up terminal and type:

cd ~/Desktop
curl -o bkit https://raw.githubusercontent.com/black-dragon74/Bkit/master/bkit
chmod a+x bkit

`

You will have the utility on your Desktop.  Now we need to get hold of a few utlities:

 

Download CLOVER from here

Download FakeSMC from here

Download HFSPlus.efi from here

 

If preparing for Sierra or above you might need Lilu and IntelGraphicsFixup

 

Laptop Specific Note: I prefer to use external mouse and keyboard when installing macOS. If you want to use your internal keyboard and trackpad you might need VoodooPS2Controller. (Works only for Trackpads on PS2 Bus. You may try VoodooI2C for trackpads on I2C bus)

 

For Elan1200 I2C trackpad use the kext attached in my ELAN1200 guide at: https://osxlatitude.com/index.php?/topic/10165-guide-elan1200-i2c-trackpad/

 

Formatting USB and Installing Clover:

Time has come to invoke Bkit. Open terminal and type

~/Desktop/bkit

`

Now just keep following the instructions from the script:

  • Choose your preferred way (New way or Old Way)
  • Choose macOS version (Bkit supports 10.9 - 10.13. Requires Install macOS xxx.app in /Applications)
  • Press Y to agree to the warning that says USB data will be erased.

Now, Bkit will ask you for your USB device's disk identifier. Here is how to find the same. Open terminal and type:

diskutil list external

You will get a list of external USB devices along with disk identifier like, /dev/disk1 or /dev/disk2

 

You don't have to write full /dev/disk1 just type the "diskx" part. Like, for /dev/disk2 I would type disk2 in Bkit.

 

The script will now verify if the disk is indeed an external one (to save from your data loss it is used as a failsafe method).

 

Now it will ask you to install clover then type c (continue).

 

Installing CLOVER to USB for UEFI:

  • Open clover installer package and click on Continue.
  • You will get a README. Select Continue.
  • Now you will get a screen to select Install location. Choose "Change Install Location"
  • Now select your USB drive and click continue
  • You will get back to previous screen. Select "Customize"

Tick the following options:

  • Install for UEFI booting only
  • Select themes if you would like so (I use BGM)
  • Select Drivers64UEFI > AptioMemoryFix (Latest build as of Sat Mar  3 19:31:12 IST 2018 is attached to this post)

Now click on "Install". Punch in your password and press ENTER (Return)

 

Installing CLOVER to USB for Legacy:

  • Open clover installer package and click on Continue.
  • You will get a README. Select Continue.
  • Now you will get a screen to select Install location. Choose "Change Install Location"
  • Now select your USB drive and click continue
  • You will get back to previous screen. Select "Customize"

Tick the following options:

  • Install CLOVER in the ESP
  • Boot-loader > Install boot0af in MBR
  • Clover EFI > EFI 64bits SATA
  • Select themes if you would like so (I use BGM)
  • Select Drivers64UEFI > OsxAptioFixDrv (You may try OsxAptioFix2Drv if it doesn't work for you)

Now click on "Install". Punch in your password and press ENTER (Return)

 

Once finished, click on Close and get back to terminal where Bkit is waiting for our response.

 

Type continue/c at Bkit's prompt. It will now verify CLOVER installation and then proceed to copy installation files.

 

Please DO NOT close Terminal until you get confirmation message from the tool. It may take 5-10 mins for the script to finish (might take longer on slow machines)

 

A successful run looks like this:

term_gb_bkit.jpg

 

Preparing to boot USB:

Now as we are mostly done with everything, in order for CLOVER to be able to boot macOS install it needs the kexts and a config.plist file.

 

You have already downloaded the required kexts above. Unzip them and then open your USB drive's EFI partition.

 

Copy the unzipped kexts and then paste then into: USB's EFI/EFI/CLOVER/kexts/Other

 

Copy downloaded HFSPlus.efi in: USB's EFI/EFI/CLOVER/drivers64UEFI (VBoxHfs is disabled as it is not that reliable)

 

Now we need to install a proper config.plist file. Download the one attached to this post and then paste it in: USB's EFI/EFI/CLOVER

 

Make double sure that the name of the file you just pasted is "config.plist". CLOVER won't read any other config file.

 

Booting USB:

  • Plug your USB device into a USB port (USB2 port recommended)
  • Keep pressing your BIOS hotkey at POST screen (Esc key for ASUS laptops)
  • Select "UEFI: Your USB"
  • You will get CLOVER boot screen. (Hint: You may press F4 now to dump origin ACPI tables. It is required later)
  • Press ENTER or wait for 5 seconds to boot automatically.

 

General notes:

  • Bkit can also be used to create installer for real macs. Use "bkit -nc" arg for that.
  • You might consider having ethernet connected while installing macOS. Download kexts for (RealtekIntel) and paste them in USB's EFI/EFI/CLOVER/kexts/Other
  • The plist file just gets you to installer screen. It does nothing even close to a full install.
  • If you get a reboot it is likely due to DvMT prealloc set to less than 64MB. You may use IntelGraphicsDVMTFixup with Lilu to overcome this issue. However, after installing you must patch framebuffer as IntelGraphicsDVMTFixup has a heavy reliance on framebuffer data and will panic when you use patches for HDMI or Cursor Bytes.
  • If you get no device to boot in CLOVER screen it is surely due to missing HFSPlus.efi (Double check that you have it)
  • If you get some error related to window server it is because of your Nvidia/AMD GPU trying to load up. To get around you will have to disable the device using ACPI patching (Will save it for some other day)

Problem Reporting:

If you face any problems please post them below. As this is a preinstall process you won't be able to get any logs or debug info hence, post your issue with screen capture (photo) of the panic along with your USB device's CLOVER folder.

I'll be glad to help.

 

Cheers

config.plist.zip

AptioMemoryFix.efi.zip

Link to comment
Share on other sites

Retaining HFS+J instead of APFS:

 

In case of fresh install:

APFS might work for you but is not recommended on a hack as it has some serious issues like slow boot times and battery status failing.

 

If your boot drive is an SSD and you are installing macOS 10.13+ installer will automatically convert it to APFS. In order to stop that, do the following:

  1. Open Disk Utility in the installer and format your SSD/HDD as HFS+J partitioned disk.
  2. Quit disk utility and then open up terminal using Utilities > Terminal (at the menu bar)

Run this command:

/Volumes/"Image Volume"/"install macOS High Sierra.app"/Contents/Resources/startosinstall --volume /Volumes/"SSD/HDD Name" --agreetolicense --converttoapfs NO

`

That's it. Installer will copy the files and then at the CLOVER screen you can boot by selecting "Boot macOS Install from XXX". Note that it is normal for the installer to restart you machine a few times (2 times in my case).

 

In case you are upgrading to High Sierra:

  1. Open terminal and type the following
# You must have a downloaded copy of the Installer in /Applications

/Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/startosinstall --converttoapfs NO

`

That's it. Installer will copy the files and then at the CLOVER screen you can boot by selecting "Boot macOS Install from XXX". Note that it is normal for the installer to restart you machine a few times (2 times in my case).

 

Regards

Link to comment
Share on other sites

×
×
  • Create New...