It is imperative to have VirtualBox, Docker, or Hyper-V installed on your system before using Vagrant. Vagrant offers developers a comprehensive development environment that enables them to work on different operating systems.
The Vagrant tool can be installed on multiple Linux systems, but for today we’re going to be using Ubuntu and using VirtualBox as the virtualization technology.
Installation of Vagrant on Ubuntu 20.04
To download Vagrant on the Ubuntu operating system, you must first install VirtualBox on the system (if it is not already installed).
To start the download process, first use the following command to update all system packages:
Next, start installing VirtualBox with the following command:
The installation and download of VirtualBox are completed in a few minutes. After that, to install the latest version of Vagrant on Ubuntu (as it is not updated regularly), copy the following vagrant wget Package in the terminal:
After getting the package file, issue the following command to install Vagrant:
Run the following command to verify that Vagrant installed successfully:
As you can see from the output in the terminal, Vagrant has been installed successfully. Now we can start exploring Vagrant further.
Getting started with Vagrant
To create a new project in Vagrant, first create a directory with the following command:
To change the directory, enter the following command:
Use the inside Command to initialize a new file, select a Vagrantbox https://app.vagrantup.com/boxes/searchand start working with the file.
For example we use Centos to show you how this process works. We issue the following command in the terminal:
Next, we’ll use the command given below to create and configure the file:
The output of the above command is as follows:
Now you can see how it works.
Here are a few more commands to demonstrate functionality:
To run ssh Enter the following command in the terminal:
To stop the virtual machine at any time, use the Stop Command as follows:
diploma
The Vagrant tool is designed to help developers manage different virtual environments in a single workflow. This tutorial showed you how to install Vagrant on Ubuntu 20.04. Vagrant is a command line tool used to create virtual desktop environments using virtualization technology. You also learned how to get started with Vagrant and run various commands to understand how it works.