In this article we will go through setting up a Virtualbox VM from scratch running MacOS. But first, it’s important to understand this: MacOS is not designed to be virtualised, because Apple does not want it running on anything other than Apple hardware. Therefore there are problems when trying to virtualise MacOS, the most compromising of which being hardware acceleration for graphics will not work in a MacOS VM (unless you’re going to build a Hackintosh with very specific parts, but that defeats the purpose of building a VM). This means performance will basically be garbage. So if you need to use MacOS to actually do work this is not the path for you — build a Hackintosh or buy a Mac. However, having a MacOS VM can be useful for things like troubleshooting issues or testing stuff out. Or just for playing around. If this is what you’re looking for read on.
This tutorial assumes you have Virtualbox installed and virtualisation enabled in your computer’s BIOS. If not, do this first.
The first thing to do is obtain a MacOS virtual disk. For this tutorial we will be using MacOS Yosemite 10.10, as it is the latest version where Beam Sync can be disabled to make performance somewhat ok. Any other version of MacOS can be used, however the performance will be worse. MacOS can be downloaded below:
Once you have downloaded the virtual disk, extract it to whichever directory you would like it to be located:
Now open Virtualbox and create a new virtual machine with the “Type” set to “Mac OS X”, the version set to whichever version of MacOS you are going to use and however much RAM you want to allocate. Make sure to select “Do not add a virtual hard disk”, as we will do this later:
Once the new VM is created, select it and click “Settings”. Then go to the “System” section and change the CPUs allocated to 2 (or more if you want, but it won’t make much difference):
Now go to the Storage section in the Settings, and add a new virtual hard disk (click the disk icon with the + near the bottom of the window and browse to the virtual disk you downloaded earlier):
Once this has been done, close Virtualbox and and any open virtual machines. Open Command Prompt in Windows and browse to the directory where Virtualbox is installed on your computer (the below command uses the default installation directory where it will most likely be located unless you specifically chose somewhere when installing Virtualbox):
cd “C:\Program Files\Oracle\Virtualbox”
Now enter the below command, replacing “VM Name” with whatever you named your virtual machine when you created it in Virtualbox. Also change the resolution at the end to whatever resolution you would like, as this command sets the resolution for your MacOS virtual machine. I chose 2560×1440 because that is the resolution my 27″ monitors use:
VBoxManage setextradata “VM Name” VBoxInternal2/EfiGraphicsResolution 2560×1440
The command to set the resolution can be skipped, however if you do so the resolution of your virtual machine will be the default square resolution, which isn’t very big.
The following commands are required, if you do not run these the virtual machine will not start. Again, remember to replace “VM Name” with the name of your VM:
VBoxManage.exe modifyvm “VM Name” –cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata “VM Name” “VBoxInternal/Devices/efi/0/Config/DmiSystemProduct” “iMac11,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
Now you can open Virtualbox again and start up your MacOS VM. It will take a few minutes to boot, however if you have completed the above steps correctly you will eventually get to the MacOS Welcome screen, where you can setup your virtual Mac:
IMPORTANT: Do not shutdown or restart your MacOS VM until you have finished ALL the steps in this tutorial. You will find out why later on.
Once the setup is complete, try using MacOS. You will notice the performance is garbage, as I warned at the start of this tutorial. This is what MacOS is like without hardware acceleration for graphics. Fortunately there is a third party application called Beamoff which turns off Beam Sync in MacOS, thus improving performance. Unfortunately though Beamoff does not work on versions of MacOS past Yosemite, which is why we are using Yosemite for this. If you are using a later version of MacOS however, skip straight to the enabling automatic login section of this tutorial.
To download Beamoff open Safari on the MacOS VM and browse to “macsx.com/beamoff”. Click the link on the webpage to download it:
In order to allow the application to run go to System Preferences > Security & Privacy and check the “Anywhere” radio button to allow apps downloaded from anywhere:
You can now open the Beamoff application which you downloaded earlier. You should notice a significant improvement in performance, with less lag and choppiness. To have Beamoff run automatically every time you start the virtual machine, go to System Preferences > Users & Groups >Login Items then tick the Beamoff application in the list:
The last thing we have to do (VERY IMPORTANT, DO NOT SKIP THIS) is enable automatic login. This is because in the VM some versions of MacOS glitch out during login and freeze indefinately. If you skip this step your MacOS VM could become unusable upon restart, and you will have to scrap it and create a new VM from scratch.
To enable automatic login go to System Preferences > Users & Groups and select Login Options. In the dropdown menu select your account. You can now safely restart your MacOS VM and it will boot straight onto the desktop, no login screen.
So now you have a working MacOS virtual machine! If you had any unexpected issues or found out a way to improve performance, please leave a comment below to help others who are trying to setup their MacOS VM.