Ensuring your Vagrant's box is weatherproof: A quick Veewee tip
This post was originally posted on the Phase2 Blog.
We'll be doing a screencast series soon on using the Vagrant gem to distribute and manage virtual machines so that your entire team (yes, even Windows folks!) can do development on their local machine with the same software that's on your production Linux servers.Another useful tool in the Vagrant user's arsenal is Veewee. Veewee lets you automate the VirtualBox application to install a full operating system with just the packages you want and need. Veewee does have some built-in validation tools, such as vagrant basebox validate BOXNAME
, which will run a set of Cucumber acceptance tests to ensure that the virtual machine should work properly when brought up with Vagrant, as well as with the Chef and Puppet configuration management tools.
Nonetheless, sometimes you might want to quickly pop onto the VM that's just been built by veewee before issuing a vagrant basebox export BOXNAME
to save it to a .box file suitable for distribution. To easily enable this, just add the following to your ~/.ssh/config
file.
# Veewee box.
Host veewee-machine
HostName 127.0.0.1
User vagrant
Port 7222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /home/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/vagrant-0.8.6/keys/vagrant
IdentitiesOnly yes
You'll need to change the IdentityFile
directive to point at wherever Vagrant is installed on your machine. With the entry in your SSH config file in place, you can simply execute an ssh veewee-machine
and kick the tires before bundling up the box.
Now go forth and build an army of virtual machines!