-
Prerequisites:
- You need a running macOS system.
- I assume you're familiar with using the terminal.
- All the examples below refer to installing macOS High Sierra, you may need to adjust them to your needs if you want to install another macOS version.
-
Download macOS High Sierra from the AppStore.
-
The macOS installer will start after the download finiashes. We don't need it, so we can close it.
-
We need an empty image where we'll put the installer. Let's create one using the macOS DiskUtil CLI:
hdiutil create -o /tmp/HighSierra -size 8G -layout SPUD -fs HFS+J -type SPARSE
-
Now that we got an empty image at
/tmp/HighSierra.sparseimage
, we need to mount it as a volume:open /tmp/HighSierra.sparseimage
This will mount our image as a volume named
undefined
. -
To copy the installer over to the mounted volume, we use the
createinstallmedia
tool built into the installer. Note that we needsudo
to do so:sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/untitled
-
We should now have a full-blown installer macOS image. Before converting it to an ISO, we need to unmount it:
umount /Volumes/Install\ macOS\ High\ Sierra
Unmounting via command line led to the following steps failing. I needed to unmount the volume via the Finder's sidebar instead.
-
As a final step, we convert the image to ISO, again with the help of DiskUtil:
hdiutil convert /tmp/HighSierra.sparseimage -format UDTO -o ~/HighSierra.iso
-
We should now have a
HighSierra.iso.cdr
in our home folder. It can be used as an installation medium in apps like VirtualBox et al. Note that if you need an.iso
(not.cdr
), just rename the file to.iso
.
If the above doesn't work for you, feel free to leave a comment and I'll try my best to help. 🙂