Vagrant is a higher level wrapper around different virtualization and configuration management software.
Virtualization Software:
- VirtualBox,
- VMware,
- KVM and
- Linux Containers (LXC)
- Ansible,
- Chef,
- Salt, and
- Puppet.
Deploy your uniform environment on any virtual platform. For example, you may deploy with vagrant on Amazon Cloud or Virtual Box with same environment without any hassle. As a best practice, push vagrant file in the version control repository so that others can benefit without any upfront work.
vagrant init
vagrant box add hashicorp/precise64
The box add command creates a box from the image
"hashicorp/precise64".
The box name consists of 2 parts; is username and is box name.
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
end
vagrant up
We see there is an error in mounting and syncing the directories. The issue is fixed by upgrading to virtual box 5.0.14
We will not be able to see anything since Vagrant runs VM without any user-interface. To check if its running, we can SSH it.
vagrant ssh
SSH failed since SSH client is not installed. We will use Putty to SSH the virtual machine. Import the private key to puttygen and save .ppk file.
Now we can connect to box using putty.
vagrant reload --provision
I hope it helped. Feel free to comment...