Skip to content

Instantly share code, notes, and snippets.

@kfriend
Created December 14, 2015 04:42

Revisions

  1. Kevin Friend created this gist Dec 14, 2015.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/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