Using vagrant with LibVirt

LibVirt is a tool to manage virtualization. It supports all OS systems and many hypervisors like KVM and Qemu. To use it on Windows, you need MinGW toolchain.

Using Vagrant with libvirt offers a very fast way to run a local box. It’s easy to run and destroy a virtual machine that helps me testing some Network architectures, Securities, and Ansible playbooks.

In this case, I am using Pacman then Arch Linux package manager to install dependencies. In your case, you can use yours.

sudo pacman -S base-devel vagrant libvirt qemu dnsmasq

After installing dependencies, you need to install the libvirt plugin for vagrant. This is important if you want to provision a vagrant box using LibVirt.

vagrant plugin install vagrant-libvirt

When Libvirt is installed, you can run the libvirtd service by starting and stopping it.

systemctl start libvirtd

Now, Libvirt is ready to use. You can now run vagrant up and ssh to use your box.

In this repository, you can find an example to run Rocky Linux on Vagrant using LibVirt https://github.com/chokri/vagrant-libvirt.git

You Might Also Like

Leave a Reply