Skip to content

Vagrant Development

kip9 edited this page Feb 4, 2014 · 2 revisions

This page describes requirements and process of setting up local development image with Vagrant + Virtualbox + Puppet.
Setup instructions part will guide you how to get fresh install of nilai on Vagrant box.

Requirements

Setup instructions

  1. Get Vagrantfile with plain recipes from CloudSpace
  2. Clone plain puppet repository from github:
    git clone git@github.com:plainmade/puppet.git
  3. Clone nilai application to local filesystem:
    git clone git@github.com:plainmade/nilai.git You can then normally switch branches of it in local filesystem if you wish to - all changes would be automatically reflected on the vagrant box.
  4. Edit downloaded Vagrantfile to set up required constants:
  • set up PUPPET_MANIFESTS_BASE constant to point to the folder with cloned puppet repo (leave/put trailing slash!)
  • set up NILAI_LOCAL_PATH constant to point to the folder with cloned barley application (leave/put trailing slash!)
  1. Edit your hosts file and insert following line in:
    192.168.33.20 nilai.vbox
  2. Initialize vagrant nilai box - in the folder where Vagrantfile is placed execute:
    vagrant up nilai --provision (this may take a while - it has to download box image from CloudFront at the first time)
  3. Go to http://nilai.vbox/install using your web browser and follow instructions ! :)

Notes

If you see message like following:

The guest additions on this VM do not match the installed version of VirtualBox! In most cases this is fine, but in rare cases it can cause things such as shared folders to not work properly. If you see shared folder errors, please update the guest additions within the virtual machine and reload your VM.

Guest Additions Version: 4.1.18 VirtualBox Version: 4.2

Don't worry - it should still work with different additions versions.

If you get an error: VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory when running any of vagrant commands (especially vagrant up) it means you've hit Virtualbox / OS X Mavericks issue. In order to resolve it - please install latest VirtualBox (4.3.2) or uninstall the version you have using Virtualbox uninstall script from DMG image and install again. More details about the issue: Virtualbox Trac

Vagrant Cheat sheet

  • vagrant up - will start your box regardless of the last state (halted, destroyed)
  • vagrant halt - will shut down virtual machine, but keep it state saved on disk
  • vagrant destroy - will shut down and remove virtual machine; state will be discarded
  • vagrant provision - will apply all puppet changes (if any)
  • vagrant reload - shortcut for halt and up - will apply all changes to Vagrantfile if any