Create ISO image from macos installer

root's picture

1. Download the installers from the Mac App Store. If they are no more listed, below links are for:

Macos Mojave
Macos Catalina

UPDATE: to ease up macos downloads, use gibMacOS. Link at the end of this article.

2. Create a dmg image and mount it:

fmbp16:tmp florian$ hdiutil create -o Mojave -size 8500m -volname Mojave -layout SPUD -fs HFS+J
...............................................................................................................................................
created: /Volumes/data.1/tmp/Mojave.dmg
fmbp16:tmp florian$ hdiutil attach Mojave.dmg -noverify -mountpoint /Volumes/Mojave
/dev/disk6          	Apple_partition_scheme         	
/dev/disk6s1        	Apple_partition_map            	
/dev/disk6s2        	Apple_HFS                      	/Volumes/Mojave

3. Run createinstallmedia from within the macos installer and unmount the media afterwards:

fmbp16:tmp florian$ sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/Mojave --nointeraction
Erasing disk: 0%... 10%... 20%... 30%... 100%
Copying to disk: 0%... 10%... 20%... 30%... 40%... 50%... 60%... 70%... 80%... 90%... 100%
Making disk bootable...
Copying boot files...
Install media now available at "/Volumes/Install macOS Mojave"
fmbp16:tmp florian$ hdiutil detach /volumes/Install\ macOS\ Mojave
"disk6" ejected.
fmbp16:tmp florian$

4. Convert DMG to ISO and rename it to have iso extension afterwards:

fmbp16:tmp florian$ hdiutil detach /volumes/Install\ macOS\ Mojave
"disk6" ejected.
fmbp16:tmp florian$ hdiutil convert Mojave.dmg -format UDTO -o Mojave.cdr 
Reading Driver Descriptor Map (DDM : 0)…
Reading Apple (Apple_partition_map : 1)…
Reading  (Apple_Free : 2)…
Reading disk image (Apple_HFS : 3)…
..............................................................................................................................................
Elapsed Time:  8m 30.045s
Speed: 16.7Mbytes/sec
Savings: 0.0%
created: /Volumes/data.1/tmp/Mojave.cdr
fmbp16:tmp florian$ mv Mojave.cdr Mojave.iso

Now enjoy ;)

Extra:
https://github.com/corpnewt/gibMacOS

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.