How to create a macOS Monterey Installation ISO image

The macOS ecosystem loves *.dmg volumes as its main container format. However, *.iso can sometimes be the easiest to work with if you are exploring virtualization. Having a macOS installation image can be pretty handy to have in your toolbox. There are some images floating around on the internet, however, pulling these from untrusted can be incredibly dangerous particularly because there's no easy way of ensuring that these have not been modified by malicious actors.

The safest option is to make your own, which is, fortunately, quite easy to do. You will require access to a Mac to obtain the installer.

💡
Apple's End User License Agreement (EULA) provides terms that govern where macOS is allowed to run. You alone are responsible for ensuring that you are in compliance its content.
  1. Download the macOS installer from the App store

This will typically download the installer into the /Applications folder. If this is not the case for your system, substitute the correct path in subsequent commands.

2. Create a temporary *.dmg volume to hold the installer

hdiutil create -o /tmp/Monterey -size 16384m -volname Monterey -layout SPUD -fs HFS+J

created: /tmp/Monterey.dmg

3. Mount the volume that was just created

hdiutil attach /tmp/Monterey.dmg -noverify -mountpoint /Volumes/Monterey

/dev/disk5          	Apple_partition_scheme         	
/dev/disk5s1        	Apple_partition_map            	
/dev/disk5s2        	Apple_HFS                      	/Volumes/Monterey

4. Copy the installation media to the volume

sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Monterey --nointeraction

Erasing disk: 0%... 10%... 20%... 30%... 100%
Making disk bootable...
Copying to disk: 0%... 10%... 20%... 30%... 40%... 50%... 60%... 70%... 100%
Install media now available at "/Volumes/Install macOS Monterey"

5. Unmount the volume

hdiutil eject -force /Volumes/Install\ macOS\ Monterey 
 
"disk5" ejected.

6. Convert the *.dmg image to a *.cdr file.

hdiutil convert /tmp/Monterey.dmg -format UDTO -o ~/Desktop/Monterey
Reading Driver Descriptor Map (DDM : 0)…
Reading Apple (Apple_partition_map : 1)…
Reading  (Apple_Free : 2)…
Reading disk image (Apple_HFS : 3)…
..............................................................................
Elapsed Time: 20.536s
Speed: 797.8MB/s
Savings: 0.0%
created: /Users/[username]/Desktop/Monterey

7. Rename the *.cdr file to the target *.iso

mv ~/Desktop/Monterey.cdr ~/Desktop/Monterey.iso    

8. (Optional) Cleanup the temporary volume and disk image

rm -f /tmp/Monterey.dmg
sudo rm -rf /Applications/Install\ macOS\ Monterey.app

Subscribe to Another Dev's Two Cents

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe