20141018

Installing Yosemite in VirtualBox

Installing Yosemite in VirtualBox is pretty straightforward if you follow those steps.
Running Yosemite inside VirtualBox reveals quite some quirks of VirtualBox which result in some Apps not running at all or unsatisfying, especially things relying on 3D acceleration and sound come to my mind here. More on this later.


The Installation


Downloading the software

At first you need to download "Install OS X Yosemite.app" from the App Store of course. And you need to download and install VirtualBox from https://www.virtualbox.org/wiki/Downloads if you haven't done so already.


Preparing the ISO image


Since VirtualBox needs an ISO image to boot from you need to create one from the downloaded "Install OS X Yosemite.app"

For this purpose I basically adapted the script found here:

http://forums.appleinsider.com/t/159955/howto-create-bootable-mavericks-iso

with stuff from here

https://tekshrek.com/os-x-yosemite-clean-install/

 #!/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  


Adjust the paths in the script if necessary (e.g. if you have moved  the "Install OS X Yosemite.app") and save this script as "prepare_yosemite_iso.sh". Then you cd in Terminal.app to the directory where you saved the script and make it executable with

chmod 755 prepare_yosemite_iso.sh

and run it like this:

./prepare_yosemite_iso.sh




Then you'll find a file called Yosemite.iso on your Desktop. This is the ISO image you need to boot from in VirtualBox later.


Setting up the virtual machine in VirtualBox


The next thing to do is to set up a virtual machine in VirtualBox. Since the latest version of VirtualBox available at the moment (version 4.3.18)



has no build in support for Yosemite we'll set up a virtual machine for Mavericks which will work just fine.

For this just click on "New" inside the VirtualBox Manager



and choose a name for your virtual machine. Set the type to "Mac OS X" and the Version to "Mac OS X 10.9 Mavericks (64 bit)".



Follow the steps of the assistant and leave everything as is, especially the RAM setting since a bug in the UEFI of VirtualBox blocks you from assigning more RAM (the virtual machine simply won't boot, see https://www.virtualbox.org/ticket/13211 ).



The only exception is the format and the size of the virtual hard disk you create, you'll probably prefer the VMDK format over the VDI format since that format can be used with other types of virtual machines (not VirtualBox ones) too




and you better choose a size that exceeds 80GB of maximum size (this size isn't a problem since this amount of storage space isn't allocated right now but the disk grows dynamically in size as needed).


After this step your virtual machine is set up and ready to boot.


Installing Yosemite

Boot up your virtual machine by clicking on "Start". A dialog panel will appear which asks for a "virtual optical disk file". Here our ISO image comes into the game. Click onto that small yellow folder icon next to the pop up button.



Now select the Yosemite.iso created in the first step



and click the "Start" button.



Now at first the EFI boot loader runs



followed by lots of boot messages scrolling by — this is a verbose boot as VirtualBox does it.



After a while the boot process seems to be stuck with the last message "DSMOS has arrived". Don't panic, this is normal, be patient.



After some time the Welcome and language selection screen will appear. Now you'll also probably hear some crackling sound from your speakers. This is the installer trying to play some music which VirtualBox performs very badly, so bad that even the mouse is stuttering and lagging. Now you can either wait until this "music" ends after a time and the mouse behaves normal again or you use the keyboard (arrow keys and tab) to navigate this screen.



Next this screen appears. Don't click on "Continue" right now, we first need to prepare the virtual hard disk.



Choose "Disk Utility…" from the "Utilities" Menu



and format the virtual hard disk.





After this Quit Disk Utility and you're back to the Installer screen. Now click "Continue".





Select the virtual hard disk for installation.




The installation will take some time but require no interaction during this process.





After a reboot you will be asked to select your country (to determine time zones, languages and the like). Again some crackling noise and a stuttering mouse pointer are telling you that VirtualBox is trying to play some "music". Wait for it to end or use the keyboard.




All the following stuff is somewhat self-explanatory and doesn't differ from a normal OS X install.










And there it is in all its beauty!



Don't forget to eject the "DVD", e.g. the ISO image or the installation will start again after the next reboot.


Running Yosemite



As System Information reveals, inside your "Mac" is some very special hardware.



All the 3D acceleration by using OpenGL will not work with this. As you can see by some quirks that originate from the fact, that Yosemite is assuming you're having proper OpenGL (and also OpenCL I guess): look at the corners of the windows and the missing title bar of the about box.



There could also be more RAM but due to https://www.virtualbox.org/ticket/13211 this isn't possible.



But the virtual disk work pretty good so far.



Maps doesn't show a map and even crashes.






Mail I did not test further and Safari seems to work.





That's it for now.




Have fun!

33 comments:

Shlomo said...

Thanks! Works great using my late 2010 MacBook Pro running OS X Mavericks, using VirtualBox 4.3.18.

laurent said...

Hi,
I'd like to know how long you have to wait when it's stuck on "DSMOS has arrived". Because it's veeery long for me.
thx

Unknown said...

So how long after DSMOS has arrived should I have to wait? It's been nearly three hours...

IOOI SqAR said...

@laurent @Sean O'Brien In my case (Early 2011 15'' MacBook Pro running 10.6.8 and VirtualBox 4.3.18) the "DSMOS has arrived" wait was about 10 to 20 minutes IIRC, at least not 3 hours. Did it work out for you?

Unknown said...
This comment has been removed by the author.
Unknown said...

@IOOI SqAR, Nope still fighting with it. I am on a Windows host running the newest version of virtualbox. I've tried many different methods I found from several different sources, but they all end up with DSMOS has arrived

IOOI SqAR said...

@Sean O'Brien: I never tried this on something else than my MacBook, let alone a Windows host. Might be an issue with the CPUID or something else. For some folks changing the CPUID with VBoxManage seems to have helped, but I have no experience here. Try googling the topic.

IOOI SqAR said...

addendum / errata: VirtualBox as of 4.3.18 seems to support assigning more than 3456MB of RAM and 32MB of VRAM. However, only 3.5GB of RAM will actually be allocated and usable. This is an improvement over VirtualBox 4.3.14 where such configurations just failed to boot. See: https://www.virtualbox.org/ticket/13211

Unknown said...

Any luck running Yosemite on Windows's Virtualbox? I succeeded on OSX, but Windows is giving me hassles and I am only able to bring up the recovery boot environment successfully using 'boot.efi' on that partition after install.

Unknown said...

This post has been very helpful, however, ultimately it did not work for me.
I was not able to get past the step with waiting for "DSMOS has arrived" prompt. The process would not continue past this.

Unknown said...

I can't get past "DSMOS has arrived" either. I thought VirtualBox presented an emulated environment that was consistently the same. Why can some people get it going and others can't?

IOOI SqAR said...

@Geoffrey Armstrong I guess that parts of the underlying hardware features get handed over to the VM unmodified. Hence the posts from people modifying the CPUID of the VM. Read the comments here https://www.virtualbox.org/ticket/12802 and google for "virtualbox mac os x guest cpuid"

RMKD said...

Thanks for this! Here is what I got to work for me with the following configuration:
VirtualBox 5.0.0
Host: Mint 17 on Optiplex 755 (also validated on Ubuntu 14.04)
Guest: OSX 10.9 machine to run the Yosemite.iso created through the above script

Note that this uses the cpuidset flag and also starts the vm from a terminal with the vboxmanage command.

#---- configure.sh ----#
#!/bin/bash
#usage: ./configure.sh my_virtual_machine_name

VM_NAME=$1

echo "configuring cpuid and extradata for $1"

vboxmanage modifyvm $VM_NAME --cpuidset 00000001 000306a9 00020800 80000201 178bfbff
vboxmanage setextradata $VM_NAME "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
vboxmanage setextradata $VM_NAME "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
vboxmanage setextradata $VM_NAME "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
vboxmanage setextradata $VM_NAME "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
vboxmanage setextradata $VM_NAME "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

vboxmanage showvminfo $VM_NAME
vboxmanage startvm $VM_NAME

Claude said...

At last... the bits I was missing

I was stuck on "DSMOS has arrived" (waited at least 5 minutes)

host: win7
vBox: 5.0.2, with EFI selected, chipset ICH9
yosemite 10.10: made cd as described here.

my windows version of the configure.sh

@echo off
set VM_NAME=OSX_10TEST2

echo 'configuring cpuid and extradata for %VM_NAME%'
set MANAGE="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"

%MANAGE% modifyvm %VM_NAME% --cpuidset 00000001 000306a9 00020800 80000201 178bfbff
%MANAGE% setextradata %VM_NAME% "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
%MANAGE% setextradata %VM_NAME% "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
%MANAGE% setextradata %VM_NAME% "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
%MANAGE% setextradata %VM_NAME% "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
%MANAGE% setextradata %VM_NAME% "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

%MANAGE% showvminfo %VM_NAME%
pause


thank you for sharing.

whiteangel777 said...

Hey Lars,

thanks for your tutorial. I also had the "DSMOS has arrived"-problem.
I got my MacOSX 10.10 working on VB 5.0.2r + ExpansionPack on a Windows 7 Prof.

First I just got a black screen. This I solved with useing less RAM. Then I hab to chnage the Chipset to PIIX3 and the CPUID is now:
CPUID overrides: Leaf no. EAX EBX ECX EDX
00000001 000306a9 00020800 80000201 178bfbff

I also used the changes of RMDK and Claude.

Thanks Guys.

Danny at KDA said...

Thanks for the instructions! This worked great for creating Yosemite ISO and installing it on VirtualBox (5.0.4) on MacOS Yosemite 10.10.5.

However, using the same process for El Capitan (renaming the files appropriately), the ISO image gets created OK but it fails to boot to Welcome screen (instead, it comes up with UEFI 2.0 shell instead). Any pointers on getting around this problem? Thanks in advance!

Danny

Danny at KDA said...

Quick update: I noticed that VirtualBox this morning is now at 5.0.6 so I've installed that now and El Capitan ISO still won't boot correctly.

Yosemite ISO image comes up correctly with the Welcome message....

Anonymous said...

Still waiting for VirtualBox fix for ElCapitan. Any new leads?

Unknown said...

Thank You very much for the Tutorial! It was a little tricky - but it works. Now i have El Capitan in a VirtualBox.

But i can not register to the App-Store: Store answers it could not register the Mac.
How to fix this?

km said...

raif writes "Now i have El Capitan in a VirtualBox."

Is there an El Capitan fix?

Unknown said...

If anyone managed to get 'El Capitan' (OS X v10.11) up and running, could you please post the changes needed?

Cheers

Unknown said...

I do not know which settings are crucial. Here my working settings:
Tab Motherboard:
Chipset: PIIX3
extended: IO-APIC active
EFI active
Hardware Clock
Processor:
1 CPU (2 crashes)
NO CHECK at PAE/NX
Acceleration:
Paravirtualisation: preset
Hardware-VIrtualisation: VT-x/AMD-V active
Nested Paging active

Danny at KDA said...

I have upgraded VB to 5.0.8 r103449.

I have changed some settings as Ralf [slightly different due to version differences?] but it doesn't help either:

Motherboard tab:
Base Memory: 2048 MB
Chipset: PIIX3 [was ICH9]
Pointing Device: USB Tablet [also tried "PS/2 Mouse" and "USB Multi-Touch Tablet"]
Extended Features:
[ Checked ON ] Enable I/O APIC
[ Checked ON ] Enable EFI (special OSes only)
[ Checked ON ] Hardware CLock in UTC Time

Processor tab:
CPU: 1
Execution Cap: 100%
Extended Features: [ ] Enable PAE/NX [so this is checked OFF]

Acceleration tab:
Paravirtualization Interface: Default
Hardware Virtualization:
[ Checked ON ] Enable VT-x/AMD-V
[ Checked ON ] Enable Nested Paging

Anyone else have any success with booting El Capitan?

Anonymous said...

Thanks for your HowTo!

I made a slightly modified version of your script for creating the Yosemite.iso image:

https://gist.github.com/cellularmitosis/6e902579296e82ec6273

Cheers!
Jason Pepas

Unknown said...

@uShip

Thnx for your improvement on the script; it makes really sense at that point.
BTW, me, I always experience a temporarily unavailable error on the /tmp/yosemite.spareimage file.
I found that this can be manually solved by unmounting it via DiskUtility tool; after unmounting it manually there, I am able to execute the next following steps also manually and after all it seems to work / created the iso file.
Using the unmount instead detach verb with hdiutils command also does not solve this issue.
Did anyone make the same experiences here and maybe found a solution on this?

Regards,
Roger

Danny at KDA said...

Here's instruction on how to make it work for El Capitan:

http://apple.stackexchange.com/questions/198737/install-el-capitan-in-virtual-box-for-testing-purposes

I've tried it myself and booted OK.

Unknown said...

Thanks! This worked perfectly on OS 10.11.2, on a MacBook Pro. Very helpful.

NovaRV said...

Thanks for the great instructions. However, my VBox wouldn't boot properly from the iso. This script for creating the ISO did work for me: https://forums.virtualbox.org/viewtopic.php?f=22&t=77068#p358865

Note that you'll see the 'bluetooth transport' error, but I just ignored it and the boot process continued fine!

Unknown said...

Worked fine. Excellent tutorial. Looking how to get guest additions working. Shouldn't be an issue. Great testing platform for OSX. Thanks.

Unknown said...
This comment has been removed by the author.
CondorPluma said...

Installing Yosemite on a Mavericks host. VirtualBox VM 5.1.12 .
Everything went ok until installer try to copy the files.
I got this error: "OS X could not be installed on your computer. The operation couldn't be completed. Undefined error: 0 . Quit the installer to restart your computer and try again." ,
Any idea?. Thanks.

Unknown said...
This comment has been removed by a blog administrator.
Vinay said...

Here is VirtualBox Inaccessible File Not Found Problem Solution