Setting up a Development Virtual Machine

Why use a VM?

So why use a VM over doing a native install for development?

  1. Easy to backup and restore snapshots
  2. Easy to share with other developers
  3. Replicate different user environments

Just like everything else related to software its extremely important to be able to roll back changes to a specific point in time.  If you manage to completely hose your dev env its sometimes easier to just restore than to fix everything.

If you’re working on a project with other developers, which you will sooner or later, then its easy to get new developer up and running by passing them your vm instead of having them go through and install everything from scratch.  This can drastically speed up how soon your new dev can start contributing to the project.

Lastly you can easily replicate various user environments for testing (testing with various IE versions on windows vs some sort of IE test tool/emualtor)  which can easily communicate with your server instance.

Choosing an Operating System

Before we can do anything else we must choose an operating system to use for our development environment.  The big and obvious choices are Windows, Linux and OS X.  Currently on my main desktop I’m running Windows 7 because I mainly use it for video games and watching videos, but as  developer I have different needs.

We are going to go with Linux Mint.  There are a few reasons for this decision.

  1. Its free
  2. Its newbie friendly
  3. I need to improve my linux skills
  4. Its new

Installation

Download VMware Player and Linux Mint.  The current versions as of now are Linux Mint 15 64 bit and VMware Player 5.

Installing VMware Player on Windows 7 is easy enough as you just need to click through the dialog and let run.  Once it finishes installing run VMware follow the dialogs

  1. Create a New Virtual Machine.
  2. Select Linux and Ubuntu 64
  3. Name it Development Base and pick a location to store it
  4. Select single file and 20 gb space, we can raise this later if necessary
  5. Leave the default hardware settings, we can increase these later if necessary
  6. Hit Finish and then Play Virtual Machine
  7. You should get a popup asking  you to download VMware Tools for Linux 9.2.3 Select Download and Install
  8. Ignore the message at the bottom for now about the VMware tools

At this point you should be booted into a desktop of a live cd.  We’ll want  to run the Install Linux Mint icon and follow some more dialog.  Make your language and timezone selections and leave the defaults until the computer and user information screen.  On this screen your computer name is what will be used to identify this vm on your network and the user information will be used to create a user account.  Let the installation finish and restart.

Now that we’ve finished installing we can go back and install the VMware tools.   These tools enable us to use all the hardware for our host computer.  Click Player -> Manage -> Install VMware Tools and a drive will popup.

  1. Extract the contents of the compressed file to the desktop
  2. Open the folder in a terminal and run sudo ./vmware-install.pl
  3. Hit enter for all the default options
  4. Let the script finish executing and exit the prompt

We use the sudo command here to temporarily escalate our privileges to that of the root user to execute a perl script that finishes up the configuration.

And now we have a completely fresh Linux install in which to start configuring our development environment.