Home > DeployStudio, Mac administration, Mac OS X, VMware > Building Mac test environments with VMWare Fusion, NetBoot and DeployStudio

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.

Pre-requisites:

DeployStudio rc135 or higher

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:

http://derflounder.wordpress.com/2012/07/25/installing-mac-os-x-10-8-x-on-an-erased-hard-drive-using-deploystudio-and-createosxinstallpkg/

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

Screen Shot 2013-01-22 at 4.48.48 PM

4. In the Installation Media window, select Create a custom virtual machine

Screen Shot 2013-01-22 at 4.48.55 PM

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

Screen Shot 2013-01-22 at 4.49.00 PM

6. In the Finish window, select Customize Settings

Screen Shot 2013-01-22 at 4.49.05 PM

7. Save the VM file in a convenient location.

8. In your VM settings, select Network Adapter.

Screen Shot 2013-01-23 at 1.06.07 PM

9. In the Network Adapter settings, select Autodetect under Bridged Networking

Screen Shot 2013-01-22 at 4.49.26 PM

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.

Screen Shot 2013-01-22 at 4.49.47 PM

Screen Shot 2013-01-22 at 4.49.56 PM

2. Once booted to DeployStudio, log in as you normally would.

Screen Shot 2013-01-22 at 9.55.36 PM

3. Select the workflow with your 10.8 installer.

Screen Shot 2013-01-22 at 9.56.38 PM

4. Run the workflow to install the 10.8 installer onto the VM’s empty boot drive.

Screen Shot 2013-01-22 at 9.59.21 PM

5. When the workflow is finished, hit the Quit button.

Screen Shot 2013-01-22 at 10.33.44 PM

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.

Screen Shot 2013-01-22 at 10.34.53 PM

Screen Shot 2013-01-23 at 11.07.11 AM

Screen Shot 2013-01-22 at 5.14.53 PM

VM Customization

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.

Screen Shot 2013-01-22 at 9.56.50 PM

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.

  1. Patrick Fergus
    January 23, 2013 at 7:03 pm | #1

    DeployStudio Netboot set needs to be 10.7+, which shouldn’t be an issue if someone is rolling this out fresh.

    • January 23, 2013 at 7:08 pm | #2

      Good catch. I’ve added that in the pre-requisites section.

  2. January 24, 2013 at 5:13 am | #3

    Not to be ‘too cool for school’, but… in VMWare 4 if you
    were booted from the temp disk image Install Mac OS X Lion.app
    creates as if you were setting up the VM from scratch, you can just
    pop open Disk Utility from the Utilities menu and restore any image
    you want…either by logging into a sharepoint and then using asr on
    the command line or using DU’s restore interface. (Yes, I just need
    to have work buy me the upgrade so I can netboot, I’ve been
    lazy)

    • January 24, 2013 at 6:37 pm | #4

      True. Prior to NetBoot being available, I was using a small VMWare VM that had been set up as a DeployStudio boot set, then attaching the DeployStudio boot VM’s virtual hard drive to new VMs as needed.

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

Follow

Get every new post delivered to your Inbox.

Join 126 other followers

%d bloggers like this: