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

create_vmware_osx_install_dmg script updated with Yosemite support

I’ve updated the create_vmware_osx_install_dmg.sh script which I had previously posted about here. The script now includes support for Yosemite, so the script can now be run on 10.7 – 10.10 to create custom OS X 10.7.x, 10.8.x, 10.9.x and 10.10.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 2014-11-15 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 available before running the script.

Screen Shot 2014-11-15 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. An directory to store the completed disk image in.

Example usage:

If you have a 10.10.0 Yosemite installer available, run this command:

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

When the command is run, you will be asked to choose whether or not you want to create an .ISO file for use with VMware ESXi.

Screen Shot 2014-11-15 at 3.54.16 PM

If you had chosen to not create the .ISO file, this should produce a DMG file inside your selected output directory which is named something similar to OSX_InstallESD_10.10_14A389.dmg. This DMG will install both OS X 10.10.0 and the first boot package.

Screen Shot 2014-11-15 at 4.01.16 PM

If you chose to create the .ISO, you should have two disk image files inside the chosen output directory which are named something similar to the following: OSX_InstallESD_10.10_14A389.dmg and OSX_InstallESD_10.10_14A389.iso

Screen Shot 2014-11-15 at 4.00.47 PM

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

1. Launch VMWare Fusion 7.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 2014-11-15 at 7.50.44 PM

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

Screen Shot 2014-11-15 at 7.54.27 PM

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

Screen Shot 2014-11-15 at 7.54.38 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.

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: 10.10

Screen Shot 2014-11-15 at 7.54.54 PM

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

Screen Shot 2014-11-15 at 7.55.10 PM

9. Save the VM file in a convenient location.

Screen Shot 2014-11-15 at 7.55.25 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. allisterb
    November 21, 2014 at 6:54 pm

    Or,
    1. autodmg (without applying updates if desired)
    2. https://github.com/chilcote/vfuse
    amirite?

    • November 21, 2014 at 6:57 pm

      I love vFuse, it’s good stuff. One thing I really like about building VMs is that there’s usually more than one way to get to your goal.

  2. sebus
    November 25, 2014 at 10:38 am

    Used create_os_x_vm_install_dmg to create iso from Yosemite.
    Iso booted OK, but installer gives error:

    failed to open os x installer the path (null) appears to be missing or damaged

    Only reference I found to it is here:

    https://github.com/munki/createOSXinstallPkg#further-note-on-additional-packages-and-yosemite

    dmg will not boot at all.

    Yes dmg created from CYI from here boots & installs just fine:

    http://www.insanelymac.com/forum/topic/290949-how-to-install-os-x-10x-snow-leopard-lion-mountain-lion-mavericks-and-yosemite-in-vmware-workstation-10-or-player-6/#entry1937757

    • November 25, 2014 at 1:04 pm

      sebus,

      From the error you’re reporting, it sounds like the first boot package you’re using is not compatible with Yosemite’s OS installer. I recommend downloading a new copy of the script and support files (see the “Downloading the script and support files” section of this post.)

      The reason the first boot package may not be compatible with with Yosemite’s OS installer is that it is not a distribution-style flat package. The first boot package included with the latest download is a distribution-style flat package and should work.

      Note: The first boot package included with this script will automatically install all available Apple software updates following the OS installation, but provide no other customization for the VM.

      If you need to customize the first boot package, see the “Creating a customized first boot package” section of this post.

  3. sebus
    November 26, 2014 at 11:05 am

    Well, downloaded the zip from github on the day (yesterday 25.11.14), but did NOT follow: “…First Boot Package Install.pkg is used by the script so it’ll need to be unzipped…”
    So the iso created did NOT have First Boot Package Install.pkg

    On next try unziped the .pkg and the resulting iso has .pkg in \System\Installation\Packages and now it boots/installs fine

    Maybe worth building a bit of logic check into the script to check for the .pkg

  4. mvught
    November 27, 2014 at 2:51 pm

    rtouton im right that its not working under VMware® Workstation 10.0.3 Windows?
    Do you also have a workaround for this?

    • November 27, 2014 at 2:56 pm

      mvught,

      Running OS X VMs is only supported by VMware on Apple hardware. You won’t be able to legally run OS X VMs on a PC using VMware Workstation.

      • mvught
        November 27, 2014 at 3:48 pm

        im a fighter this is what i did:
        I made the file as you discribe above. i download VMware Unlocker 1.3.0 http://bendiksens.net/uploads/osxguide/unlock-all-v130.zip
        You can only select 10.9 but this is working after that run the installer under VMware Workstation 😉

      • November 27, 2014 at 3:56 pm

        That’s your choice, but you should be aware that using the script that way voids the script’s already non-existent warranty and support agreement.

  5. dubprocess
    August 12, 2015 at 8:09 pm

    I tried installing a custom DMG and shortly after a prohibitory symbol appears when VMware Fusion boots to Apple VM. I use this dmg as a custom built image that I normally use to deploy on end clients in my environment. Any ideas?

  6. October 28, 2015 at 8:19 pm

    Thank you, Rich!

    I created an El Cap installer with your script and it installed & booted on ESXi 6.0u1 without a hitch!

  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: