Simply put, Vagrant is a tool for working with virtual environments, and in most circumstances, this means working with virtual machines. Vagrant provides a simple, easy-to-use command-line client for managing these environments, and an interpreter for text-based definitions of what each environment looks like, called Vagrantfiles. Vagrant is open source, which means anyone can download, modify, and share it freely.
While many virtual machine hypervisors provide their own command-line interface, and technically provisioning virtual machines through these programs can be done directly or through shell scripts, the advantage Vagrant provides by adding an extra layer is simplicity, interoperability across multiple systems, and a more consistent approach that could theoretically be used with any virtual environment running on top of it. any other system.
By providing a common text-based format for working with virtual machines, your environment can be defined in code, making it easy to backup, modify, share, and manage with revision control. It also means that instead of sharing an entire image of the virtual machine, which could be many gigabytes, every time a configuration change is made, a simple text file weighing only a few kilobytes can be shared.
Why should I use Vagrant?
While in essence, Vagrant provides a fairly simple function, it can be useful for a wide range of people working on different types of tasks.
For developers, Vagrant makes it easy to create an on-premises environment that mimics the environment in which the code will be deployed. You can ensure that you have the same libraries and dependencies installed, the same processes installed, the same operating system and version, and many other details without having to sacrifice the way your local machine is configured, and without the delay or cost of creating an external development environment and connecting to it.
Where can I get Vagrant?
These same advantages for developers also make it an interesting option for UX and UI designers, who can see exactly what their work will look like on a different system, or even work with their own isolated copy of the system a developer is programming without having to jump through many hoops.
It’s also a great tool if you’re trying to learn a new tool, operating system, or environment without fear of making a mistake that could compromise your current system. Whether you’re studying for a certification exam, testing a new deployment script, or just trying something new, you can do so with confidence that it won’t damage anything on your local machine or in a production environment. As a bonus, once you get it right, you can use the same process and script to deploy in a real-life situation or live environment.
There are a few different ways to get Vagrant. Vagrant is available for download as a binary package for Linux, Mac and Windows from the official download page.
For many Linux distributions, you can find Vagrant in their default repositories and install it as you would any other piece of software. For example, in Fedora, you can simply run.
$ sudo dnf install vagrant However, the creators of Vagrant
warn that the versions available in some repositories are not kept up to date, and you may have fewer problems if you use the official installers
And if you’re particularly interested in how Vagrant works, as an open source project, Vagrant’s source code is available on GitHub for you to inspect. clone, and even contribute to.
How do I get started with Vagrant?
The best way to get started with Vagrant is to install and test it yourself. Other than that, the official documentation is invaluable and provides excellent instructions for taking your first steps. It also helps to know some of the basic terminology used by Vagrant.
- Box: A box is a packaged Vagrant environment, typically a virtual machine
- Provider: A provider is the location where the virtual environment runs. It can be local (the default is to use VirtualBox), remote, or even a special case like a Docker container.
- Provisioner: A provisioner is a tool for setting up the virtual environment and can be as simple as a shell script, but alternatively a more advanced tool such as Chef, Puppet or Ansible can be used.
Looking for more? Check out this fantastic five-minute introductory video from Red Hat’s Daniel Farrell at All Things Open 2015.