Home > create_vmware_osx_install_dmg, Mac administration, Mac OS X, Scripting, VMware, VMware ESXi > create_vmware_osx_install_dmg script updated with El Capitan support

create_vmware_osx_install_dmg script updated with El Capitan support

I’ve updated the create_vmware_osx_install_dmg.sh script that I had previously posted about here. The script now includes support for El Capitan, so the script can now be run on 10.7 – 10.11 to create custom OS X 10.7.x, 10.8.x, 10.9.x, 10.10.x and 10.11.x installers for VMware Fusion and VMware ESXi. See below the jump for the details.

Downloading the script and support files

Download a .zip archive containing all needed files from my GitHub repo. This will give you both the create_vmware_osx_install_dmg script and a directory named support which contains files that the script will be copying into the completed disk image.

Screen Shot 2015 10 17 at 3 46 03 PM

 

Both the create_vmware_osx_install_dmg script and the support directory must be stored in the same directory in order for the script to work properly.

Once you have the .zip archive download and uncompressed, go into the support directory and unzip the First_Boot_Package_Install.zip file. First Boot Package Install.pkg is used by the script so it’ll need to be unzipped and prepared before running the script.

Screen Shot 2015 10 17 at 8 12 00 PM

Note: The First Boot Package Install.pkg included with this script will automatically install all available Apple software updates following the OS installation, but provide no other customization for the VM.

 

Creating a customized first boot package

If you want to have a first boot package that installs other packages at first boot, I’ve written a tool named First Boot Package Install Generator.app that will generate a first boot package that works with this script.

NOTE: The customized OS X installer will have an upper limit of 350 MBs of available space for added packages. This is sufficient space for basic configuration, payload-free or bootstrapping packages, but it’s not a good idea to add Microsoft Office or similar large installers to this installer.

For details on how to use First Boot Package Install Generator.app to generate your first boot package, please see this post:

https://derflounder.wordpress.com/2014/10/19/first-boot-package-install-generator-app/

When using a first boot package with this script, the script has the following hard-coded requirements:

  1. That the first boot package is named First Boot Package Install.pkg
  2. That the first boot package is stored in the support directory.

 

Running the script to create a customized OS X install .dmg file

Once you have the first boot package available and configured to your preferences, run the create_vmware_osx_install_dmg script with two arguments:

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

Example usage:

If you have a 10.11.0 El Capitan installer available, run this command:

sudo /path/to/create_vmware_osx_install_dmg.sh "/Applications/Install OS X El Capitan.app" /path/to/output_directory

Screen Shot 2015 10 17 at 10 05 39 PM

 

If you had chosen to not create the .ISO file, this should produce a DMG file inside output_directory that’s named something similar to OSX_InstallESD_10.11_15A284.dmg. This DMG will install both OS X 10.11.0 and the first boot package.

Screen Shot 2015 10 17 at 10 21 29 PM

If you chose to also create the .ISO, you should have two files inside the chosen directory: OSX_InstallESD_10.11_15A284.dmg and OSX_InstallESD_10.11_15A284.iso

Screen Shot 2015 10 17 at 10 21 08 PM


Creating a VM with the customized OS X install .dmg file

1. Launch VMWare Fusion 8.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 2015 10 17 at 10 22 35 PM

 

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

Screen Shot 2015 10 17 at 10 25 30 PM

 

5. Select your customized OS X install disk image file and click on the Open button.

Screen Shot 2015 10 17 at 10 25 43 PM

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 2015 10 17 at 10 25 51 PM

 

6. 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: OS X 10.11

Screen Shot 2015 10 17 at 10 26 00 PM

 

7. In the Finish window, select Customize Settings if desired.

Screen Shot 2015 10 17 at 10 26 34 PM

Otherwise, click Finish.

Screen Shot 2015 10 17 at 10 26 50 PM

 

 

8. Save the VM file in a convenient location.

Screen Shot 2015 10 17 at 10 26 55 PM

 

The VM is now configured and set to use the customized OS X installer disk image. To install OS X and the packages included with your first boot package, start the VM and then do nothing. The VM should begin automatically installing OS X on the VM’s boot drive, followed by the installation of the first boot package.

If you want to build a customized version of this script, the script and its associated files are available on Github at the following address:

https://github.com/rtrouton/create_os_x_vm_install_dmg

  1. Fröderich Kerphlüpffl.
    February 23, 2016 at 2:45 am

    Anyway to make this an in-place updater instead of erase and install?

  2. AP Orlebeke
    April 22, 2016 at 2:44 pm

    Just a note. My OS is installed on an external SSD with my Mac mini and I use the internal drive. Currently changing the tmp directories in the script to point to the different volume & location.

    You do so much already to make lives easier, but if you have time is there any chance the script might be updated to account for a different default working / building location?

  3. May 28, 2016 at 10:04 pm

    Awesome script. Thank you for putting it together. I went ahead and selected option 1 for ESXI. I’m getting the same thing that I have been receiving on other attempts. Black screen, white Apple Logo, progress bar approx 5/6 of the way across, and a spinning beachball. I’m booting in a VM w/ 6 GB ram, 1 socket, 2 cpus, esxi 6.0. Any thoughts. This is soooooo frustrating. I’m probably missing something simple, but I just can’t figure it out. Thanks!!!

    • May 28, 2016 at 10:09 pm

      Any help from anyone would be great appreciated! 🙂

      • May 29, 2016 at 12:49 am

        Okay. figured it out. Apparently you still need to go into advanced > smc.present True

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: