Vagrant boot multiple virtual machines
Vagrant is excellent tool for creating easily new virtual machines. It takes less than 1 minute (image downloading take some times) getting vagrant up. If you would like to management multiple virtual machines easily select vagrant. In this instructions we create first new virtual machine and after that we build same time multiple virtual machines.
Install Vagrant
$ sudo apt-get -y install vagrant virtualboxNext you download Ubuntu 14.04 (trusty32) box (like vagrant call their images). When we add image to box vagrant keep its in the memory, and we could then use it to later:
$ vagrant box add trusty32 http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.boxGenerating vagrant's initializing file. Vagrantfile generating in to same directory where you give that command. Vagrantfile include config class which tell vagrant what you want to do with it. Now we just want to do only one virtual machine, but later we have to little bit modify this config-file, if we want to building up multiple virtual machines:
$ vagrant init trusty32Set Vagrant up
$ vagrant upAnd take connect to vagrant by ssh:
$ vagrant sshIf you want destroy our virtual machine, you could give command:
$ vagrant destroyMultiple virtual machines
Now we are successfully create new virtual machine. But, we want something more. We would like to create multiple virtual machines. First we have little modify our config vagrantfile.
$ nano VagrantfileAnd Vagrantfile code is:
Vagrant::Config.run do |config|
  config.vm.define "virtual1" do |v|
    v.vm.box = "trusty32"
  end
  config.vm.define "virtual2" do |v|
    v.vm.box = "trusty32"
  end
endWe made two virtual machines "virtual1" and "virtual2". Line v.vm.box = "trusty32" tell that we use trusty32 box.
Set up multiple Vagrants
$ vagrant upVirtual machines getting up, and when they are ready you can take connect to them by command:
$ vagrant ssh virtual1or
$ vagrant ssh virtual2And you can destroy them by command:
$ vagrant destroySource
http://docs.vagrantup.com/v2/multi-machine/
http://terokarvinen.com/2012/vagrant-ubuntu-12-04-create-boot-new-virtual-machine-vagrant-ssh-virtualbox-apt-get
EDIT 2014-10-05: Update precise32 (Ubuntu 12.04) to trusty32 (Ubuntu 14.04).