Learn how to – How To Set Default Vagrant Provider to Virtualbox.
I have been using Vagrant to manage my Virtual Machines for a long time now. Vagrant provides you with such cool Virtual Machines control system. While trying to create a virtual machine on my Fedora Distribution, I got an error message “the provider ‘libvirt’ could not be found, but was requested to back the machine ‘default’. Please use a provider that exists”. After speding some minutes on Google, I found a simple solution that works.
By default, VirtualBox is the default provider for Vagrant. if you had changed the default provider, this guide will show you how to restore VirtualBox as the default provider. VirtualBox provides the lowest friction for new users to get started with Vagrant.
Using KVM
If you would like to use vagrant with KVM, make sure you install libvirt packages for vagrant. See examples below on installations:
#Fedora
sudo dnf install -y vagrant-libvirt vagrant
It is much easier to specify the default provider in Vagrant by setting the VAGRANT_DEFAULT_PROVIDER environmental variable.
echo "export VAGRANT_DEFAULT_PROVIDER=virtualbox" >> ~/.bashrc
source ~/.bashrc
You only need to set VAGRANT_DEFAULT_PROVIDER to the provider you wish to be the default. For other providers values set are as below:
- VMware: vmware_desktop
- Docker: docker
- Hyper-V: hyperv
Check out more guides available on Vagrant:
- How To Create Rocky Linux 8 Vagrant Boxes Using Packer
- How To Use Vagrant with Libvirt KVM on CentOS 8
- How To Use Ansible Playbook With Vagrant up
Leave a Reply
You must be logged in to post a comment.