Os X El Capitan Usb Bootable

Summary

How to make a bootable USB drive on Linux Mint (19.3) to allow you to install Mac OS X El Capitan on a MacBook with broken or corrupted recovery mode.

Background

I was recently given a 2011 MacBook Pro that had been “well-loved” and was therefore a mess of missing applications, ghost files and generally slow-as-hell. Since there wasn’t much worth saving I wiped it and initiated recovery mode in order to re-install OS X (El Capitan).

Sep 30, 2015 Having a bootable hard drive or USB flash drive is a handy troubleshooting tool. Make sure the El Capitan installer (or at least a copy of it), called Install OS X El Capitan.app. The El Capitan DMG installer file, now available for download under the version of 10.11.6 for Mac OSX. Now the dmg file can be downloaded by any Mac device users. The Dmg file is known as the latest ISO regarding El Capitan operating system. When talking about the El Capitan OS X, this is the advanced OS, which has been released for the Mac.

Having recently fixed a busted MacBook Air I had learned a bit about Recovery Mode (hold Command+R whilst pushing the Power button and release a few seconds after the machine wakes up). I tried that with this machine, and upon hitting “Reinstall MacOS X” was greeted with a prompt telling me it would take -2,148,456,222 days and 8 hours (an uncaught buffer overflow, me thinks). After about 30 seconds, a window pops up saying “Can’t download the additional components needed to install Mac OS X” and the installation gives up. The detailed error log says “Chunk validation failed, retrying” about 1000 times and eventually gives up altogether.

Further investigation suggests this may be something to do with security certificates having expired and hence the machine not being able to download the necessary files from Apple’s servers, but it seems the error can appear for all sorts of reasons. I also tried Internet Recovery (Command+Option+R) but that gave exactly the same error (and would also only have installed OS X Mountain Lion).

I then turned to attempting to make a bootable USB stick of OS X El Capitan from an image downloaded from Apple. I use Linux Mint on my main laptop and that was all I had available. Apple seem to assume everybody has a spare MacBook from which to create a bootable USB so they provide absolutely no documentation to help with this. I also couldn’t find a single guide online that worked from start to finish, so here I summarise what needs to be done.

Steps

As usual, this is all at your own risk 🙂

First you need to go to Apple’s OS Download Page and (step 4) get ahold of “InstallMacOSX.dmg” for El-Capitan. It’s a 6GB file so it might take a ‘lil while. You will also need to find a USB drive with at least 8GB capacity, and make sure it’s blank. The format doesn’t matter, because this procedure will format it correctly.

(In total you will need to use about 15-18GB of disk space by the time you’ve done all the extracting necessary, which shouldn’t be a problem for most computers but it was a challenge for my laptop with it’s 128GB SSD and dual boot Windows/Linux!)

Then you need to get a program called ‘dmg2img’

You can then extract the DMG

Now double click the .img file to mount it. In there is a InstallMaxOSX.pkg file. This requires a utility called “xar” to extract, which can be installed with these instructions (from https://www.oueta.com/linux/extract-pkg-and-mpkg-files-with-xar-on-linux/)

Then build and install with

Now you can extract the .pkg file. It will extract to the current working directory

Now, within the extracted files you will find something called InstallESD.dmg. This actually contains all the interesting boot files, but it isn’t a pristine image, so we can’t just burn it to a USB. Thankfully, a script exists to convert this DMG to a bootable usb, and it’s available here. It takes the DMG and writes everything directly to the USB in the right place.

ONE CAVEAT: When I ran this script on my InstallESD.dmg, it crashed because it didn’t recognise the checksum. I think this is because Apple updates the dmg’s anytime there is a security update for El Capitan so the checksum list isn’t updated. All I did was delete the checksum check from the script above. Essentially, just open the script and delete this section

Once I had done this, I ran the script with my USB connected (/dev/sdb for me, but CHECK YOURSELF with fdisk or similar) and after quite a while it finished copying.

I plugged the USB into the MacBook, and opened the startup menu by holding down Option whilst pushing the power button. This gave me the choice of booting from EFI, or choosing a WiFi network. Click on the EFI, and then follow the prompts to install OS X from the USB drive!

When you’re done, you may need to use Parted or a similar utility to re-format your USB as a normal drive again.

Warning: Please follow these instructions at your own risk. I am not responsible for any damage or information loss that could result from following this guide. Also, note that installing OS X on PC is illegal. Please buy a real Mac if you're satisfied with your Hackintosh. This guide is for evaluation purposes only.

Os X El Capitan 10.11.6

Requirements

  • An Intel-based PC with UEFI bios
  • A USB flash drive with at least 16GB capacity
  • A dedicated hard drive (SSD highly recommended)
  • A computer running OS X (10.9 or later) for preparing the installation USB flash drive

I chose to avoid the UniBeast installer (by Tonymacx86) because of its commercialized nature, as described here. Here is a vanilla guide to installing El Capitan on your PC!

Preparing the USB Installation Drive

First things first. We need to prepare a USB thumb drive that will contain the installation files as well as the bootloader and custom kexts for our specific Hackintosh build.

Download El Capitan from the Mac App Store

Head over to your existing OS X environment running 10.9 or later and open the Mac App Store.

Search for 'El Capitan' and click Download. The download is completely free if you're running OS X 10.9+.

Wait for the download to finish (this could take some time).

Format the USB Drive

Open Disk Utility in Applications/Utilities and locate your USB device. Make sure you've backed up anything important on that drive as it will be erased forever.

Select it, and then on the right, click the partition tab.

  1. Click Curent Layout and change it to 1 Partition.
  2. Set the Name to USB.
  3. Set the Format to Mac OS Extended (Journaled).
  4. Click Options and select GUID Partition Table.

Click Apply to format the drive.

Copy the Installation Files to the USB Drive

Now that we've downloaded the installation files from the Mac App Store and formatted our USB drive, let's copy the installation files to it.

Run the following command in the Terminal (Applications/Utilities):

The command will run a script inside the Install OS X El Capitan application that will copy the installation files to the USB drive.

This process takes about 15 minutes. Go out for a quick run, or a hamburger, or both. When you come back, it should have finished.

Installing a Bootloader

If you tried to boot from the USB drive as is after the previous step on a PC, it wouldn't work. We need a bootloader that makes it possible to boot OS X on x86 and x86_64 PCs.

There are 3 popular bootloaders to choose from.

  • Clover
  • Chameleon
  • Chimera

I went with Clover as it seems to be the most popular choice among other El Capitan installers, mostly for the following reasons:

Clover is an open-source EFI-based bootloader created on Apr 4, 2011. It has a totally different approach from Chameleon and Chimera. It can emulate the EFI portion present on real Macs and boot the OS from there instead of using the regular legacy BIOS approach used by Chameleon and Chimera. For many, Clover is considered the next-gen bootloader and soon it will become the only choice since BIOS in being replaced by UEFI in every new motherboard. One big feature of Clover is that iMessage, iCloud, the Mac App Store works along with Find My Mac, Back To My Mac and FileVault since Clover can use the EFI partition. (Read more)

Install Clover on Your USB Drive

Installing Clover on your USB drive is relatively easy. It involves running an installation wizard and selecting some options.

Download the latest Clover installer from here.

  1. Run the installer.
  2. Click Continue twice.
  3. Click Change Install Location and set it to your formatted USB drive.
  4. Click Customize and check the following options:
    • [x] Install for UEFI booting only
    • [x] Install Clover in the ESP
    • [ ] Drivers64UEFI
      • [x] OsxAptioFixDrv-64 - fixes memory map created by AMI Aptio EFI. Booting OS X is impossible otherwise.
  1. Click Install and wait for the installation to finish. It shouldn't take more than a minute.
Copy Essential Kexts to the USB Drive

Next, we'll need to copy some kexts (kernal extensions, similar to drivers on Windows) to the USB drive.

Mac
  • FakeSMC.kext - open source SMC device driver/emulator developed by netkas. Tricks OS X into thinking it's installed on Apple hardware. Absolutely required for Hackintosh installation.
  • NullCPUPowerManagement.kext - disables AppleIntelCPUPowerManagement.kext which may cause kernel panics when you try to boot from the USB drive. It's optional, copy it only if you get an AppleIntelCPUPowerManagement-related kernel panic.
  • ApplePS2Controller.kext and AppleACPIPS2Nub.kext - adds support for PS2 devices (such as PS2 keyboard/mouse). They're optional, copy them only if you still use PS2 devices.

Download these files from here and copy them to the EFI mounted volume at /EFI/Clover/kexts/10.11/.

Now that the installation USB drive is ready, let's install OS X El Capitan!

Boot from the USB Drive

Restart your computer and boot from the USB drive (Press Esc/F8/Del to access the boot selection menu).

Use the arrow keys to select Boot OS X Install from Install OS X El Capitan (It should be selected by default). Press the spacebar and select Boot Mac OS X in verbose mode. Verbose mode means that you'll be able to see exactly what's going on under the hood as OS X attempts to boot up its installer. You'll be able to see the exact error message if booting fails.

Press Enter and cross your fingers. Clover will now boot the installer from your USB drive. This could take some time, in my case, it takes around 5 minutes (Don't worry -- the startup time is around 5 seconds after installing on an SSD).

Did it fail?

It's more than likely that the boot will fail. Don't panic (ha-ha), as kernel panics usually mean that you forgot to copy an essential kext to the EFI partition. Look up the exact error you're getting before the boot log comes to an end and search Google for a solution.

Once you find an additional kext that your system needs, you'd attempt to copy it to the EFI volume, only to discover that it's gone! Not to worry, it's just unmounted and hidden. Follow this guide to mount the hidden partition, and then, follow the Copy Essential Kexts section above to copy it to the USB drive's EFI partition.

Format the Target Hard Drive

Once the installation wizard boots, the next step is to prepare the hard drive that you want to install OS X on.

Click Continue, followed by Disk Utility.

Select the target drive to install to (not the USB drive!) and click the Erase button. Make sure to back up anything important on that drive, as it will be deleted forever.

  1. Set the Name to El Capitan.
  2. Set the Format to OS X Extended (Journaled).
  3. Set the Scheme to GUID Partition Map.

Click Erase to format the drive.

Install OS X to the Target Drive

Exit the Disk Utility and click Install OS X.

Click Show All Disks and select the drive you just formatted to install OS X on it. Finally, click Install.

The process takes about 25 minutes. Be patient. For me, it hung at the end ('1 second remaining') for around 5 minutes. Don't be tempted to reset or cancel the installation.

When that's done, the system will reboot. Make sure to boot from the USB device again, and select Boot OS X Install from Install OS X El Capitan once again, in verbose mode. The installation is a two-part process that continues once you re-boot into the USB drive.

Finally, after about 25 more minutes, OS X El Capitan should be successfully installed on the target drive.

Boot into El Capitan via the USB Device

Os X El Capitan Usb Bootable Installer

After the second reboot, boot from the USB device once again, but this time, select Boot OS X from El Capitan, and select verbose mode.

Press Enter and cross your fingers again. If all goes well, you'll be presented with the setup wizard:

Take a minute to set up your new Hackintosh. Once you're done, there are a few things you need to do to finish off the installation.

Reinstall Clover on the Hackintosh Drive

In the previous step, we used Clover on our USB drive to boot our Hackintosh. This is fine, but most of us aren't going to keep that USB drive plugged in forever. Let's make it possible to boot El Capitan independently by reinstalling Clover on it.

Go back up to the Install Clover on Your USB Drive section and follow the steps again, but this time, select your El Capitan volume instead of the USB drive.

Once again, copy the essential kexts to the EFI partition that shows up after installing Clover.

Finally, make sure to add Clover EFI boot options which is possible by pressing Clover Boot Options in the Clover boot window (if there are 2 boot options -- find the one for your SATA drive). I literally spent 3 hours figuring out why Clover would not boot when I disconnected the USB drive before I figured out that I need to manually add the EFI boot options.

Now you'll be able to boot directly from the El Capitan hard drive, as it should be!

Audio and Networking

If you're lucky, audio and networking will work right out of the box. If not, you're on your own from here. You'll need to research your exact hardware (by using System Information in Applications/Utilities) and searching Google to find the right kext or installer to make it work on El Capitan.

Clover Themes

The default Clover theme is pretty ugly (no offense). Check out this theme database to improve Clover's appearance.

This is YosemiteLogin by xenatt:

Enjoy!

That's it! Enjoy your new Hackintosh, and if you absolutely love it, consider buying a Mac!