YouTube Icon

Code Playground.

How to Install Vagrant on CentOS 8


How to Install Vagrant on CentOS 8

Transient is an order line apparatus for building and overseeing virtualized advancement conditions. As a matter of course, Vagrant can arrangement machines on head of VirtualBox, Hyper-V, and Docker. Backing for different suppliers, for example, Libvirt (KVM), VMware and AWS can be empowered by means of the Vagrant module framework. 

Transient is normally utilized by engineers to set up an improvement climate, that matches creation. 

In this instructional exercise, we will disclose how to introduce Vagrant on CentOS 8. We'll additionally tell you the best way to establish an improvement climate. 

Installing Vagrant on CentOS 8

At the hour of composing this article, the most recent stable form of Vagrant is variant 2.2.6. Visit the Vagrant downloads page to check whether there is another variant of Vagrant accessible. 

To introduce Vagrant on your CentOS machine, enter the accompanying order as root or client with sudo benefits : 

sudo dnf install

When the establishment is finished, confirm that Vagrant was effectively introduced by running: 

vagrant --version

The order will print the Vagrant form: 

Vagrant 2.2.6

Getting Started with Vagrant

Since you have Vagrant introduced on your CentOS framework, how about we establish an improvement climate utilizing the VirtualBox supplier, which is the default supplier for Vagrant. Ensure you have VirtualBox introduced on your CentOS 8 framework . 

The initial step is to make a catalog that will be the undertaking root index. Make the venture registry and change to it with: 

mkdir ~/my-vagrant-project
cd ~/my-vagrant-project

The following stage is to introduce another Vagrantfile utilizing the transient init order and determine the crate you need to utilize. Vagrantfile is a setup document that depicts how the virtual machine is designed and provisioned. It utilizes Ruby punctuation to characterize the arrangement. 

Boxes are the bundle design for the Vagrant conditions and are supplier explicit. You can discover a rundown of openly accessible Vagrant Boxes at the Vagrant box index page. 

In this model, we'll utilize the ubuntu/bionic64 box. Run the accompanying order to instate another Vagrantfile: 

vagrant init ubuntu/bionic64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`` for more information on using Vagrant.

You can open the Vagrantfile with your word processor and make modifications as indicated by your requirements. 

Run the transient up order to make and design the virtual machine as characterized in Vagrantfile: 

vagrant up
==> default: Configuring and enabling network interfaces...
    default: SSH address:
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Rsyncing folder: /home/linuxize/Vagrant/my-vagrant-project/ => /va

On the off chance that the crate doesn't exists locally it will be downloaded. Transient likewise mounts the venture catalog at/transient in the virtual machine, which permits you to take a shot at your task's documents on your host machine. 

To ssh into the virtual machine, type: 

vagrant ssh

When you are done with your work, to stop the virtual machine, run:

vagrant halt

Use the command below to destroy the virtual machine and all associated resources:

vagrant destroy

On the off chance that the virtual machine is running, it will be halted before it is eliminated. 


We have indicated introduce Vagrant on CentOS 8 and how to establish a fundamental advancement climate. 

For more data about Vagrant visit the official Vagrant documentation page. 

In the event that you have any inquiries, it would be ideal if you leave a remark underneath.