Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

Latest commit

 

History

History
85 lines (58 loc) · 2.66 KB

README.md

File metadata and controls

85 lines (58 loc) · 2.66 KB

spike-vagrant-osx

An experiment with getting an OSX guest running with Vagrant so this might eventually be used to test Sprout.

Dependencies

  1. Vmware Fusion
  2. Packer
  3. Vagrant 1.3+
  4. Vagrant's Vmware Fusion Provider
  5. Tim Sutton's osx-vm-templates for building an OSX box with Packer
  6. ServerSpec

Creating an OSX box for Vagrant with Packer

  1. Clone Tim Sutton's osx-vm-templates

    git clone https://github.com/timsutton/osx-vm-templates
    
  2. 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.

  3. Edit the Packer template packer/template.json

    1. Change iso_checksum to the checksum of the image generated earlier
    2. Change iso_url to the absolute path of the image generated earlier, keep the file:/// prefix.
    3. Remove the chef-omnibus.sh and puppet.sh scripts from the list of provisioners
    4. Don't forget to save the file!
  4. Create a new box with Packer

    cd packer
    packer template.json
    
  5. Add the box generated earlier to Vagrant

    vagrant box add osx packer_vmware_vmware.box
    

Starting the OSX guest with Vagrant

  1. Clone this repo

    git clone https://github.com/hiremaga/spike-vagrant-osx
    
  2. Start vagrant using this repo's Vagrantfile

    cd spike-vagrant-osx
    vagrant up --provider vmware_fusion
    

Run specs

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