Getting Started with Vagrant & VirtualBox

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:

How to do it…

Note: on Windows, add the following to your path:

PATH=%PATH%;c:Program FilesOracleVirtualBox
  1. Ensure vBox is installed. From a command
    $ vboxmanage --version
    4.2.12r84980
  2. Ensure Vagrant is installed:
    $ vagrant --version
    Vagrant version 1.2.2
  3. 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
  4. 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
  5. 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.

More Links

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.