Skip to content

Instantly share code, notes, and snippets.

@wrossmck
Created November 18, 2015 11:10
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save wrossmck/20858f8393d3bb9158a1 to your computer and use it in GitHub Desktop.
Save wrossmck/20858f8393d3bb9158a1 to your computer and use it in GitHub Desktop.
Convert Downloaded El Capitan.app to bootable iso
#!/bin/bash
#taken from http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Create the ElCapitan Blank ISO Image of 7316mb with a Single Partition - Apple Partition Map
hdiutil create -o /tmp/ElCapitan.cdr -size 7316m -layout SPUD -fs HFS+J
# Mount the ElCapitan Blank ISO Image
hdiutil attach /tmp/ElCapitan.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
# Restore the Base System into the ElCapitan Blank ISO Image
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
# Remove Package link and replace with actual files
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
# Copy El Capitan installer dependencies
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
# Unmount the installer image
hdiutil detach /Volumes/install_app
# Unmount the ElCapitan ISO Image
hdiutil detach /Volumes/OS\ X\ Base\ System/
# Convert the ElCapitan ISO Image to ISO/CD master (Optional)
hdiutil convert /tmp/ElCapitan.cdr.dmg -format UDTO -o /tmp/ElCapitan.iso
# Rename the ElCapitan ISO Image and move it to the desktop
mv /tmp/ElCapitan.iso.cdr ~/Desktop/ElCapitan.iso
@deltorosalazar
Copy link

Worked for me. Thanks!

@RGreeneRI
Copy link

Don't forget to:
rm /tmp/ElCapitan.cdr.dmg
after converting to ISO

@dim971
Copy link

dim971 commented Feb 12, 2017

Hi, I tried to use the script with El Capitan and macOS Sierra installations. I did get the final iso image but when I try to use it with qemu or virtual box, I have an error saying: no bootable device. What can I do to solve this please?
Thank you :)

@driprado
Copy link

I'm getting this error:

hdiutil: detach failed - No such file or directory

Anyone having the same problem ?

@rinnin2
Copy link

rinnin2 commented Dec 29, 2022

Anyone having the same problem ?

Yep. Same message & doesn't work for me after following all the instructions above. Would really like to play around with Virtual Box and OS X El Capitan

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