KVM and Vagrant for automated deployment


For my university degree 🎓 I have to code a plugable microservice for iRODS. In this blog post, I document the process from conception, modeling to implementation and testing an automated two server deployment with vagrant and KVM as provider.

Setting up KVM


I’m running an debian based distro so I’m working with apt package manager. To verify that our CPU supports virtualization use this command:

egrep -c '(svm|vmx)' /proc/cpuinfo

If the command returns 0 your CPU does not support hardware virtualization.

Install KVM

sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager

Add your user to the libvirt and kvm group with the following commands. Replace $USERNAME with your real username.

sudo usermod -aG libvirt $USERNAME
$ sudo usermod -aG kvm $USERNAME

Verify KVM Installation

virsh -c qemu:///system list

Setting up vagrant

sudo apt install qemu libvirt-daemon-system libvirt-clients libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev ruby-libvirt ebtables dnsmasq-base vagrant
vagrant plugin install vagrant-libvirt


This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. © zerosec.xyz