Vagrant is an open source tool for building a complete virtual development environment. A test environment is required for testing the latest release and new tools. It works on Linux, Mac OS X, or Windows and although by default it uses VirtualBox for managing the virtualization, it can be used with other providers such as VMware or AWS.
First you need to download and run the installation kit.
Check that you have dpkg and Virtual box installed:
$ sudo apt-get install virtualbox
Installing Vagrant:
$ sudo apt-get install vagrant
Install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the Linux kernel version changes during the next apt-get upgrade.
$ sudo apt-get install virtualbox-dkms
Vagrant can quickly deploy the development environment. Get the vagrant images from here.
The following command will install precise32 box from the vagrant website.
$ vagrant box add precise32 http://files.vagrantup.com/precise32.box
-Then create a vagrant file in this folder by calling 'vagrant init', which will be the central file for the project configuration.
$ mkdir vagrant_project $ cd vagrant_project $ vagrant init
Edit the Vagrantfile in this directory and replace
config.vm.box = "precise32"
This will tell it to use this new box. Save the file and exit. Now you can deploy the guest machine with the following command:
vagrant up
This will bring up a VPS running Ubuntu 12.04 LTS. To make use of it, you can easily SSH into it:
vagrant ssh
After you are done working with the guest machine, you can exit and go back to the host with the following command:
exit
If you want to stop and remove the guest machine and all traces of it, run the following command from the host machine:
vagrant destroy
The files that were synchronized with the host machine will not be removed from the host. Additionally, you can redeploy the guest machine again for this configuration using the same vagrant up command.
You liked the article?
Like : 0
Vote for difficulty
Current difficulty (Avg): Medium
1/15
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.
Stay Updated
Get stories of change makers and innovators from the startup ecosystem in your inbox