• Stars
    star
    186
  • Rank 207,316 (Top 5 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Please Read:
------------

macOS 10.12.4 introduced a change that prevents the addition of third-party packages to the OS installer. This script uses the addition of a third-party installer package, so unfortunately this script cannot be used to generate 10.12.4 or later OS installers.

If you need to build a macOS 10.12.x VM, my recommendation at this point is to use the macOS 10.12.3 installer. Once the OS is installed, update to later versions of macOS Sierra as a post-installation task.



This script prepares customized OS X installer disk images for use with VMware Fusion and ESXi. It's adapted from the prepare_iso script created by Tim Sutton: https://github.com/timsutton/osx-vm-templates/tree/master/prepare_iso

Pre-requisites: 

1. This script and the associated support directory. This script and the support directory must be both stored in the same directory in order for the script to work properly.

2. A 10.7.x, 10.8.x, 10.9.x, 10.10.x, 10.11.x, or 10.12.x installer from Apple's Mac App Store.


Running the script: 

Run the create_vmware_osx_install_dmg.sh script with two arguments: the path to an "Install OS X.app" or the InstallESD.dmg contained within, and an output directory. 


Example usage: 

If you have a 10.11.x 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

This should produce a DMG file at output_directory that's named OSX_InstallESD_10.11_15A284.dmg. An MD5 checksum is printed at the end of the process.


What the script does:

1. Mounts the InstallESD.dmg using a shadow file, so the original DMG is left unchanged.

2. minstallconfig.xml is also copied, which is looked for by the installer environment's 
   rc.* files that first load with the system. This allows us to never actually modify the 
   BaseSystem.dmg and only drop in these extra files.

3. Additional installer packages can be added using a first boot package, which is added to 
   the OS X install by way of the OSInstall.collection file. The script is expecting the following:

   A. That the first boot package is named "First Boot Package Install.pkg" (no quotes)
   B. That the first boot package is stored in the support directory.
   
   This first boot package can be generated by First Boot Package Install Generator.app, which will generate a 
   distribution-style flat package that can be used with 10.7 / 10.8 / 10.9 / 10.10 / 10.11 OS installs.

   The instructions for using this tool to generate first boot packages are documented here: 
   https://github.com/rtrouton/First_Boot_Package_Install_Generator

4. If desired, a second disk image in .iso format can be generated for use with VMware ESXi
   servers running on Apple hardware. 


Once you have the customized DMG file created, you can choose it as an install disk image in VMware Fusion when creating virtual machines in VMware Fusion.

This script has been tested with Apple's 10.7.5, 10.8.5, 10.9.5, 10.10.5, 10.11.6, and 10.12.0 installers from the Mac App Store.




NOTES: 

1. A pre-generated First Boot Package Install.pkg is stored in the support directory as a zip file named First_Boot_Package_Install.zip. Unzip the file before running the script. This first boot package will automatically install all available Apple software updates following the OS installation, but provide no other customization.

2. The 10.9.x disk images created with this method will not install a recovery partition into a VM. As a workaround, it appears that this can be addressed via using Per Olofsson’s Create Recovery Partition Installer to generate an installer that can install the missing recovery partition:

Create Recovery Partition Installer is available from here on GitHub:
https://github.com/MagerValp/Create-Recovery-Partition-Installer

Unfortunately, that installer would be too large to include as part of First Boot Package Install’s payload (available space is around 350 MBs, the Recovery Partition installer is around 485 MBs.)

In my testing, 10.7.x, 10.8.x, 10.10.x, 10.11.x and 10.12.x disk images will successfully install a recovery partition into the VM.

More Repositories

1

rtrouton_scripts

Scripts to share
Shell
1,303
star
2

profiles

Management profiles for OS X / macOS
518
star
3

create_macos_vm_install_dmg

Shell
474
star
4

Payload-Free-Package-Creator

AppleScript
198
star
5

create_macos_recovery

Tool for repairing the Recovery volume (APFS) or partition (HFS+) on Macs running macOS 10.13.x or later.
Shell
117
star
6

First_Boot_Package_Install_Generator

Shell
106
star
7

privacy_preferences_control_profiles

Repository for Privacy Preferences Policy Control profiles, also known as TCC profiles
95
star
8

Simple-Package-Creator

87
star
9

CasperCheck

Shell
81
star
10

First-Boot-Package-Install

Shell
59
star
11

set_microsoft_outlook_as_default_application

41
star
12

autopkg-conductor

Script for managing AutoPkg runs
Shell
36
star
13

payload-free_package_printer_generator

Shell
34
star
14

First-Boot-Package-Install-With-Automated-Apple-Software-Update

Shell
27
star
15

esxi_macos_vm_creation

Shell
20
star
16

aws_scripts

Shell
18
star
17

autopkg_setup_for_jamf_pro

This utility is designed to install and configure AutoPkg and JSSImporter on macOS
Shell
17
star
18

documentation_VM_profiles

These are management profiles I use when creating VMs for documentation purposes.
17
star
19

AutoPkg_Processors

Python
12
star
20

Show-or-Hide-Desktop-Icons

11
star
21

documentation_VM_scripts

Shell
9
star
22

aws_lightsail

This repo is for posting and sharing AWS Lightsail setup scripts.
Shell
8
star
23

jp400-09-2019

Scripts and other info developed as part of a Jamf Pro certification training class in September 2019.
Shell
8
star
24

2015_cce_class

Shell
8
star
25

jamf_infrastructure_manager

This repo is for Jamf Infrastructure Manager-related scripts.
Shell
8
star
26

afp548keychainminder

This repository stores the source code for the original Keychain Minder, formerly hosted by AFP548.com
Objective-C
8
star
27

ec2_systems_manager

Shell
4
star
28

pbj

Peanut butter and jelly images
1
star