A tool to manage virtual machines. Its used to creating reproducible working environments for testing and development
Virtual machine is software for emulation of a computer system.
brew tap caskroom/cask
brew cask install virtualbox
brew cask install vagrant
Boxes are the package format for Vagrant environments. A box can be used by anyone on any platform that Vagrant supports to bring up an identical working environment.
Add the copied image to vagrant using following command
vagrant box add ubuntu-12.04 ubuntu_12.04_java7.box
Create a folder for your development environment
mkdir testvagrant
cd testvagrant
Initialize Vagrant with the box you just imported
vagrant init ubuntu-12.04
Start vm with:
vagrant up
SSH into your vagrant machine:
vagrant ssh
Add these lines in your Vagrantfile. Uncomment if they are already present:
config.vm.provision "shell", inline: <-SHELL
sudo apt-get update
sudo apt-get install -y apache2
SHELL
Provision your vagrant machine:
vagrant provision
Provision your vagrant machine:
config.vm.network "private_network", ip: "192.168.33.10"
Restart vagrant using:
vagrant reload
Suspend your vagrant machine:
vagrant suspend
Stop your vagrant machine:
vagrant halt
Destroy your vagrant machine:
vagrant destroy
Vagrant's functions can be extended via plugins. Lots of amazing plug-ins available via community. Some Useful plugins: