Building Mac test environments with VMWare Fusion, NetBoot and DeployStudio
When new software appears, Mac admins need test boxes that match their standard configuration in order to verify that the new software doesn’t adversely affect anything in their environment. In the past, this has usually meant that admins needed to either have an available test box, or go find one when they needed to test something.
The advent of good virtualization solutions meant it was easier to build test boxes without needing additional hardware, but getting the VM to match your standard could take some time and effort.
In VMWare Fusion 5.x, VMWare added NetBoot support for virtual machines running Mac OS X. This proved to be an enormous boon to Mac admins who used NetBoot to help set up their machines: They could now build VMs using the exact same processes that were used to build their users’ Macs. They could also leverage tools like createOSXinstallPkg to set up template VMs with either the latest available OS X installer from the Mac App Store or custom builds of OS X that ship with new hardware.
See below the jump for an example of how you can leverage VMWare’s NetBoot support, createOSXinstallPkg and DeployStudio to set up a new Mac VM with a factory-fresh install of OS X Mountain Lion.
createOSXinstallPkg-built Mountain Lion installer package
VMWare Fusion 5.0.2 or higher
DeployStudio NetBoot drive running 10.7.x or higher set as default NetBoot set
Before anything else, you’ll need to set up a DeployStudio workflow that will allow the createOSXinstallPkg-built 10.8 installer to be installed as a non-postponed installation. I have a post on how to do that here:
Once you have that built, let’s set up a VM with a completely empty boot drive.
Configuring the VM
1. Launch VMWare Fusion 5.x
2. In VMWare Fusion, select New… under the File menu to set up a new VM
3. In the Create New Virtual Machine window, select Continue without disc
4. In the Installation Media window, select Create a custom virtual machine
5. In the Choose Operating System window, set OS as appropriate. In this example, I’m setting it as follows:
Operating System: Apple Mac OS X
Version: Mac OS X 10.8 64-bit
6. In the Finish window, select Customize Settings
7. Save the VM file in a convenient location.
8. In your VM settings, select Network Adapter.
9. In the Network Adapter settings, select Autodetect under Bridged Networking
Note: You may also want to adjust the VM’s available RAM in the Processors & Memory settings at this point, but that’s up to you.
The VM is now configured. It’s set up for OS X 10.8.x, but has a formatted and completely empty boot drive.
Booting to DeployStudio
1. To boot the VM from the DeployStudio boot set, start the VM and then do nothing.
If the DeployStudio boot set is set as the default boot set on the NetBoot server, the VM should boot to DeployStudio automatically after failing to boot from the VM’s hard drive or CD-ROM.
2. Once booted to DeployStudio, log in as you normally would.
3. Select the workflow with your 10.8 installer.
4. Run the workflow to install the 10.8 installer onto the VM’s empty boot drive.
5. When the workflow is finished, hit the Quit button.
The VM will restart from its hard drive and automatically install 10.8 on the VM’s boot drive. Once finished, you’ll have a factory-fresh install of 10.8.x on your VM.
The example described above will set up a VM with only OS X 10.8.x installed, but you can customize further. Depending on your process, you could reboot back to DeployStudio and run additional workflows on the VM.
Another approach would be to modify the createOSXinstallPkg-built 10.8 installer to add additional packages. This would allow you to add a systems management agent like Casper, Munki, Puppet or others to the 10.8 OS installer. Once the agent reported in, the systems management tool could have its agent install additional software and scripts to configure the VM.
If your workflow is built around laying down an image with DeployStudio, you can also use DeployStudio to install that image in your VM. In this case, you would be treating the VM like you would any other physical Mac.