In this article, we'll get macOS Sierra 10.12 up and running on VMware ESXi.

macOS Sierra on ESX

As we know, running OS X and macOS virtual machines is fully supported by VMware and Apple on qualified hardware / versions.

Warning: If you are using Mac Pro 6,1 hardware, please stay tuned to VMware KB2149537 for the latest on support for ESX 6.5.

Deploying macOS

Typically, it's quite simple to deploy OS X / macOS virtual machines on ESX. However, sometimes you may find yourself having to create an ISO and you just don't want to deal with it.

Enter, VMware Fusion. Unlike ESX (bare-metal hypervisor), Fusion is a type-2 hypervisor (a.k.a. hosted) that runs as an app on your Mac. From here you can create and run VMs locally which is what most people use it for. However, you can also copy and manage VMs on ESX (similar to vCenter).

Overview - Build VM on Fusion and Copy to ESX

  1. Download and install VMware Fusion
  2. Download macOS Sierra from the App Store (free)
  3. Create a new VM in Fusion
  4. Drag and drop the .App onto the VM
  5. Allow VM to build
  6. Shutdown VM
  7. Connect Fusion to ESX
  8. Copy VM
  9. Upgrade virtual hardware for ESX 6.5 compatibility
  10. Change OS type to macOS 10.12 from Edit Settings
  11. Power on VM from Fusion Interface or vSphere Client

Downloading macOS Sierra

You are probably already running macOS Sierra on your personal device. However, you may need to download it again. Simply navigate to the App Store and search for macOS Sierra.

macOS Sierra on the App Store

The link will either say Download or Open. If it is the latter, you already have the required binaries in your Applications folder.

The installer downloads to 'Applications/Install macOS Sierra.app'
macOS Sierra in the Applications folder

Nostalgia

You may notice in the App Store you can download your previous OS X versions you are licensed for.

Previous OS X Versions

You can still install older versions (i.e. Mountain Lion or Yosemite) and upgrade all the way through if you like that. This is certainly not required though.

Drag and Drop

Simply drag and drop your macOS Sierra installation source (i.e. USB Image or .App) onto the newly created Fusion VM. Just drop it anywhere on the blue square to the left.

Provide Installation Source

Fusion created install source

File this under Amazing! In addition to creating the virtual machine, it's boot disk, assigning CPU and Memory, etc., Fusion also creates the perfect installation media for your macOS install.

Using the USB Image or .app you provided, Fusion then creates two files (.dmg and .vmdk). The dmg file is the payload you dragged and dropped earlier. The vmdk is used as a pointer to the installation media that the VM can reach.

A look at the two files created by Fusion:

$ ls -lh
4.7G May 14 17:08 Temporary Installation Source Disk.dmg
352B May 14 17:08 Temporary Installation Source Disk.vmdk

Contents of the .vmdk

The .vmdk file is a small text file containing metadata to help us point to the .dmg

$ cat ./Temporary\ Installation\ Source\ Disk.vmdk
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=60d3ea39
parentCID=ffffffff
isNativeSnapshot="no"
createType="monolithicFlat"

# Extent description
RW 9897224 FLAT "Temporary Installation Source Disk.dmg" 0

# The Disk Data Base 
#DDB

ddb.adapterType = "lsilogic"
ddb.longContentID = "f912acc541f3bd17c27f2b7460d3ea39"
ddb.virtualHWVersion = "6"

Contents of the .vmx

By looking at the .vmx, we can see that the .vmdk is added as an additional drive to the VM (sata0:2 in this case).

$ cat ./*.vmx | grep sata
sata0.present = "TRUE"
sata0:0.present = "TRUE"
sata0:0.fileName = "Virtual Disk.vmdk"
sata0:1.present = "TRUE"
sata0:1.autodetect = "TRUE"
sata0:1.deviceType = "cdrom-raw"
sata0:1.startConnected = "FALSE"
sata0:2.present = "TRUE"
sata0:2.fileName = "Temporary Installation Source Disk.vmdk"
installationSourceDevice = "sata0:2"
sata0:2.redo = ""
sata0:0.redo = ""
sata0.pciSlotNumber = "36"

How it works

Since we can only mount a vmdk to a VM and not a .dmg, this clever technique from the Fusion team does the mapping for us behind the scenes. These files are also valid for use on ESX too. How cool is that.

Installation Source Added as vmdk

Usage

After deploying the VM on Fusion, you can then copy the entire VM to ESX.

Example - Fusion connecting to ESX

Fusion-to-ESX

Example - ESX receiving the Fusion Migration

Fusion VM upload to ESX is Import-vApp

ESX Tip: Make sure to upgrade virtual hardware, change your guest os type to 10.12 and upgrade VMware Tools.

Upgrade Virtual Hardware

Deploying on ESX

We know that we can always use Fusion because they are first on the latest operating system support (often long before ESX).

Whats cool is that you can copy the 2 files (.dmg and .vmdk) that we created earlier and place them on an ESX datastore. Just use the datastore browser of the vSphere Host Client.

Now, when creating new macOS VMs on ESX, you can add the Temporary Installation Source Disk.vmdk as an additional drive (i.e sata0:2). That's all you need to begin a fresh macOS Sierra 10.12 build.

Disclaimer: I should mention that VMware probably did not intend for us to use these Fusion files on ESX in this manner. It does work though, so if you cannot get your installation media working directly on ESX, these techniques are for you!

Summary

We covered a technique that can be used to deploy macOS Sierra 10.12 VMs on VMware Fusion and/or ESX. There may be easier and more efficient methods. This is just one.