Install macOS Sierra as a VM in VMware Fusion

For those wondering if you can install macOS Sierra as a VM in Fusion, the answer is: Yes you can!


<rant> It does require a bit of a workaround however. VMware Fusion uses their own custom script to create a temporary VMDK which the VM boots off. They've been using this since Mavericks and quite frankly, it's time to drop their own custom nonsense as Apple has been providing 'createinstallmedia' for a few years now. </rant>


What you'll need:

  • Latest greatest macOS Sierra installer (obviously)
  • VMware Fusion 8.1.1 (only tested on this version)
  • Bit of CLI skills
  • Freshly created VM (I just created a custom vm with stock standard settings choosing OS X 10.11 as the type)


Part 1: Creating the installer disk image.

Fire up Disk Utility and create a blank sparse disk image or use 'hdiutil', whichever you like. Size: 6GB.

hdiutil create -size 6GB -fs JHFS+ -volname "macOS_installmedia" -type SPARSE ~/Desktop/macOS_installmedia


Mount it (or double-click in Finder to mount):

hdiutil mount ~/Desktop/macOS_installmedia.sparseimage


Next use ‘createinstallmedia' from the macOS Installer:

sudo /Applications/Install\ 10.12\ Developer\ Preview.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS_installmedia --applicationpath /Applications/Install\ 10.12\ Developer\ Preview.app


Part 2: Make the vmdk

The newly created install media should still be mounted, if not just mount the macOS_installmedia.sparseimage again.


Before we start, you need the device id of the mounted sparse disk, so run ‘diskutil list’. Look for the volume “Install 10.12 Developer Preview” and note the device id for that disk, in my environment this was: ‘/dev/disk2’


Next we need to create a vmdk, for this we use ‘vmware-rawdiskCreator’. Specify the path so that the resulting vmdk is created inside your freshly created VM’s folder (just simplifies the next step).


/Applications/VMware\ Fusion.app/Contents/Library/vmware-rawdiskCreator create /dev/disk2 2 ~/Documents/Virtual\ Machines.localized/macOS.vmwarevm/macOS_installmedia lsilogic


What we have now, is a vmdk pointer that refers to our mounted sparsedisk (thus, don’t try and unmount the sparsedisk).


Part 3: Attach vmdk to your VM

Unfortunately you can’t attach an existing vmdk that happens to be a rawDisk, so we need to edit the vmx file for our VM.

Navigate to it, in my case that would be ~/Documents/Virtual\ Machines.localized/macOS.vmwarevm

Use your favourite editor, such as vi or nano, then add these lines (added mine right below the first set of sata0*** lines to macOS.vmx (or whatever you happen to call your VM):

sata0:2.present = "TRUE"
sata0:2.fileName = "macOS_installmedia.vmdk"
sata0:2.deviceType = "rawDisk"
suspend.disabled = "TRUE"


Save the vmx file


Part 4: Power On

Ignition, launch! All should be working at this point and your VM should be booting up just fine, unless either one of us messed up somewhere along the line.


Once the install has run through, you can power it off and remove the lines you added in the vmx file in Part 3.

Replies

In Part 3, the first sentence makes no sense. Strangely I can't find an edit button for my post?! Anyhow, what I meant was you can't attach an existing rawDisk vmdk via Fusion's interface, hence the need to edit the vmx.

Just tried this out on VMware 8.1.0. I changed "/dev/disk2" to "/dev/disk3" to match my case, and had to manually select the disk in the VM settings boot section (it didn't automatically boot to it, just failed after trying to boot instead to the empty disk). The install went smoothly and the beta is running now! Thanks for the post!

Weird, created the VM twice as I wrote the post to make sure I'm not missing something and both times it booted automatically. Oh well. You can also try this link to build the installer image. https://github.com/rtrouton/create_os_x_vm_install_dmg Rich confirmed to me earlier that this also works as he set up his Fusion VM using his script.

>Strangely I can't find an edit button for my post?!


For authored posts, use the 'Actions' (gear) icon above on the right.