Skip to content

Instantly share code, notes, and snippets.

@kfriend
Created December 14, 2015 04:42
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kfriend/0c81cd0b0bcd5dec2b9f to your computer and use it in GitHub Desktop.
Save kfriend/0c81cd0b0bcd5dec2b9f to your computer and use it in GitHub Desktop.
OS X: Create El Capitan ISO compatible with VirtualBox
#!/usr/bin/env bash
# All credit goes to http://apple.stackexchange.com/a/211722, and thanks to Jesse Web
# for posting the article at http://apple.stackexchange.com/questions/198737/install-el-capitan-in-virtual-box-for-testing-purposes
hdiutil attach "/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/esd
hdiutil create -o elcapitan.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach elcapitan.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/iso
asr restore -source /Volumes/esd/BaseSystem.dmg -target /Volumes/iso -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/esd/Packages /Volumes/OS\ X\ Base\ System/System/Installation
cp -rp /Volumes/esd/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/
cp -rp /Volumes/esd/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/esd
hdiutil detach /Volumes/OS\ X\ Base\ System
hdiutil convert elcapitan.cdr.dmg -format UDTO -o elcapitan.iso
mv elcapitan.iso.cdr elcapitan.iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment