If your Mac is out-of-order or you otherwise cannot download macOS from the App Store, you can still create a bootable OS X recovery USB, and you can use that to create an Installer USB.
The downloads used in this process are legal and freely avaliable - including disk images directly from Apple's IT support pages, and open source utilities for extracting and converting pkg, dmg, and HFS+.
No hackery. No hackintosh-ery.
This process works for
- macOS Catalina (10.15)
- macOS Mojave (10.14)
- macOS High Sierra (10.13)
- macOS Sierra (10.12)
- OS X El Capitan (10.11)
- OS X Yosemite (10.11)
In all cases you should first download the El Capitan Installer, as a direct download from Apple (no App Store).
The OS X Yosemite and macOS Sierra images should also work, but you might have trouble getting macOS Sierra to boot in VirtualBox.
This is a 3-step process:
- Create a Recovery ISO with Linux
- Create an El Capitan Installer ISO with VirtualBox from the Recovery image
- Create other Installer USBs from El Capitan in VirtualBox
The Apple download contains a recovery image called BaseSystem.dmg
which needs to be copied to a correctly partitions and formatted recovery USB or ISO.
- Download the OS X El Capitan installer
- Note for Windows users running Linux from VirtualBox:
- you already downloaded
InstallOSX.dmg
to your USB drive, so skip this step
- you already downloaded
- Visit Apple's official "How to upgrade to El Capitan" documentation
- Click "Download OS X El Capitan" in Step 4
InstallOSX.dmg
will be about 6GB in yourDownloads
folder
- Note for Windows users running Linux from VirtualBox:
- Install HFS+ tools for Linux
- See
install-mac-tools.sh
below - Note for Windows users running Linux from VirtualBox:
- choose to download to your USB drive, NOT
Downloads
- run the script from your USB drive, NOT
Downloads
- choose to download to your USB drive, NOT
- Right-Click on the view
Raw
link, chooseSave as
, and select theDownloads
folder - Open a
Terminal
and runbash install-mac-tools.sh
from theDownloads
folder
pushd ~/Downloads bash install-mac-tools.sh
- See
- Create
el-capitan-recue.iso
- See
linux-create-bootable-macos-recovery-image.sh
below - Note for Windows users running Linux from VirtualBox:
- choose to download to your USB drive, NOT
Downloads
- run the script from your USB drive, NOT
Downloads
- choose to download to your USB drive, NOT
- Right-Click on the view
Raw
link, chooseSave as
, and select theDownloads
folder - Open a
Terminal
and runbash linux-create-bootable-macos-recovery-image.sh
from theDownloads
folder
pushd ~/Downloads bash linux-create-bootable-macos-recovery-image.sh
- See
You can of course run each command of the scripts by hand, but since it's deeply nested (.dmg
containing a .pkg
containing another .dmg
with another .dmg
inside), and requires loopback mounts, it's a rather tedious and mundane process.
You will need a 32GB+ USB drive, ExFAT formatted.
You should copy ElCapitanInstallESD.dmg
from Downloads
to your USB drive.
This file should be downloaded too. https://gist.github.com/coolaj86/04fd06560a8465a695337eb502f5b0e9/raw/41aee39866707edc4b195556e8ee6591e6ee608b/empty.2100m.img.bz2
mac-fdisk seems to be a very particular piece of software but even if you are not on Ubuntu, you can place the binary from the deb file in https://packages.debian.org/source/sid/mac-fdisk in /usr/local/bin.
It almost worked for me in Fedora in that it created a bootable installer, but when I try installing OS X, it says "to download and restore OS X, your computer's eligibility will be verified with Apple", and after clicking "Continue", it said "An error occured while preparing the installation. Try running this application again".
Update: I tried using its Safari and the computer thinks it is December 2000 so any HTTPS connections fail. So I ran
ntpdate -u time.apple.com
first, before running the installer, and it seems to show the terms of service now. But it fails after putting the Apple IDIt's also odd that el-capitan-rescue.iso is 2.2 GB but InstallMacOSX.dmg is 6.2 GB. Where's the remaining GB? And why does the gist say "You will need a 32GB+ USB drive" then?
Full output:
For reference, this is the second search result on "make macos installer from linux". I wanted an El Capitan one specifically, which is what this guide has. The first search result from addictivetips.com did not work (the USB was not even detected by the Macbook).
I had a similar experience trying to create a Windows bootable USB on Linux. It would boot but it would ask me for a driver or something. When creating the Windows bootable USB from a Windows VM, it finally worked. So I guess that is what I have to do--create a bootable USB from a macOS VM (OSX-KVM).
I am currently trying the following steps to turn the dmg from Apple into a bootable USB. I will update this comment with my progress.
Update: it just says "Resource busy". Maybe using the qemu command instead of dmg2img might work.