As most people probably notice, the .vmdk files created by VMware for Mac OS X Operating Systems tend to continuously grow as time passes by, getting bigger and bigger after each update.

Mac OS X 10.5 Leopard Server, 10.6 Snow Leopard Server, 10.7 Lion client or server, 10.8 Mountain Lion client or server and 10.9 Mavericks client or server are fully supported on VMware Fusion while running on supported Apple hardware. Notes: You can use Horizon Client for Mac OS X to securely access remote Windows-based applications, in addition to remote desktops. You can use remote Windows-based applications only if you are connected to a VMware Horizon 6.0 with View or later server.

Luckily enough, there’s an easy fix that can be manually performed to reduce the vmdk file size. Here’s how you can pull it off in two steps, the first one within the guest OS (the Mac OS X) and the latter on the hosting PC environment.

  • Launch your guest OS X Virtual Machine.
  • Open the Finder app and retrieve the actual name of the HDD you need to shrink (for example, “Macintosh”).
  • Open Terminal > Shell and issue the following command:
    • sudo diskutil secureErase freespace0Macintosh
      • use su instead of sudo for Mac OS X 10.9 or lower.
      • if you receive a “Macintosh HD not found” error, open the Finder app again and be sure that the HDD name matches the one you wrote.
  • Wait for the command to terminate its task: be warned that it will probably require some time (10+ minutes or more), depending on the current vmdk disk size and the performance of the hosting machine’s storage unit. It’s worth noting that when it comes around 90 percent a VMware error popup could possibly appear, which you can safely ignore (by hitting the Continue button) as long as it will continue the task up to completion.
  • Once done, shutdown the Mac OS X VM – be sure to do that!
  • On your main/hosting PC, open a Command Prompt (or Terminal > Shell) with elevated priviledges and type the following command:
    • VMware-Pathvmware-vdiskmanager.exe-kVM-PathVM-name.vmdk
      • (replace VMware-path with the path of VMware installation folder and VM-path with the path of the .vmdk file to shrink).

The last operation can take some time (30+ minutes), but as soon as it’s done your .vmdk file will be shrinked down to its real and correct size, possibly saving up GBs of space!

Here are some screenshots showing the whole process: the first command on the Guest OS (Mac OS X Sierra):

The 90% VMware error message that you can safely ignore by hitting Continue:

And the command to be issued within the Hosting OS (Windows 10):

That’s it! I sincerely hope that this procedure will help those who are struggling with this nasty issue, until VMware will implement the option to automatically perform such task.

Learning has never been so easy!

We all know VMWare start to supporting Mac OS X as VM on latest ESXi hypervisor releases. According to Apple licensing policies, VMware only supports the virtualization of Apple Mac OS X 10.10 (Yosemite) client or server, Apple Mac OS X 10.11 (El Capitan) client or server, Mac OS X 10.9 (Mavericks) client or server, Mac OS X 10.8 (Mountain Lion) client or server, Mac OS X 10.7 (Lion) client or server, 10.6 (Snow Leopard) server and 10.5 (Leopard) server.

The End User License Agreement (EULA) for Apple Mac OS X legally and explicitly binds the installation and running of the operating system to Apple-labeled computers only. Mac OS X 10.5 Leopard Server, 10.6 Snow Leopard Server, 10.7 Lion client or server, 10.8 Mountain Lion client or server and 10.9 Mavericks client or server are fully supported on VMware Fusion while running on supported Apple hardware.

In this HOWTO, provided the steps to create an Mac OS X 10.9 Mavericks as a VM in ESXi 6.0 Host for a test case scenario. Before deployment, you must read EULA for Apple Mac OS X license, given link at the end of this HOWTO.

8 Steps total

Step 1: Steps to do

1. VMware ESXi 6.0 doesn’t support OS X out of the box. So, the first thing you need to do is to customise the hypervisor layer by executing an Unlocker script by insanelymac.com. You will need to register on the site in order to download the Unlocker tool.

2.You need to enable SSH server service on your ESXi host. In order to do that, login to the host using VMware vSphere Client and navigate to Configuration->Security Profile. From here click on Properties in the upper right corner where it says Services. The dialog Services Properties should appear and from here you can click on SSH->Options and choose Start and Stop with host. Click Start and then close all the open dialogs.

3.Transfer the Unlocker-files to the host using any SFTP client. Make sure you extract the files somewhere on your client before transfer and connect to the ESXi host using the user root. Once connected navigate to /vmfs/volumes/datastore/, replacing datastore with your actual datastore name. Create a new folder (mkdir) called tools and transfer your unlockerXXX directory.

4.Now cd into the uploaded directory and ensure the ESXi scripts have execute permissions by running chmod +x esxi-install.sh. Now run ./esxi-install.sh in order to install the Unlocker.

5. Reboot ESXi host.

Step 2: Download and create the bootable OS X Sierra ISO

Grab the Sierra installer app from the Apple App Store. Note, you need a Genuine Mac machine in order to download and convert the Sierra installation disk. Once downloaded, minimize or close the installer.

Open the terminal and run the below command one after another.

# Mount the installer image

hdiutil attach /Applications/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app

Mac Os For Vmware Download

# Create the Sierra Blank ISO Image of 7316mb with a Single Partition – Apple Partition Map

hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J

# Mount the Sierra Blank ISO Image

hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build

# Restore the Base System into the Sierra Blank ISO Image

asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase

# Remove Package link and replace with actual files

Vmware Client For Mac Os 10.9.5 Download

rm /Volumes/OS X Base System/System/Installation/Packages cp -rp /Volumes/install_app/Packages /Volumes/OS X Base System/System/Installation/

# Copy Sierra installer dependencies

cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS X Base System/BaseSystem.chunklist cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS X Base System/BaseSystem.dmg

Vmware Client For Mac

# Unmount the installer image

hdiutil detach /Volumes/install_app

# Unmount the Sierra ISO Image

hdiutil detach /Volumes/OS X Base System/

# Convert the Sierra ISO Image to ISO/CD master (Optional)

hdiutil convert /tmp/ElCapitan.cdr.dmg -format UDTO -o /tmp/ElCapitan.iso

# Detach the volumes

hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/OS X Base System/
hdiutil convert /tmp/Sierra.cdr.dmg -format UDTO -o /tmp/Sierra.iso

# Rename the Sierra ISO Image and move it to the desktop

mv /tmp/Sierra.iso.cdr ~/Desktop/Sierra.iso

Note : Once done it should have created a file called Sierra.iso on your desktop.

Step 3: Create a virtual Mac OS X VM

The next step should be fairly simple if you have used ESXi before. As usual open your datastore and transfer the iso to wherever you normally store your installation files.

1. Create a New VM
2.Select Typical and you should be able to select Other and then Apple Mac OS X 10.10 (64-bit). Complete the wizard, mount the ISO and install Mac OS X as usual.

Step 4: Mac OS X Installation steps - Language selection

Choose desired language once you see the welcome screen

Step 5: Mac OS X Installation step - Formatting the hard drive.

Also note that you must format the hard drive using the disk utility before it will be visible in the install wizard.

Mac os for vmware workstation

Step 6: Mac OS X Installation step - Choose Virtual disk and erase the partition

Choose Virtual disk and erase the partition

Step 7: Mac OS X Installation step - Choose Virtual disk and erase the partition 2

Give a name and click “Erase”.

Click “Continue” button on the next consecutive screen, choose the Virtual HDD which is created and proceed the installation with on-screen instructions

Step 8: Configure Mac OS X after install

It’s very important to install the VMware Tools as soon as possible after the install has finished. Without it Mac OS X might not awake from sleep and in general be very unreliable.

Very Important : I also recommend to turn off sleep and the screensaver in settings as these may cause issues.

Finally, reboot and start enjoying your virtual Mac on non-Apple hardware.

Vmware Client For Mac Os 10.9.5

You may also wish to read the software license agreement for Mac OS Sierra provided in the References section.

As said, using Apple Mac OS X as a VM on vmware environment is subject to apple EULA. VMWare recommend to use VMWare fusion for installing Mac OS X 10.9 Mavericks.

References

  • Apple EULA
  • Installing OS X 10.9 Mavericks as a guest operating system in VMware Fusion (2056603)
  • Virtualizing Apple Mac OS X (1000131)

3 Comments

  • Anaheim
    thelaz Apr 25, 2017 at 03:30pm

    Tried this - didn't work for me. Never made it to install screen. Did I miss anything that says this is for Apple hardware only? There's a ton of these guides out there that are generally the same - to my knowledge those that include the unlocker step are for non-Apple platforms.

  • Sonora
    Master RX Sep 25, 2018 at 09:32pm

    Hello, it worked for me. with the process I was able to create an ISO for Yosemite macOS. however it does not work for me to create an iso of macOS Mojave. you know if the creation process has changed or if it's just mojave can not be used with VM

  • Habanero
    Gopal (Vembu) Sep 26, 2018 at 06:03am

    Master RX

    Yes, We tried with Yosemite and Sierra macOS only, since it was the latest that time. We have not tried with Mojave yet, and not sure process has changed.