An experiment with getting an OSX guest running with Vagrant so this might eventually be used to test Sprout.
- Vmware Fusion
- Packer
- Vagrant 1.3+
- Vagrant's Vmware Fusion Provider
- Tim Sutton's osx-vm-templates for building an OSX box with Packer
- ServerSpec
-
Clone Tim Sutton's osx-vm-templates
git clone https://github.com/timsutton/osx-vm-templates
-
Extract a Packer compatible image from the OS X Mountain Lion installer
Caveat: The installer can't to be downloadable on newer Macbook Airs running OS X 10.8.4 (12E3067)
cd osx-vm-templates sudo prepare_iso/prepare_iso.sh "/Applications/Install OS X Mountain Lion.app" out
Take note of the checksum of the generated image and its full path from the output of this command, you'll need this in a moment.
-
Edit the Packer template packer/template.json
- Change iso_checksum to the checksum of the image generated earlier
- Change iso_url to the absolute path of the image generated earlier, keep the
file:///
prefix. - Remove the
chef-omnibus.sh
andpuppet.sh
scripts from the list of provisioners - Don't forget to save the file!
-
Create a new box with Packer
cd packer packer template.json
-
Add the box generated earlier to Vagrant
vagrant box add osx packer_vmware_vmware.box
-
Clone this repo
git clone https://github.com/hiremaga/spike-vagrant-osx
-
Start vagrant using this repo's Vagrantfile
cd spike-vagrant-osx vagrant up --provider vmware_fusion
bundle install
bundle exec rspec
If everything is setup correctly the output should be:
→ bundle exec rspec
Command "uname"
should return stdout "Darwin"
Finished in 9.43 seconds
1 example, 0 failures