[cipher@server ~]$ sudo dnf install vagrant
[cipher@server ~]$ vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Installed the plugin 'vagrant-libvirt (0.0.37)'!
[cipher@server ~]$ vagrant plugin install vagrant-mutate
Installing the 'vagrant-mutate' plugin. This can take a few minutes...
Installed the plugin 'vagrant-mutate (1.2.0)'!
[cipher@server ~]$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.
[cipher@server ~]$ vagrant box add https://app.vagrantup.com/centos/boxes/7
==> box: Loading metadata for box 'https://app.vagrantup.com/centos/boxes/7'
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.
1) hyperv
2) libvirt
3) virtualbox
4) vmware_desktop
Enter your choice: 2
==> box: Adding box 'centos/7' (v1801.02) for provider: libvirt
[cipher ~]$ vagrant box list
centos/7 (libvirt, 1801.02)
[cipher ~/vagrant]$ vagrant init centos/7
[cipher ~/vagrant]$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
==> default: Uploading base box image as volume into libvirt storage...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default: -- Name: vagrant_default
==> default: -- Domain type: kvm
==> default: -- Cpus: 1
==> default: -- Memory: 512M
==> default: -- Base box: centos/7
==> default: -- Storage pool: default
==> default: -- Image: /var/lib/libvirt/images/vagrant_default.img (41G)
==> default: -- Graphics Type: vnc
==> default: -- Graphics Port: 5900
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for SSH to become available...
==> default: Configuring and enabling network interfaces...
==> default: Rsyncing folder: /home/cipher/vagrant/ => /vagrant
[cipher ~/vagrant]$ vagrant ssh
[vagrant@localhost ~]$ hostname
localhost.localdomain
[vagrant@localhost ~]$ w
17:11:08 up 2 min, 1 user, load average: 0.67, 0.46, 0.18
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
vagrant pts/0 192.168.121.1 17:11 4.00s 0.20s 0.05s w
Related Articles
Modular vagrant file
How to structure a modular Vagrantfile using separate .rb config files for resources, disks, and networks.
Using vagrant with kvm
Install Vagrant and use it with the KVM/libvirt provider on Fedora 26.
How We Set Up Our KVM Hypervisor: From Bare Metal to Production-Ready VM Host
Detailed walkthrough of building a dedicated KVM/libvirt hypervisor with XFS tuning, hugepages, 10GbE tuning, and automation.