Skip to content

Instantly share code, notes, and snippets.

@mattieb
Created November 4, 2015 02:51
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattieb/d6e0aa895b30106967f0 to your computer and use it in GitHub Desktop.
Save mattieb/d6e0aa895b30106967f0 to your computer and use it in GitHub Desktop.
Create a DMG installer for installing El Capitan into a VM
# Based on Tim Sutton's prepare_iso.sh from the excellent osx-vm-templates
# <https://github.com/timsutton/osx-vm-templates/blob/master/prepare_iso/prepare_iso.sh>
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg
hdiutil create -o tmp.dmg -size 10g -layout SPUD -fs HFS+J
hdiutil attach tmp.dmg
asr restore --source /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg --target /Volumes/untitled --erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -Rv /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -v /Volumes/OS\ X\ Install\ ESD/BaseSystem.* /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/OS\ X\ Base\ System
hdiutil detach /Volumes/OS\ X\ Install\ ESD
hdiutil convert -format UDZO -o InstallOSXElCapitan.dmg tmp.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment