Using Vagrant
December 10, 2014

Using Vagrant

Posted on December 10, 2014

In 2013, I finally made the switch over to a Mac. Before that, I was content with Ubuntu Linux. I was so devoted to Linux, I was even using the Gimp as my pixel editor and Inkscape for vector art. I even had tried the wacky idea of getting a Mac laptop duo-booting with Ubuntu. When I got used to Mac’s Unix, most bash commands are the same and files, beside the home directory are in the same place. Now it seemed a waste to have a duo-boot, and I had already been using VirtualBox on Ubuntu, so I did the same on the Mac.

Vagrant is configured from on file. Configure the Vagrantfile, then you can issue a simple vagrant up command to initiate or run a VirtualBox instance.

Sample Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  # Ubuntu-13.10 = "Ubuntu-13.10"
  config.vm.box_url = ""
  config.vm.synced_folder "../.", "/home/vagrant/portal-up"  
  config.ssh.forward_x11 = true "forwarded_port", guest: 8000, host: 8000, auto_correct: true "forwarded_port", guest: 5432, host: 5432, auto_correct: true "private_network", ip: ""
  config.vm.provider :virtualbox do |virtualbox|
    virtualbox.customize ["modifyvm", :id, "--name", "main-gobox"] # Name the INSTANCE (app), make unique
    virtualbox.customize ["modifyvm", :id, "--memory", "1024"]
  config.vm.provision :shell, :path => ""  

Only on the first run, Vagrant will use the config.vm.box_url setting to load an OS image. You can find other images at This makes it easy to have a template OS or recover from a backup. After the instance has been created, it uses config.vm.provision to launch a Bash script to install and configure software not included in the VirtualBox image. See

Common Commands

vagrant up
vagrant halt
vagrant destroy
vagrant ssh

The biggest benefit with Vagrant is the configuration files can be save in the code repository. This made replication of the workspace available and backuped.

Bonus, I was able to return to Photoshop and Illustrator.


  • (updated)