vagrantlogo

How to make Vagrant and Fedora play well together

If you have a multi-environment dev team with some of your staff using MacOS and some using one flavor of Linux and some using another flavor of Linux like Fedora then you might be tempted to try out virtualizing the development environment so there’s no weird configuration bugs (“works on my machine”). This might lead you to trying out Vagrant which nicely manages all the boxes and their configuration for you.

But when you run vagrant up on Fedora the first time, you might find that it fails with a message about the provider not working.

This is despite Vagrant documentation’s claim that virtualbox is always the default provider. In fact, libvirt is the default provider on Fedora!

To resolve it, I first read the official Vagrant documentation and came up with a way that works, which is to add an environment variable to the .bashrc file named VAGRANT_DEFAULT_PROVIDER and set it to virtualbox. This kind of sucks because it creates an environment-specific configuration step, that has to be performed manually—exactly what I wanted to avoid!

Thankfully I stumbled across this Fedora page today. The answer as they give it:

To avoid this, you can set the default provider for your project in the beginning of your Vagrantfile as:

# Vagrantfile
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'
...

Leave a Reply

Your email address will not be published. Required fields are marked *