Home > create_macos_vm_install_dmg, Mac administration, Mac OS X, macOS, Scripting, Virtualization, VMware, VMware ESXi > Creating macOS installer disk images for VMware Fusion and ESXi with create_macos_vm_install_dmg

Creating macOS installer disk images for VMware Fusion and ESXi with create_macos_vm_install_dmg

I’ve had a tool available for a while named create_vmware_osx_install_dmg, but it looks like it has reached the end of the road with macOS 10.12.3. The reason for this is because macOS 10.12.4 has introduced a change that prevents the addition of third-party packages to the OS installer. create_vmware_osx_install_dmg uses the addition of a third-party installer package, so unfortunately this tool cannot be used to generate 10.12.4 or later OS installers.

That said, I still want to be able to create macOS installer disk images for VMware Fusion and ESXi, so I’ve forked create_vmware_osx_install_dmg into a new script named create_macos_vm_install_dmg. create_macos_vm_install_dmg will generate stock OS installer disk images for the following OS versions:

  • Mac OS X 10.7.x
  • OS X 10.8.x
  • OS X 10.9.x
  • OS X 10.10.x
  • OS X 10.11.x
  • OS X 10.12.x

This script does not use a third-party package, so it is able to build a macOS 10.12.4 installer disk image. For more details, see below the jump.

Downloading the script

The create_macos_vm_install_dmg script is available from the following location:

https://github.com/rtrouton/create_macos_vm_install_dmg

Once you have the script downloaded, run the create_macos_vm_install_dmg script with two arguments:

  1. The path to an Install macOS.app or the InstallESD.dmg contained within.
  2. A directory to store the completed disk image in.

Example usage:

If you have a 10.12.4 Sierra installer available, run the script using this command:

sudo /path/to/create_macos_vm_install_dmg.sh "/Applications/Install macOS Sierra.app" /path/to/output_directory

Screen Shot 2017 03 30 at 9 55 12 AM

You will be given a choice as to whether or not you want an .iso file for use with ESXi.

Screen Shot 2017 03 30 at 9 55 33 AM

If you choose to not create the .ISO file, this should produce a .dmg file inside the specified output directory that is named something similar to macOS_InstallESD_10.12.4_16E195_20170329111134.dmg. This DMG will install a stock factory install of macOS 10.12.4.

Screen Shot 2017 03 30 at 10 09 08 AM

If you choose to create the .ISO, you should have two files inside the specified output directory, named something similar to macOS_InstallESD_10.12.4_16E195_20170329111134.dmg and macOS_InstallESD_10.12.4_16E195_20170329111134.dmg.iso

Screen Shot 2017 03 30 at 10 08 56 AM

 

Creating a VM with the OS installer disk image

1. Launch VMWare Fusion 8.5.x

2. In VMWare Fusion, select New… under the File menu to set up a new VM

3. In the Select the Installation Method window, select Install from disc or image.

Screen Shot 2017 03 30 at 10 09 43 AM

4. In the Create a New Virtual Machine window, click on Use another disc or disc image…

Screen Shot 2017 03 30 at 10 13 15 AM

5. Select your macOS installer disk image file and click on the Open button.

Screen Shot 2017 03 30 at 10 10 24 AM

6. You’ll be taken back to the Create a New Virtual Machine window. Verify that the disk image file you want is selected, then click the Continue button.

Screen Shot 2017 03 30 at 10 10 37 AM

7. In the Choose Operating System window, set OS as appropriate then click the Continue button.

In this example, I’m setting it as follows:

  • Operating System: Apple OS X
  • Version: macOS 10.12

Screen Shot 2017 03 30 at 10 10 46 AM

8. In the Finish window, select the Customize Settings button if desired. Otherwise, click the Finish button.

Screen Shot 2017 03 30 at 10 10 52 AM

Screen Shot 2017 03 30 at 10 10 53 AM

9. Save the VM file in a convenient location.

Screen Shot 2017 03 30 at 10 11 01 AM

The VM is now configured and set to use the macOS installer disk image. To install macOS, start the VM and then do nothing. The VM should begin automatically installing macOS on the VM’s boot drive and reboot itself to the Setup Assistant when finished.

Screen Shot 2017 03 30 at 11 13 53 AM

Screen Shot 2017 03 30 at 11 29 39 AM

Screen Shot 2017 03 30 at 11 31 12 AM

  1. c9mere
    September 26, 2017 at 7:50 pm

    works very well, thank you!

  2. October 19, 2018 at 10:40 am

    The script doesn’t work for Mojave anymore … Any chance you’ll be updating it?

  3. cbr600
    February 10, 2019 at 6:36 am

    I just used it on Mojave for Fusion 11. I works great.

  4. Larry
    July 3, 2019 at 8:20 pm

    Not working on my new Mac mini 2018 6core, it runs thru install and then when the vm reboots it kernel panics inside the VM. Trying to install macOS High Sierra

  5. February 3, 2020 at 9:04 pm

    I’m running OS X Mojave 10.14.6. I tried running the create_macos_vm_install_dmg.sh script to create an El Capitan 10.11 image but it failed and gave me this error message:
    — This script supports building installer disk image files for macOS 10.12.0 and later.
    — Please use an installer app which installs macOS 10.12.0 or later.

    So I tried using the other script create_vmware_osx_install_dmg.sh and got this error message

    — /Users/richardcacciato/Downloads/create_os_x_vm_install_dmg-master/support/First Boot Package Install.pkg not found! This is needed for the OS to install properly, exiting..
    — The script is expecting the following:
    — A. That a first boot installer package is stored in /Users/richardcacciato/Downloads/create_os_x_vm_install_dmg-master/support.
    — B. That the first boot installer package is named as follows: First Boot Package Install.pkg

    What am I doing wrong? Thanks.

  1. No trackbacks yet.

Leave a comment