I am spinning up a VM to do some ruby development. At this point I am trying to install OS X 10.11 to it. I have looked into several ways, but they are not working because I have a bad network connection. How is this done?

Here is one link that I looked at: OS X on OS X

  • @user3439894, I jus re-wrote my question. Commented Dec 22, 2015 at 22:39
  • 1
    After reading the link you included, OS X on OS X, I wouldn't waste one minute trying to use VirtualBox to install OS X El Capitan. I'd use VMware Fusion instead. It's not free, but you get what you pay for. Commented Dec 22, 2015 at 23:06
  • Mmm I think that you can't install a legal OS X on a VM. Is why you have the hackintosh.
    – StrawHara
    Commented Dec 22, 2015 at 23:32
  • 1
    @MrMojoRisin, The Client version of (Mac) OS X has been legally virtualizable since 10.7 and prior to that the Server version since 10.5. From the current OS X SLA. "(iii) to install, use and run up to two (2) additional copies or instances of the Apple Software within virtual operating system environments on each Mac Computer you own or control that is already running the Apple Software, for purposes of: (a) software development; (b) testing during software development; (c) using OS X Server; or (d) personal, non- commercial use." Commented Dec 23, 2015 at 4:19
  • @user3439894 ohhh Thanks for your comment :) I'll go to bed a wiser man tonight
    – StrawHara
    Commented Dec 23, 2015 at 7:53

2 Answers 2



This how-to targets VirtualBox because the OP uses it. I strongly recommend to purchase Parallels Desktop or VMware Fusion though. A lot of features like drag-and-drop, change the monitor resolution etc. don't work properly in VirtualBox (or I don't get it to work).

The installation of El Capitan is a dual-stage process. You first have to create a Yosemite VM and then update to El Capitan.

The script below apparently doesn't work with El Capitan. A "bootable" El Capitan iso boots to an EFI command line only. The intermediate step of creating a Yosemite.iso seems to be inevitable.

  • Download the latest VirtualBox installer, the latest Yosemite installer and the latest El Capitan installer.

  • Install VirtualBox

  • Use the following shell script to create a bootable Yosemite.iso. The script assumes that Install OS X Yosemite.app was downloaded to the folder /Applications.

     # Create bootable Yosemite ISO
     # Mount the installer image  
     hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
     # Convert the boot image to a sparse bundle  
     hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite
     # Increase the sparse bundle capacity to accommodate the packages  
     hdiutil resize -size 8g /tmp/Yosemite.sparseimage
     # Mount the sparse bundle for package addition  
     hdiutil attach /tmp/Yosemite.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
     # Remove Package link and replace with actual files  
     rm /Volumes/install_build/System/Installation/Packages
     cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/
     # Copy Base System  
     cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/install_build/
     cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/install_build/
     # Unmount the installer image  
     hdiutil detach /Volumes/install_app
     # Unmount the sparse bundle  
     hdiutil detach /Volumes/install_build
     # Resize the partition in the sparse bundle to remove any free space  
     hdiutil resize -size `hdiutil resize -limits /tmp/Yosemite.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/Yosemite.sparseimage
     # Convert the sparse bundle to ISO/CD master  
     hdiutil convert /tmp/Yosemite.sparseimage -format UDTO -o /tmp/Yosemite
     # Remove the sparse bundle  
     rm /tmp/Yosemite.sparseimage
     # Rename the ISO and move it to the desktop  
     mv /tmp/Yosemite.cdr ~/Desktop/Yosemite.iso

    Copy the above lines, paste it into a new document prepare_yosemite_iso.sh on your desktop with a decent editor (below I use nano) and make it executable. In Terminal enter:

    touch ~/Desktop/prepare_yosemite_iso.sh
    nano ~/Desktop/prepare_yosemite_iso.sh #paste the content of the script here, save the file to disk with ctrl-O and quit nano with ctrl-X
    chmod +x ~/Desktop/prepare_yosemite_iso.sh
  • execute the script:


    After several minutes the iso with the name Yosemite.iso will be moved to your desktop.

  • Start VirtualBox and create a new Yosemite VM with the default settings.
  • If your Mac contains a Haswell processor you have to change the the cpuid in the VM. Enter the following in Terminal:

    VBoxManage list vms #to list all available VMs
    VBoxManage modifyvm <name_of_vm> --cpuidset 00000001 000306a9 00020800 80000201 178bfbff
  • Attach Yosemite.iso to the optical drive

  • Boot the VM, format the hdd, then install and configure Yosemite.
  • Copy the downloaded Install OS X El Capitan.app to the Applications folder in the VM. Use a network share on the host to accomplish that.
  • Start Install OS X El Capitan.app and update the VM to El Capitan.
  • To enable some screen resolutions shut down the VM and enter in (the host's) Terminal:

    VBoxManage setextradata <name_of_vm> VBoxInternal2/EfiGopMode N

    where N can be one of 0,1,2,3,4,5 referring to the 640x480, 800x600, 1024x768, 1280x1024, 1440x900, 1920x1200 screen resolution respectively

  • Do Ruby development...
  • FWIW, my reason for switching from VirtualBox to VMware Fusion was strictly due to performance. VirtualBox is well-supported and seems to work very well, but it's much slower than Fusion in my experience.
    – EmmEff
    Commented Dec 23, 2015 at 20:29
  • @EmmEff Hmm El C. boots in 28 seconds to the desktop using VBox. In Parallels 10.9 needs 39s, 10.8 41s etc and 10.10 is even slower. But I'm restricted to 1024x768 in VBox and a lot of features I'm used to aren't available.
    – klanomath
    Commented Dec 23, 2015 at 20:41
  • Boot time is an irrelevant measure of system performance and I was speaking of VMware Fusion, not Parallels. If you're happy with VirtualBox, then use it. I was simply commenting that VirtualBox is not the fastest solution.
    – EmmEff
    Commented Dec 25, 2015 at 19:34
  • @EmmEff I'm using Parallels/VMware. But the OP needed a solution for VirtualBox. In my answer I recommended Parallels or VMware.
    – klanomath
    Commented Dec 25, 2015 at 20:00

It is very easy to install all the Mac OS versions like Mavericks, Yosemite, and El Capitan on VMware workstations 11. Due to lengthy tutorial, I suggest you to read the complete article from here. Feel free to ask me any question if you face problem during installation.

  • The question - though not very obvious - targets VirtualBox. We all know that installing newer OS Xs in Parallels or VMware is more convenient than in VirtualBox.
    – klanomath
    Commented Dec 24, 2015 at 4:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .