MacOS – Install El Capitan in Virtual Box for testing purposes

macosvirtualboxvirtualization

I enrolled to Apple's beta program as I want to test some software under El Capitan. Therefore, I would like to instal El Capitan in Virtual Box.

Is there a recommended way of doing this? As I understand I have to install Yosemite first and then upgrade to El Capitan beta?

I understand, that I have to convert the .app I download into a bootable image which I can use to install it in a virtual machine – can somebody point me to a reliable (tested) howto how I can do this?

Best Answer

The instructions below, found in Creating a bootable El Capitan ISO image, worked for me after a download of OS X El Capitan from the App Store.

hdiutil attach "/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/esd
hdiutil create -o ElCapitan3.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach ElCapitan3.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 ElCapitan3.cdr.dmg -format UDTO -o ElCapitan3.iso
mv ElCapitan3.iso.cdr ElCapitan3.iso

Additionally for running within VirtualBox:

  • Create a new OS X El Capitan from Wizard.
  • Change "System->chipset" to PIIX3, mount created ISO and boot up.
  • If you only see a the CD/DVD as installation target within the installation program choose "Utilities > Disk Utility" and erase the VirtualBox disk, which will lead to an empty HFS+ Journaled disk, which now could be chosen as target.