Home > bootstrappr, First Boot Package Install Generator, macOS, Virtualization, VMware > Using bootstrappr to build testing VMs with VMware Fusion

Using bootstrappr to build testing VMs with VMware Fusion

As part of my preparation for next week’s WWDC conference, I’ve been working on ways to build virtual machines using VMware Fusion for testing. In previous years, I have used NetBoot-based solutions to help me with this process. With NetBoot going away though, I’ve started using bootstrappr as my replacement deployment tool.

Bootstrappr is designed to install packages and scripts, but in my case I’m having it install only one package: a firstboot package created by First Boot Package Install Generator.app. The firstboot package in turn installs a set of installer packages to configure the VM and install the software I want. For more details, please see below the jump.

Downloading bootstrappr

To download the bootstrappr files, use the following procedure:

1. Go to https://github.com/munki/bootstrappr
2. Click on the Clone or download button.

Screen Shot 2019 05 31 at 10 25 45 AM

3. Click on the Download ZIP button.

Screen Shot 2019 05 31 at 10 27 07 AM

Preparing a firstboot package

For details on how to prepare a firstboot package using First Boot Package Install Generator.app, please see the following blogpost:

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

For this example, I’ll be using a firstboot package named First Boot Package Install.pkg.

Screen Shot 2019 05 31 at 10 48 42 AM

Configuring bootstrappr for deployment

1. In the downloaded bootstrappr files, locate the bootstrap directory.

2. Inside the bootstrap directory, add the First Boot Package Install.pkg installer package to the packages directory.

Screen Shot 2019 05 31 at 10 54 09 AM

3. Run the make_dmg.sh script in the downloaded bootstrappr files to create a disk image with all of the bootstrappr files inside.

Screen Shot 2019 05 31 at 10 55 48 AM

Running bootstrappr

On my own network, I’ve been using bootstrappr’s option of mounting a disk image which is hosted on a web server. This is described as Scenario #2: Disk image via HTTP in the bootstrappr usage scenarios. This allows me to centrally host the disk image and use it when building multiple VMs. However, for next week’s conference, I won’t have access to the web server which hosts the disk image. Instead, I’ll be taking the bootstrappr disk image with me and using a process similar to that described below to set up my VMs.

Converting the bootstrappr disk image to a VMware VMDK file

  • Pre-requisites: VMware Fusion

1. Double-click the bootstrappr disk image to mount it.

Screen Shot 2019 05 31 at 1 33 21 PM

2. Run the following command to get the disk image’s disk identifier:

diskutil list

Screen Shot 2019 05 31 at 1 36 56 PM

3. Locate the identifier for the whole mounted disk image. For this example, it’s /dev/disk2

Screen Shot 2019 05 31 at 1 36 57 PM

4. Run the commands below to copy the contents of the disk image to a .VMDK file:

First:

"/Applications/VMware Fusion.app/Contents/Library/vmware-rawdiskCreator" print /dev/disk_id_here

For this example, the command will look like this:

"/Applications/VMware Fusion.app/Contents/Library/vmware-rawdiskCreator" print /dev/disk2

Second:

"/Applications/VMware Fusion.app/Contents/Library/vmware-rawdiskCreator" create /dev/disk_id_here fullDevice /path/to/tempfile lsilogic

For this example, the command will look like this:

"/Applications/VMware Fusion.app/Contents/Library/vmware-rawdiskCreator" create /dev/disk2 fullDevice /Users/username/bootstrapr-staging lsilogic

Third:

"/Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager" -r /path/to/tempfile.vmdk -t 0 /path/to/filename.vmdk

For this example, the command will look like this:

"/Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager" -r /Users/username/bootstrapr-staging.vmdk -t 0 /Users/username/bootstrap.vmdk

The output of running these commands should look like this:

Once the VMDK file is built, attach it to a VM by using the process described in the link below:

Add an Existing Virtual Hard Disk: https://pubs.vmware.com/fusion-7/topic/com.vmware.fusion.help.doc/GUID-4B3FC5A0-E4A5-4C1B-9F0C-9536628CF4DB.html

Once the VMDK is ready and attached, use the procedure below to boot and configure a VM with an unconfigured copy of macOS installed:

1. Boot to Recovery

Screen Shot 2019 05 31 at 3 13 31 PM

2. Launch Terminal

Screen Shot 2019 05 31 at 3 13 48 PM

3. Run the following command:

/Volumes/bootstrap/run

Screen Shot 2019 05 31 at 2 54 59 PM

4. Select the volume to install on (in this example, the volume is named Macintosh HD.)

The firstboot package included in the disk image is installed.

Screen Shot 2019 05 31 at 2 55 31 PM

5. Once installation is completed, select the option to restart.

Screen Shot 2019 05 31 at 2 55 58 PM

On restart, the First Boot Package Install workflow is able to suppress the Apple Setup Assistant and run its assigned installation tasks.

Screen Shot 2019 05 31 at 2 58 36 PM

  1. No comments yet.
  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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: