Vagrant is a tool used to build and manage virtual machine environment. Vagrant has easy-to-use workflow and focus on automation, reducing the time to build a developer environment and improve productivity. Solve the problem "on my machine can work".
Vagrant is to facilitate the implementation of virtualized environments, the use of Ruby development, based interfaces such as VirtualBox virtual machine management software, providing a configurable, lightweight portable virtual development environment. Vagrant can easily use to set up a virtual environment, but also can simulate multiple virtual machines, so we can develop machines usually also distributed simulation system.
Team new employees, often encounter spend a day or even more time to build from scratch a complete development environment, and with Vagrant, only direct already packaged package (which includes development tools, code libraries, configured server etc.) can take over the work, which for increase work efficiency is very helpful.
Why Vagrant
Vagrant provides an easy to configure, re-use, compatible with the environment, controlled by a single workflow, to help you and your team to maximize productivity and flexibility.
In order to achieve the magic Vagrant, Vagrant standing on the shoulders of giants. Configuring Virtual Machine VirtualBox, VMware, AWS or other providers. Then some configuration tools, such as shell scripts, Chef or Puppet automation can be installed and configured in the virtual machine software.
Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the "works on my machine" excuse a relic of the past.
Vagrant is a Ruby-based tool for creating and deploying virtualized development environment. It uses Oracle's open source VirtualBox virtualization system, use Chef to create automated virtual environment. We can use it to dry these things as follows:
Create and delete virtual machines
Configure the virtual machine operating parameters
Manage virtual machines running state
Automatic configuration and installation development environment
Package and distribute virtual machine operating environment
Vagrant run, you need to rely for some specific virtualization technology, the most common are two VirtualBox and VMWare, early, Vagrant only supports VirtualBox, and later added support for VMWare's.
Why should we choose Vagrant it? Because it has a cross-platform, mobile, automated deployment without human intervention and so on.
Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team.
To achieve its magic, Vagrant stands on the shoulders of giants. Machines are provisioned on top of VirtualBox, VMware, AWS, or any other provider. Then, industry-standard provisioning tools such as shell scripts, Chef, or Puppet, can automatically install and configure software on the virtual machine.
Because we know vagrant rely virtualbox, so we need to be installed before installing vagrant virtualbox,
vagrant box basic commands
It lists the local environment in all box
vagrant box list
Add a box to your local vagrant environment
vagrant box add box-name(box-url)
Update the local environment specified in the box
vagrant box update box-name
Delete the local environment specified in the box
vagrant box remove box-name
Repackaging the local environment specified in the box
vagrant box repackage box-name
In an empty folder initialize a virtual machine
vagrant init [box-name]
Start a virtual machine in the file folder you initialize
vagrant up
ssh login to start a virtual machine
vagrant ssh
Hang started virtual machine
vagrant suspend
Restart the virtual machine
vagrant reload
Turn off the virtual machine
vagrant halt
Find a running state of the virtual machine
vagrant status
The destruction of the current virtual machine
vagrant destroy