Skip to content

Instantly share code, notes, and snippets.

@jcherven
Created December 10, 2019 00:11
Show Gist options
  • Save jcherven/ab2551f8fb90300ac3b87b3627a1a8c3 to your computer and use it in GitHub Desktop.
Save jcherven/ab2551f8fb90300ac3b87b3627a1a8c3 to your computer and use it in GitHub Desktop.
Create a MacOS High Sierra (10.13) .iso from the locally installed "Install macOS High Sierra.app" file from the App Store
#!/bin/bash
# Creates a MacOS 10.13 High Sierra install .iso image for use in virtual machines or to create USB install media
# Requires a local download of the High Sierra installer in its default location (/Applications) from the Apple App Store
# Therefore this particular method is intended to be run on a working Mac running HighSierra or Sierra
# Steps are copied from https://www.howtogeek.com/289594/how-to-install-macos-sierra-in-virtualbox-on-windows-10/
set -e
# Creates a blank disk image
hdiutil create -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS+J
# Mounts the blank image
hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
# Restores BaseSystem.dmg from the installer to the mounted image
asr restore -source /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
# Unmount the image
hdiutil detach /Volumes/OS\ X\ Base\ System
# Write the image to an ISO file
hdiutil convert /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso
# Move and rename the ISO file to the Desktop
mv /tmp/HighSierra.iso.cdr "$HOME/Desktop/MacOS-10_16-HighSierra.iso"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment