Build a Virtual Machine with Vargrant (Ultimate Portablity)

Mar 1 2011 by Andrew Brown

The Problem

What I used to do: develop on my mac, deploy to my debian staging server, and then deploy to my debian production server.

Three different enviroments, theortically stage and production are the same, but they aren’t a mirror image, and they can diverged, and in my case, bundler works on stage and production doesn’t. How it happened I don’t know, I don’t care, because I’m going to make dev,stage and pro be identical by setting up a virtual server, that I will use for all three.

Why would you want to do this?

Ulitmate Portablity

  • When you pop into stage or pro, you’ll be as productive as if you were in dev.
  • Eliminates any questionalable doubts or “what ifs”. Its either working or is isn’t
  • If your computer explodes tommorrow or got a new developer, then setup will take 0 mins, because your dev is virtual and ready to go.
  • Wherever there is a terminal, you can do development
  • When you need to make technology changes you can snapshot your system.
  • It forces you to become a great developer, using the shell to program

Now that your convinced lets make our virtual server.

We are going to use VirtualBox, an open source VM and Vagrant, a ruby wrapper that automate the starting of the server and runs chef recipes to make your dev environment.

Install VirtualBox

At the time I wrote this tutorial I installed Virtual Box 4.0.6
Download Link for VirtualBox 4.0.6 (OSX)

Go ahead and install it.

KNOWN BUG FOR CORE i7 MACS (Workaround)
If you have a new mac with the core i7, there is a know issue in Virtual Box 4.0.4 – .6, so you simply need to start your osx in 32bit mode. Its a temporary solution, but you’ll have to do it until they fix VirtualBox to work with core i7 in osx. You can still build a 64bit machine in 32bit, and that’s what we’ll be building in this tutorial.

To start osx in 32bit mode hold 3 and the 2 on startup.
To confirm you are in 64 bit mode type in the terminal: uname -a
If it says: RELEASE_I386 i386 at the end then you are in 32bit mode.

Grab an Image of Debian

Go download an image of Debian.
Download Link for Debian 6.0.1a 64bit

Write a Comment to “Build a Virtual Machine with Vargrant (Ultimate Portablity)”