Skip to content

Instantly share code, notes, and snippets.

Last active Jun 7, 2017
What would you like to do?
Build an OSX 10.10 base-box for test-kitchen and VirtualBox



  1. Open OSX App Store, download Yosemite. Once the download is finished, the installer starts. Close it right away.

  2. Execute:

    mkdir /tmp/osxvm
    cd /tmp/osxvm
    git clone
    cd osx-vm-templates
    sudo prepare_iso/ "/Applications/Install OS X" out  # note result .dmg filename
    md5 out/OSX_InstallESD_10.10.3_14D136.dmg # note result checksum
    cd packer
  3. For use with test-kitchen we want a base image without chef, puppet, other stuff. Also we're only going to build the virtualbox image. Open the template.json file and adjust:

--- i/packer/template.json
+++ w/packer/template.json
@@ -101,11 +101,7 @@
       "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}",
       "scripts": [
-        "../scripts/",
-        "../scripts/",
-        "../scripts/",
-        "../scripts/",
  1. Start packer. This will take a lot of time and disk space (10+ GB)

    # update filename and checksum!
    packer build \
      -var iso_url=../out/OSX_InstallESD_10.10.3_14D136.dmg \
      -var iso_checksum=3d379eb82fd8417974aa94d76157d511 \
      -var username=vagrant \
      -var password=vagrant \
      -var autologin=true \
      -var install_vagrant_keys=true \
      -except vmware-iso,parallels-iso \
  2. Import box to Vagrant

    vagrant box add --name macosx-10.10
  3. Enjoy test-kitchen


  name: vagrant

  name: chef_zero

  - name: macosx-10.10

  - name: default
      - recipe[your-cookbook::default]


Vagrant seems to have a bug, that will be fixed soon:

Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
Vagrant is configured to generate a random keypair and insert it
onto the guest machine, but it appears Vagrant doesn't know how to do
this with your guest OS. Please disable key insertion by setting
`config.ssh.insert_key = false` in the Vagrantfile.

After doing so, run `vagrant reload` for the setting to take effect.

If you'd like Vagrant to learn how to insert keys on this OS, please
open an issue with details about your environment.

You can find the Vagrantfile(s) inside .kitchen, add config.ssh.insert_key = false and execute vagrant reload in each directory containing a Vagrantfile.


Tested on: 2015-05-28

Tested with:

Copy link

mattstratton commented May 29, 2015

I solved the insecure key problem slightly differently in my .kitchen.yml:

Also since I wanted a Fusion box and not vbox, I had to do a little bit of a hack that is listed in this issue

Copy link

juliandunn commented May 29, 2015

I also have this in-flight. chef/bento#353

Copy link

rmoriz commented Jun 1, 2015

👍 for both :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment