*** HIGH SIERRA UPDATE ***
We have a pull request on our patch that can be used instead of the ‘main’ branch which will work with macOS High Sierra. I’ll be writing in more detail about this soon, but the process is the same, just use this version of the .tool.
*** [old] UPDATE ***
We fixed the script that was causing this to happen and needed this workaround. Now you can just update the script and it will ‘just work’ when you drag the Install .app onto Fusion’s New VM Creation Wizard.. Details here
Original post below
It’s that time of year again! With #WWDC2016 in full swing, Apple has graced us with an insider look at the next big OS release for the newly renamed macOS, dubbed Sierra.
By default, it doesn’t work in Fusion as a virtual machine the same way users would expect by simply dragging the installer .app onto Fusion. (We’re working on it 😉
Luckily, we can use some tools built into OS X El Capitan (and earlier) to get this working in a VM.
At a high level, we need a blank OS X 10.11 (custom) VM, and we need to leverage command line tools (with links to their respective docs):
- Apple’s ‘createinstallmedia‘ CLI tool which is bundled with the “Install 10.12 Developer Preview.app”
- VMware’s ‘vmware-rawdiskCreator‘ tool to create the actual disk where we will be installing to.
First, you’ll need to have a blank, custom VM.
This is straightforward, but I’ll walk through just so you have it.
- From Fusion go File > New
- From the ‘New VM’ wizard we would choose ‘Create Custom VM’
- Choose the OS version OS X 10.11
- Choose ‘Create New Disk‘
- Save the VM wherever you please
- I customized it to add more RAM, bumping it to 4GB (4096MB) just to be on the safe side.
When you have your new blank VM, we now need to do 3 things:
- Create the installation media “sparse image”
- Copy contents of the installer into the new installation media sparse image
- Create a .vmdk which ‘points’ to the installation media sparse image (now filled with the contents of the installer) that we just created.
So to do that we start with Mac’s Disk Utility app. You’ll find it in your /Applications/Utilities folder (or do like I do and hit cmd-space and search Spotlight for ALL THE THINGS… 😉
In Disk Utility go File > New Image > Blank Image… and use the settings I have in the image below (call the file whatever you like, but make sure it has the following:
- Size = 6GB (absolutely not smaller)
- Format = OS X Extended (Journaled)
- Encryption = none
- Partition = Single Partition – GUID Partition Mac
- Image Format = sparse disk image
This creates the blank slate that we will then copy the contents of the “Install 10.12 Developer Preview.app” into using ‘createinstallimage’ utility.
It should ‘mount’ the new image we just created, but if it’s not there you can mount it with Disk Utility or from the command line. Mine mounted automatically.
Once it’s mounted we can copy the contents of our installation app into the new sparse image.
For this, we jump down to the command line and run some commands.
First, let’s create our install media.
Run the following command (all one line):
sudo /Applications/Install\ 10.12\ Developer\ Preview.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS-10.12_DP --applicationpath /Applications/Install\ 10.12\ Developer\ Preview.app
I named the thing I created with Disk Utility ‘macOS-10.12_DP’ as you can see in the ‘Name’ field in the image above.
Easy peasy… contents copied, new installation media is created with the sparse image we just created, filled with the contents of the installer .app we got from Apple.
Now, let’s make sure the host Mac’s disk layout is okay with “diskutil list“:
(for clarity, $ is the prompt at the terminal, you do not need to type it)
$ diskutil list
It outputs something like the image below:
We can see that I have the ‘Install 10.12 Developer Preview’ mounted as /dev/disk2s2. We need this device id because this is the prepared installation media that we’ll be installing from in the blank virtual machine we created earlier, and the disk number may change depending on what you have mounted on your system.
Now we use VMware’s ‘vmware-rawdiskCreator’ tool to create a .vmdk based on the sparse image we created.
The syntax is as follows:
<path to vmware-rawdiskCreator> create <device id> <partition id> <path to where we want the .vmdk to be saved> <bus type>
So a few things about that so we understand what’s happening:
- vmware-rawdiskCreator is located within the Fusion app bundle itself, so we’ll point to that
- create is the vmware-rawdiskCreator function that will create a new “raw” disk
- <device id> is the /dev/disk2 that we saw earlier, yours may be different if you have other disks mounted.
- <partition id> is 2 because it’s the 3rd partition on the ‘device’, and numbering starts at 0 (so 0 = first, 1 = second…)
- We tell it where we want it to be saved, and in our case it will be within the VM bundle that we created at the beginning
- <bus type> we choose lsilogic so that it behaves like a CD-ROM.
So, for me the command is as follows (all one line):
$ /Applications/VMware\ Fusion.app/Contents/Library/vmware-rawdiskCreator create /dev/disk2 2 ~/Documents/Virtual\ Machines.localized/macOS_10.12.vmwarevm/macOS_installationmedia lsilogic
It should take a few seconds to make the new .vmdk.
Okay, breathe… we are about to get the actual install started.
Because Fusion doesn’t support mounting raw disks using the UI, we just have to add it to the configuration file manually.
In the Virtual Machine Library window, right-click your newly created OS X 10.11 VM.
If you hold down the ‘Option’ key you’ll notice some options change… including ‘Edit config file in a text editor’ (I couldn’t take a screenshot due to the need for multiple key presses).
With the config file open in TextEdit, paste the following either at the bottom or with the other SATA device to keep them together (if you’re a little ocd about it like I am 😉
sata0:2.present = "TRUE" sata0:2.fileName = "macOS_installationmedia.vmdk" sata0:2.deviceType = "rawDisk" suspend.disabled = "TRUE"
Notice the file we’re pointing at is ‘macOS_installationmedia.vmdk’… that’s the one we just created with our vmware-rawdiskCreator tool, and it’s a relative path meaning it’s in the same folder as the config file (.vmx) itself.
Close the document (if you’re using TextEdit it will save automatically).
Now all that’s left is to press ‘Play’ on the VM and go through the installation!
It’s a bit of hack, but we’re working on making it just as seamless as installing current and earlier versions of OS X on Fusion.
To recap, we did the following:
- Downloaded the macOS 10.12 Developer Preview
- Created a blank VM with OS X 10.11 as the type
- Created a sparse disk for the install media
- Copied the install media to the sparse disk
- Used vmware-rawdiskCreator to create a .vmdk based on the sparse disk with the installation media
- Boot and install
Once the installation is done you can delete the extra hard disk because it’s no longer needed, and you can’t suspend the VM while a raw disk is attached.
Hope that helps folks looking to try the latest that Apple has to offer!
Let me know in the comments how that’s working out for you, if you have any suggestions, or need clarity on anything I’ve written here!
Thanks commenters for the feedback!
a few things…
Reader nutmeg noted the following, which I totally agree with:
One minor nitpick After installation, one should shut down the VM (via macOS Shutdown option), then re-edit the VM configuration file and remove 4-line entries:
sata0:2.present = “TRUE”
sata0:2.fileName = “macOS_installationmedia.vmdk”
sata0:2.deviceType = “rawDisk”
suspend.disabled = “TRUE”
If you don’t delete these lines you end up with weird ‘bootcamp’ related errors… (we use rawdiskcreator for bootcamp installs, naturally)… And because it’s a raw-disk it can’t be deleted from the UI (because that would break a bootcamp VM so we disallow that).
Reader Leslie notes something that I often take for granted when posting technical instructions about command line operations:
To everyone getting “Unable to copy the source files (…) ” – just look into vmwarevm content and delete macOS_installationmedia (both of them) file from there then try to create raw disk again! And please do not copy paths from here, just drag n’drop files from Finder in order to get it. And it will work for sure. I am living proof ????
Thanks for the feedback, friends!