We'll assume an OS X Mavericks (10.9) box here.
You'll need:
- Vagrant
- Vagrant's VMware Fusion provider
- VMware Fusion
- Packer
- A local copy of an "Install *.app" for your target OS (10.9 in this case)
I'm using the timsutton/osx-vm-templates project to create a modified DMG that requires no boot paramters, sort of like a kickstart.
INSTALL_APP="/Applications/Install OS X Mountain Lion.app"
git clone https://github.com/timsutton/osx-vm-templates.git
cd osx-vm-templates
mkdir dmg
sudo prepare_iso/prepare_iso.sh "$INSTALL_APP" dmg/
Now you should have a DMG in the dmg/
directory, similar to dmg/OSX_InstallESD_10.9.1_13B42.dmg
. We'll remember this artifact with:
MAC_DMG="$(pwd)/dmg/*.dmg"
cd -
I'm using a modifed set of Packer templates in fnichol/packer-templates to create a Vagrant base box very similar in spirit to Chef(corp)'s Bento boxes project. You'll need Packer installed, so if using a Mac:
brew tap homebrew/binary
brew install packer
Now clone the repo, copy in the Mac DMG:
git clone https://github.com/fnichol/packer-templates.git
cd packer-templates
mkdir packer_cache
mv "$MAC_DMG" packer_cache/
You'll need to make a variables JSON in macosx-10.9/variables.json
with the DMG name and checksum:
cat <<_JSON_ > macosx-10.9/variables.json
{
"iso_url": "../$(ls -1 packer_cache/*.dmg)",
"iso_checksum": "$(md5 -q packer_cache/*.dmg)"
}
_JSON_
Run the Packer template:
./bin/build macosx-10.9
This should produce a Vagrant box file in the builds/
directory.
Shazam!
Now get the base box into Vagrant with:
vagrant box add macosx-10.9 builds/mac-*.box
In your project, try a .kitchen.yml
like the one below. There are a few things to take note of:
- You'll need to set the Vagrant provider to
vmware_fusion
- Memory needs to be 2GB minimum or the box won't boot
- Current I'm using a "forked" install.sh that adds support for Mac OS X 10.9 pending an upstream update
Hope this helps you to test against the Mac platform!
Why use
https://gist.github.com/fnichol/3c10e7e58625ebe63487/raw/732bee6bb97bbfabc7535357f62fc91d77e90e93/install.sh
shouldn't the omnibus installer do what's needed?