Part of the pre-work / homework for next weeks “Couch to OpenStack” program is to get a Vagrant environment going on your laptop (or wherever else you choose to run these things). We’re not going to go into the “Why Vagrant” or “What is Vagrant” questions. Those are better answered elsewhere. What follows are the steps needed to get your first Vagrant VM online.
Getting Started with Vagrant and VirtualBox
Before jumping in, you need to obtain both bits of software, you can pull them down from here:
- Vagrant – http://www.vagrantup.com/
- Virtualbox 4.2.12 (There is an open issue on the most recent vBox) – https://www.virtualbox.org/wiki/Download_Old_Builds_4_2
How to do it…
Note: on Windows, add the following to your path:
PATH=%PATH%;c:Program FilesOracleVirtualBox
- Ensure vBox is installed. From a command
$ vboxmanage --version 4.2.12r84980
- Ensure Vagrant is installed:
$ vagrant --version Vagrant version 1.2.2
- Make a “Couch to OpenStack” folder (Note: The gist of what we’re doing here is making a folder to hold the Vagrant files, on Windows this looks a bit different):
mkdir -p ~/projects/Couch_to_OpenStack cd ~/projects/Couch_to_OpenStack
- Create a file with the following contents and save it as Vagrantfile in the folder you just created:
# -*- mode: ruby -*- # vi: set ft=ruby :
Vagrant.configure("2") do |config| config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com/precise64.box" end
- From a command line in the folder where Vagrantfile lives: vagrant up
On VMware & Other Providers
Vagrant is designed in such a way that you can extend it’s functionality to support multiple virtualization platforms. The most common are the VMware products Fusion & Workstation. However, in addition to the cost of the VMware license, there is also a cost for the Vagrant license. More info on that here.