What to do if Vagrant machine becomes unresponsive (KVM)

If you are using Vagrant with KVM (with vagrant-libvirt plugin) on Fedora, you might have experienced that sometimes the KVM virtual machine becomes unresponsive. Simply put you would wait forever for trying to ssh to the machine using vagrant ssh. It unfortunately happens to me sometimes when my laptop goes to sleep. So the simple answer is to avoid this and to always halt your Vagrant VMs when you finished working. Here is another thing to try out if you that happens and you don’t want to recreate the machine from scratch (vagrant destroy && vagrant up). Continue reading

DNS for your Vagrant needs: with Landrush, libvirt and dnsmasq

Have you ever needed a DNS server that would be visible both on your host and your Vagrant guests? Landrush is one of those things that can pretty much save you. Unfortunately it was designed around VirtualBox and Mac OS, so it does not work on Linux out-of-the-box. And it does not work with libvirt provider at all. Until of course recently since I added the support there. Here is how to make all that work together on Fedora. Continue reading

Debugging Vagrant with pry-byebug

What to do when running Vagrant with --debug flag is not enough? As Vagrant is nothing else than a Ruby program, you can use famous pry gem together with pry-byebug to debug it. The only thing you need to do to use pry from the Vagrant code base is to make sure it’s installed and available in the Vagrant environment. Continue reading

Writing a general multi-provider Vagrantfile

Vagrant is a great software that allows people to use various providers, provisioners, sync options, and more. But that often comes short if we write our project’s Vagrantfile just for default VirtualBox. Since I prefer to use libvirt provider and NFS I tend to write Vagrantfile that only support those (as they are just for myself). But lately I was writing a Vagrantfile for upcoming Fedora Developer Portal and wanted to support both Fedora users running our packages with libvirt as a default provider and everyone else as well. Continue reading

Running Vagrant with Docker provider without password prompts on Fedora

When you run Vagrant with Docker provider you find out that you need to prepend every command with sudo since that’s what would you do with running Docker commands directly. But chances are you don’t want to do that. In that case it’s enough to make calls to Docker commands password-less. Vagrant would then be able to use Docker without password prompts as well. To do so you just need add yourself to docker group. Here is how to do it on Fedora 22. Continue reading

Inception: running Vagrant inside Vagrant with KVM

Since I package and maintain Vagrant and vagrant-libvirt for Fedora, I have a need to test new builds. But since I run just one version of Fedora and I don’t really feel like testing it directly on my host system, I actually use Vagrant to test Vagrant. In other words I run Vagrant with KVM and inside I download the new builds and run Vagrant with KVM again. This is possible because KVM supports nested virtualization. In fact I already wrote about setting that up with virt-manager. But today I show you how to do it using Vagrant itself. Continue reading