Skip to content

Instantly share code, notes, and snippets.

@julianxhokaxhiu
Last active June 18, 2023 08:11
Show Gist options
  • Save julianxhokaxhiu/286017b9872474d2c9b9fa090f6802bf to your computer and use it in GitHub Desktop.
Save julianxhokaxhiu/286017b9872474d2c9b9fa090f6802bf to your computer and use it in GitHub Desktop.
Simple bash script to create a Bootable ISO from macOS Big Sur Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
# Change this at your desire. Sometimes this works out of the box, sometimes not.
# Default size: ~13.5 GB
DISK_SIZE="13000m"
#===========================================================================
hdiutil create -o /tmp/BigSur.cdr -size $DISK_SIZE -layout SPUD -fs HFS+J
hdiutil attach /tmp/BigSur.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo "/Applications/Install macOS Big Sur.app/Contents/Resources/createinstallmedia" --volume /Volumes/install_build --nointeraction
hdiutil detach "/Volumes/Shared Support 1"
hdiutil detach "/Volumes/Shared Support"
hdiutil detach "/Volumes/Install macOS Big Sur"
hdiutil convert /tmp/BigSur.cdr.dmg -format UDTO -o /tmp/BigSur.iso
mv /tmp/BigSur.iso.cdr ~/Desktop/BigSur.iso
rm /tmp/BigSur.cdr.dmg
@isometry
Copy link

A more conservative DISK_SIZE="12800m" worked for me with the Mac App Store 11.0.1 (20B29) installer.

@wolfferine
Copy link

wolfferine commented Dec 7, 2020

As anyone tested this by booting up the iso from VMware Fusion or Parallels?
Cause I have had no success.

Thanks in advance for your response

@julianxhokaxhiu
Copy link
Author

As anyone tested this by booting up the iso from VMware Fusion or Parallels?
Cause I have had no success.

Yes, I've personally tested this and works fine.

@julianxhokaxhiu
Copy link
Author

Shrinked down to ~13.5GB now required for 11.1

@entianbucali
Copy link

great job Julian. Love your contribution.

@cangaceirobrabo
Copy link

cangaceirobrabo commented Oct 31, 2021

Thank you! I changed a bit and it worked to make a Monterey ISO. Increased the size of the disk to 15361M, replaced BigSur / Big Sur for Monterey.

@julianxhokaxhiu
Copy link
Author

julianxhokaxhiu commented Oct 31, 2021

Thanks for the feedback, I'll now create the new gist for Monterey on top of your suggestions. Appreciated.

//EDIT: Done: https://gist.github.com/julianxhokaxhiu/d26a8974eb0d723285c6b06c99d7207e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment