Skip to content

Instantly share code, notes, and snippets.

@aldoram5
Created February 4, 2020 16:42
Show Gist options
  • Select an option

  • Save aldoram5/e5842d19eb6cba7045beafa7a12f0c37 to your computer and use it in GitHub Desktop.

Select an option

Save aldoram5/e5842d19eb6cba7045beafa7a12f0c37 to your computer and use it in GitHub Desktop.
macOS ISO

Make a macOS VBox/VMWare compatible ISO, to virtualize another MacOS environment on a mac.

You need to download the version you want/need from the app store. Then it will appear on your Applications folder. You won't run that installer, you can close it and just proceed with the following steps.

 sudo hdiutil create -o /tmp/macOS -size 10000m -volname macOS -layout SPUD -fs HFS+J
 sudo hdiutil attach /tmp/macOS.dmg -noverify -mountpoint /Volumes/MacOS
 sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS
 sudo hdiutil detach /Volumes/Install\ macOS\ Catalina
 hdiutil convert /tmp/macOS.dmg -format UDTO -o ~/Desktop/macOS.cdr
 mv ~/Desktop/macOS.cdr ~/Desktop/macOS.iso

Notes:

  • Install\ macOS\ Catalina.app is the downloaded installer from the app store, with future macOS releases the name will change, but it most likely will always be on the Appplications folder.
  • The size flag when creating the volume is set to 10000m (around 10GB) modify according to the size of the installer.
  • Some times, Error erasing disk error number (22, 0) may appear when using creteinstallmedia, the error isn't explicit on the cause but it's either file perms(you ran some commands with sudo and others without it) or that the volume size wasn't big enough.
  • createinstallmedia has the --nointeraction flag available so you don't need to press Y and then enter to let it delete the empty volume.
  • Don't forget to delete the installer and the /tmp/macOS.dmg files once you're done, otherwise they'll just take up GB of space for nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment