First you need to ensure that VirtualBox is installed. Current vagrant release is not working with VirtualBox 4.x, so get a previous 3.2.x version (currently 3.2.10 which updates to 3.2.12) from http://www.virtualbox.org/wiki/Download_Old_Builds_3_2.
Next install the vagrant gem and download the Ubuntu 10.10 32-bit vagrant box I built up:
gem install vagrant
vagrant box add maverick32 http://dl.dropbox.com/u/2297268/maverick32.box
The box is about 500MB to download and gets cloned off your local disk whenever vagrant builds a virtual machine.
Now make a directory for a vagrant virtual machine "project":
mkdir webapp_testing
cd webapp_testing
To save some time and to see an example, you can start from the Vagrantfile in this gist:
curl -LO https://gist.github.com/raw/763629/998aa2af2b69e363f9109b000de7a0ba01b04e63/Vagrantfile
Note that these roles and recipes are partially using my chef repo:
git clone git://github.com/fnichol/chef-repo.git
I'm using some git submodules to split the base repo from the opscode cookbooks fork from my own totally new cookbooks. On your workstation make sure that the chef gem is installed for the rake task to work:
gem install chef
(cd chef-repo && rake update)
Then you can try to bring up the virtual machine. I'm always interesting in deployment time:
time vagrant up
To see much more chef deployment information, turn on debug level logging in the Vagrantfile (currently commented out).
Assuming that you don't make a new chef cookbook or add any port forwards, you can re-run chef-solo from vagrant like so (without a VM restart):
vagrant provision
To change any VirtualBox VM settings or add any new cookbooks/recipes you'll need to tell vagrant to fully restart/reprovision the VM:
vagrant reload
To log in to your VM, use the following (from your testing_webapp directory with the Vagrantfile):
vagrant ssh
If you want to keep your work around when you're done, ssh in to your VM and shut it down:
vagrant ssh
sudo shutdown -hP now && exit
If you want to destroy the VM and reclaim space, then destroy it:
vagrant destroy