> ## Content Index
> Fetch the complete content index at: https://bgpgeek.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Building a Networking Virtual Lab part 3: Install Vagrant on CentOS 7
- URL: https://bgpgeek.com/install-vagrant-on-centos7/
- Published: 2018-02-26T21:36:00.000Z
- Updated: 2026-06-06T06:57:16.000Z
- Author: BGPGeek
- Tags: Lab, Networking, KVM, Libvirt, Centos7, Virtual, Vagrant, #Import 2026-05-29 14:39, #Import 2026-09-15 21:11

# Introduction

This is part three of Building a Networking Virtual Lab. Vagrant can be used to build a virtual lab on top of KVM/Libvirt.

# Step 1 Vagrant CentOS packages to install

Install the latest Vagrant rpm from [https://releases.hashicorp.com/vagrant/](https://releases.hashicorp.com/vagrant/?ref=bgpgeek.com).  
`yum install -y https://releases.hashicorp.com/vagrant/2.1.2/vagrant_2.1.2_x86_64.rpm`

Install required packages for Vagrant.  
`yum install -y rubygem-nokogiri gcc ruby-devel zlib-devel libvirt-devel`

Check Vagrant is installed.  
`vagrant --version`

# Step 2 Install Vagrant plugins

Install plugins for Vagrant.  
`vagrant plugin install vagrant-libvirt`  
`vagrant plugin install vagrant-mutate`

# Step 3 Test Vagrant is working

Add a Vagrant box for testing.  
`vagrant box add centos/7 --provider=libvirt`

Make a directory for testing Vagrant.  
`mkdir test`  
`cd test/`

Create new Vagrant file.  
`vagrant init centos/7`

Bring the VM up  
`vagrant up`

Check status is running.  
`vagrant status`

ssh to test the Vagrant image is working.  
`vagrant ssh`  
`exit`

Destroy the Vagrant image after you have confirmed Vagrant is working.  
`vagrant destroy`

Remove the test directory.  
`cd ..`  
`rm -rf test`

# Step 4 Add other boxes to your Lab

You can add any image from the publicly Vagrant cloud to your lab. you can find them at the link below.  
[https://app.vagrantup.com/boxes/search](https://app.vagrantup.com/boxes/search?ref=bgpgeek.com)

If you can't find an image on the Vagrant cloud you can also make your own images from VMs that you have created.

You should now have Vagrant running on KVM/Libvirt.

# Links

[Part1](https://bgpgeek.com/install-kvm-on-centos-7/)  
[Part2](https://bgpgeek.com/install-vnc-with-xfce/)