Install Vagrant with vagrant-libvirt
Install Vagrant and vagrant-libvirt in CentOS 8
In order to use libvirt related VMs, such includes qemu and kvm, we need to use vagrant-libvirt plugin for Vagrant. To do this, following steps shall be followed
Install Vagrant
Add repo for Vagrant and install vagrant by:
Install Libvirt
Install all dependencies for libvirt as well as libvirt's libraries
In here, if we do not perform usermod
the libvirt will not create and manage VMs. Therefore, add current user for libvirt.
Install vagrant-libvirt
In order to use vagrant-libvirt in Vagrant as the provider, use vagrant-libvirt.
Example Vagrantfile
To verify that the vagrant-libvirt was installed properly, use following Vagrantfile to check if it was installed properly:
This will create a VM with ubuntu2204 image and will perform sudo apt-get update
.
Last updated