Friday, May 08, 2015

Installing OSX Yosemite on VirtualBox

[note] - The OSX EULA limits what physical machine you may virtualize OSX on. See for the appropriate EULA.

***Creating a Yosemite ISO***

Download the OSX Yosemite installer from the App Store on a Mac, which will place it in the Applications folder.
If you try to download from another source you take your chances with someone hijacking your OS, besides it being an illegal copy.

Run these commands in the Terminal:

hdiutil attach /Applications/Install\ OS\ X\ -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite
hdiutil resize -size 8g /tmp/Yosemite.sparseimage
hdiutil attach /tmp/Yosemite.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
rm /Volumes/install_build/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/
cp -p /Volumes/install_app/BaseSystem.* /Volumes/install_build/
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/install_build
hdiutil resize -size `hdiutil resize -limits /tmp/Yosemite.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/Yosemite.sparseimage
hdiutil convert /tmp/Yosemite.sparseimage -format UDTO -o /tmp/Yosemite
rm /tmp/Yosemite.sparseimage
mv /tmp/Yosemite.cdr ~/Desktop/Yosemite.iso

***Getting the ISO to your other machine[see note]***

Format a USB drive with exFAT. Drive should be at least 8GB. Copy the ISO to there.
OR.. if both machines are on a LAN, share out a folder on your other machine[see note] and connect to it from the Mac. (smb://IPADDRESS-OR-HOSTNAME)

***Working with VirtualBox***

Create a New VirtualBox machine, choosing the latest version of OSX listed as the OS you will be installing. Allow at least 2GB of RAM.
After the setup wizard, once you are back at the main VirtualBox screen, under the VM settings for System change the chipset to PIIX3.

Before booting, execute the following commands replacing Yosemite with whatever you named the new VM. The VBoxManage tool is with the VirtualBox program files, and can be accessed on a Mac in /usr/bin
Change to the appropriate directory at the command line and run the following.

VBoxManage modifyvm "Yosemite" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Yosemite" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Set your Yosemite ISO as the CD/DVD drive in the settings for your VM.

***Installing OSX***

Boot the VM. (At one point it may say LPC device initialization failed and appear to hang; just a wait a minute or two.) At the installer, go to Utilities>Disk Utility and create one Mac OS Journaled partition on the VM hard drive.
Then complete the installer, choosing the hard drive partition you just created.
When I did this I had installation hang at a particular spot for like half an hour. Come to find out that I could not longer find the ISO on the USB drive.
Either the USB drive went out or something deleted the ISO. I got a new copy, put it on my hard drive, and set it to read-only. Then the install went fine.

***iCloud won't work***

iCloud activations are tied to the system serial number. There are some advanced tools that attempt to modify the OSX system files to change this.
Google Chameleon Wizard if you are interested. Not covering here because of the high risk of borking everything and having to start over.

***Disabling Visual Effects***

On the new OSX install, download and install BeamOff. This will need to be run on every boot to work. The visual effects don't get along with the VirtualBox driver.

[note] - The OSX EULA limits what physical machine you may virtualize OSX on. See for the appropriate EULA.

No comments: