Setting up Vagrant development environment, project wrap-up

First I installed Vagrant on the testing server:

sudo apt-get update
sudo apt-get install vagrant

Then I created a project directory to test the environment and initiated a Vagrantfile to it:

mkdir -p ~/projects/linuxtest
vagrant init

I added the following text to the Vagrantfile: do |config|
        config.vm.define :web1 do |apache_config|
       = "precise64"
                apache_config.vm.box_url = ""
                apache_config.vm.host_name = "web1"
       :bridged, :bridge => 'eth1'

        config.vm.define :db1 do |mysql_config|
       = "precise64"
                mysql_config.vm.box_url = ""
                mysql_config.vm.host_name = "db1"
       :bridged, :bridge => 'eth1'

WARNING! If you configure your virtual machines in bridged mode, please make sure that you define a good password for the vagrant user!

The Vagrantfile defines the creation of two VMs. One machine for Apache and another for databases. I defined the network to be in bridged mode on the eth1 interface. The host_name line defines a hostname automatically for both machines.

Then I created the VMs:

vagrant up


After Vagrant created the machines, I installed avahi-utils and apache2 on the web1 VM:

sudo apt-get install avahi-utils apache2

I installed Avahi for easy name resolving, as I don’t have a working DNS server on my network. I tested that both of them installed correctly and is working:


Project wrap-up

We started our project by listing a few of the virtualization platforms and we selected three of them for testing the most suitable system to replace the ESXi server platform. After we tested the three systems we selected two of them, Vagrant and VirtualBox, for the final solution. Vagrant will be used on projects involving Linux-based VMs and GUI-version of VirtualBox is used to deploy and test Windows VMs.

In the future we will be using Puppet for automating the installation of needed programs for Vagrant VMs, as this was not a task in this project.