Page 1 of 1

MacOS – How to create bootable macOS install media

MacOS – How to create bootable macOS install media
   0

In this article, I’ll show you the steps to create macOS install Media …

As most Mac users will know; each new macOS version comes with a few challenges. For some it’s nothing, for other it’s a disaster.

Catalina is one of the latter, a disaster for quite few amongst us, due to changed security rules and the lack of support of 32 bit applications.
Some of my favorite tools simply no longer work, and as a developer this makes me nervous when considering switching to the latest and greatest.

For this purpose I always create a virtual machine in VMWare Fusion, running the macOS version that I ran before the update.
This comes with challenges though, since Apple, in their infinite wisdom, does not simply provide macOS install media (eg. a DMG or ISO file) so you can install another version of macOS. We have to create our own.

Note: Here I describe how to create macOS install media, either as a bootable USB stick to do a fully clean macOS install for your Mac, or a DMG file, for example to setup a virtual machine.




Getting the right file to create macOS install media

To create macOS install media we will need to extract the right files from the application which would execute the “upgrade” for us (for when the user originally intended to upgrade their macOS).
With this I mean: when upgrading to a newer macOS, we usually get (or your Mac does it for you) an application called something like “Install macOS Mojave”, which can be found in your Applications folder, before executing the update.

 

Abort Installation! 

Depending on a few things, your Mac may or may not start the installation process after downloading.
Abort this installation, as it will overwrite your current OS and the needed files will automatically be removed after that, preventing you from creating install media.
You can quit the application/installer by making sure the installer is the active window and pressing the ⌘-key and the “Q”-key.

Only download from the Apple App Store! 

There are several shady files and/or DMG’s out there, which may spare you the work.
My advise: Only use the version from the Apple App Store! Do NOT use 3rd party files unless you know what you’re doing!
Downloading from a 3rd party invites shady and malicious versions.

Required disk space … 

I’m estimating that worse case scenario, you’ll need up to 16Gb of free space on your disk before you start this process.
In reality it will be a little less, but better safe than sorry.

Cleanup when done … 

Once you have your Install Media, be it USB stick or DMG image file, you can delete the file you downloaded in this step – it takes up quite a bit of space.
It is located in your Application folder and called something like “Install <macOS version>“, for example “Install Mojave”.

 

Since these are no longer listed in the Apple App Store – yet still exist in the Apple Store – here a few direct links to the right files for some macOS versions in the Apple App Store:

Option 1 – The Apple Script – Creating macOS Install Media on a USB drive

After downloading the right file from the Apple App Store:

Now Apple is not totally ignoring the end user when it comes to making install media – it’s well hidden (in my opinion) in this Apple Knowledge Base article.

The Install application would have been much more user friendly experience, if Apple would have just offered the option “Create Bootable macOS Install Media”, but instead we need to resort to Terminal.

Prepare a USB stick – This method will write to a USB stick or drive! 

The listed commands below will create a bootable install media on a USB disk/stick that has been insert already AND is mounted as “/Volumes/MyUSBDrive” – obviously, this will be named differently on your Mac.

This USB stick or drive also needs to be at least 8Gb and should be formatted for use with your Mac
To properly format the disk in “Disk Utility“, use “Erase” to erase and format the disk with Format: “Mac OS Extended (Journaled)“,  Scheme: “Master Boot Record“.

  It is recommended to use a USB 3.x stick or drive when your Mac supports this – installation will go a lot faster.

  If your Mac is using macOS Sierra or earlier, include the --applicationpath  argument, similar to the way this argument is used in the command examples for Sierra and El Capitan.

Catalina (10.15)


sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/MyUSBDrive

Mojave (10.14)


sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/MyUSBDrive

High Sierra (10.13)


sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyUSBDrive

Sierra (10.12)


sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyUSBDrive --applicationpath /Applications/Install\ macOS\ Sierra.app

El Capitan (10.11)


sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/MyUSBDrive --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app

 

 

Option 2 – Manually – Creating macOS Install Media as a DMG

As with option 1, we of course first will need to download the right file from the Apple App Store.

This option is useful in case we do not want a USb stick or drive – for example for a Virtual Machine, we’d rather have a DMG, as it’s much faster when installing macOS on your Virtual Machine.
The Apple script doesn’t provide for this (it kinda does, but you might as well follow these steps).

  We use “sudo” on Terminal, for which we will need an account with admin rights and “sudo” will ask for your password!

  I’m labeling the DMG “InstallMedia“, for example purposes. You can use a different name (eg. Mojave, Sierra, etc) in the scripts, or to avoid typos: simply rename the resulting DMG to your liking after all these steps.

Short version for the impatient

Here all steps combined, please note that you will have to make sure the proper filename is chosen to create the macOS install media.

  Just a warning: simply copying and pasting is a bad idea unless you know what each step really does.

  This example is for Mojave:


1
2
3
4
5
6
7
cd ~/Downloads/
sudo hdiutil create -o InstallMedia -size 8G -layout SPUD -fs HFS+J -type SPARSE
sudo hdiutil attach InstallMedia.sparseimage -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
sudo hdiutil detach /Volumes/Install\ macOS\ Mojave/
sudo hdiutil convert InstallMedia.sparseimage -format UDZO -o InstallMedia.dmg
sudo rm InstallMedia.sparseimage

 

Step 1 – Find a nice location for your macOS install media DMG

As far as I know, you can create this file in most of the user-accessible directories.
I did it on the Desktop, but doing it in your Downloads directory may be a good (or even better) location as well.
We need to tell Terminal first to go there:


cd ~/Downloads/

 

Step 2 – Create a Sparse Disk

First we will need to create an empty disk image that can grow and only takes up the amount of space really used – a so called Sparse Disk.

From the Wiki page:

Unlike a full image file (.dmg), which takes up as much actual space as the real disk it represents (regardless of the amount of unused space), a sparse image file (.sparseimage) takes up only as much actual disk space as the data contained within, up to a maximum of the capacity assigned during creation.

 

In Terminal:


sudo hdiutil create -o InstallMedia -size 8G -layout SPUD -fs HFS+J -type SPARSE

This will output something like this:


created: /Users/hans/Downloads/InstallMedia.sparseimage

 

Step 3 – Attach the Sparse Disk as a Disk

In Terminal:


sudo hdiutil attach InstallMedia.sparseimage -noverify -mountpoint /Volumes/install_build

Which results in something like this (different on your Mac):


/dev/disk4              Apple_partition_scheme          
/dev/disk4s1            Apple_partition_map            
/dev/disk4s2            Apple_HFS                       /Volumes/install_build

 

Step 4 – Run the Apple Script (see Option 1 for variations)

In Terminal, for Mojave (change “/Applications/Install\ macOS\ Mojave.app” with the filename of the macOS version you are using):


sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build

It will ask if you want to continue, type “Y” key and press Enter.

Depending on your Mac this may take a few seconds, and will show something like this:


Ready to start.
To continue we need to erase the volume at /Volumes/install_build.
If you wish to continue type (Y) then press return: Y
Erasing disk: 0%... 10%... 20%... 30%... 100%
Copying to disk: 0%... 10%... 20%... 30%... 100%
Making disk bootable...
Copying boot files...
Install media now available at "/Volumes/Install macOS Mojave"

 

Step 5 – Detach the Sparse Disk of your new macOS install media

So we can create a macOS install media DMG file, we will need to detach the Sparse Disk:

Again in Terminal (the name “Install\ macOS\ Mojave” depends on the macOS version you’re creating install media for – if unsure, see what is in the “/Volumes” directory):


sudo hdiutil detach /Volumes/Install\ macOS\ Mojave/

Which just give a simple “disk ejected” message.

 

Step 6 – Convert the Sparse Disk of your macOS install media to a DMG file

After this step we will have a macOS install media in the shape of a DMG file.
Feel free to rename, copy and/or move it around as any other file.

Execute this in Terminal:


sudo hdiutil convert InstallMedia.sparseimage -format UDZO -o InstallMedia.dmg

This shouldn’t take too much and time, and is this is what the output could look like:


Preparing imaging engine…
Reading Driver Descriptor Map (DDM : 0)
   (CRC32 $F2D81FEC: Driver Descriptor Map (DDM : 0))
Reading Apple (Apple_partition_map : 1)
   (CRC32 $4F4E610B: Apple (Apple_partition_map : 1))
Reading  (Apple_Free : 2)
..
   (CRC32 $00000000:  (Apple_Free : 2))
Reading disk image (Apple_HFS : 3)
.....................................................................................................................................................
   (CRC32 $3552A74F: disk image (Apple_HFS : 3))
Adding resources…
.....................................................................................................................................................
Elapsed Time: 18.098s
File size: 6068404389 bytes, Checksum: CRC32 $36434964
Sectors processed: 16777216, 11917929 compressed
Speed: 321.5Mbytes/sec
Savings: 29.4%
created: /Users/hans/Downloads/InstallMedia.dmg

 

Step 7 – Cleanup!

The last step is removing the Sparse Image of your macOS install media.
Don’t forget to also remove the installatie application in your Applications Folder (it takes up quite a bit of space).


sudo rm InstallMedia.sparseimage

 

Creating a Virtual Machine running macOS in VMWare Fusion

Since I use VMWare Fusion, here the quick steps to create a new Virtual Machine from your DMG.
It is super simple, so here a short video to get you started – make sure to select the correct macOS version in the VMWare Fusion window (here I use macOS 10.14 – Mojave)…

Donation options


Donations are very much appreciated, but not required. Donations will be used for web-hosting expenses, project hardware or a motivational boost (a drink or snack). Thank you very much for those have donated already! It's truly AwEsOmE to see that folks like our articles and small applications.

Comments


There are no comments yet.
You can post your own comments by using the form below, or reply to existing comments by using the "Reply" button.



Your Comment …

Do not post large files here (like source codes, log files or config files). Please use the Forum for that purpose.

Please share:
*
*
Notify me about new comments (email).
       You can also use your RSS reader to track comments.


Tweaking4All uses the free Gravatar service for Avatar display.
Tweaking4All will never share your email address with others.