MacOS – yosemite on yosemite in virtualbox

macosvirtualboxvirtualization

I would like to run yosemite in virtualbox on yosemite. I've tried many step-by-step guides, without success. While there is a lot of descriptions on how to install hacked OS X on windows, I want to stay legal and use unmodified OS X, only in a virtualized manner.

Tried:

  • create ISO from /Applications/Install OS X Yosemite.app (at least two different ways) and supply it as Bootable CD and
  • create bootable USB and attached it as virtual disk

but boot always get stuck with Missing Bluetooth Controller Transport! message. There is a youtube video on how to eliminate this issue, but I'm not sure on how to set boot flags in virtualbox (tried: VBoxManage setextradata osx "VBoxInternal2/EfiBootArgs" "-s", then boot displayed bash prompt for a second, but couldn't type anything there). I've also tried to set cpuidset (was suggested in one article) via VBoxManage modifyvm osx --cpuidset 1 000206a7 02100800 1fbae3bf bfebfbff, but that made no difference, neither.

I need all this hassle, because I want to create a build environment setup script, therefore

  1. I should be able to throw away my os state at any time and start fresh.

Also

  1. I don't want to install every sort of dev tools, because I want to keep clean my machine for daily use and
  2. I want to be able to have multiple dev environments with different setups (for work and for my sandbox projects)

I'm also new to mac community. I appreciate any help. Thank you in advance.

Best Answer

Download Install OS X Yosemite from the Mac App Store. Use iesd to create a bootable dmg:

iesd -i "/Applications/Install OS X Yosemite.app"/ -o yosemite.dmg -t BaseSystem

Install VirtualBox for Mac Hosts

Create a new VirtualBox guest. Choose Type: [Mac OS X] and Version: [Mac OS X (64-bit)]. Don't choose a specific OS version.

After you create the guest, choose it and click Settings->System->Motherboard->Chipset and choose PIIX3. If you leave the default ICH9 set, the system will never boot. You'll just see a black screen in your guest window.

Choose the yosemite.dmg you created earlier for your guest's optical disk.

Start your guest.

You'll see a wall of text and eventually the OS X Installer screen.

Use disk utility to partition your disk into a single partition. Disk Utility will have proper defaults.

Exit disk utility and run the installer.

You'll find some steps like these below in other places, but they didn't work for me. iesd worked.

 #!/bin/bash  

 # 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