12

Right now, any time I use vagrant, it tries to use libvirt as the provider. I want to use VirtualBox by default.

vagrant-libvirt is not installed.

It's bothersome because some commands don't work, like vagrant status:

[florian@localhost local]$ vagrant status
The provider 'libvirt' could not be found, but was requested to
back the machine 'foobar'. Please use a provider that exists.
[florian@localhost local]$ vagrant status --provider=virtualbox
An invalid option was specified. The help for this command
is available below.

Usage: vagrant status [name]
    -h, --help                       Print this help
  • I would've loved to add the following tags, but do not have enough reputation to create them: fedora-21 libvirt – Florian Margaine Apr 6 '15 at 22:34
  • I added libvirtd to the question. I don't think it's valuable to have a tag for every specific Fedora version, especially when they are EOL in as little as 12mos after release. – jordanm Apr 6 '15 at 23:38
25

According to vagrant's documentation, the default provider should be virtualbox, and the VAGRANT_DEFAULT_PROVIDER variable lets you override it.

However, VAGRANT_DEFAULT_PROVIDER is empty, so it should be virtualbox, right? Well, if I set the variable to virtualbox, it works again. So I guess fedora sets the default variable somewhere else.

Solution:

$ echo "export VAGRANT_DEFAULT_PROVIDER=virtualbox" >> ~/.bashrc
$ source ~/.bashrc
4

This is just my experience on encountering this problem.

On executing vagrant up, i got this

The provider 'libvirt' could not be found, but was requested to
back the machine 'default'. Please use a provider that exists.

I tried the commands provided above

echo "export VAGRANT_DEFAULT_PROVIDER=virtualbox" >> ~/.bashrc
source ~/.bashrc

Then I executed vagrant up

The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

Using VBoxManage --version, it gave me

The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (4.0.4-303.fc22.x86_64) or it failed to
load. Please recompile the kernel module and install it

and prompted me to execute sudo /etc/init.d/vboxdrv setup which solved my problem.

  • 2
    Just virtualbox that wasn't correctly setup then, not directly related to vagrant. But thanks for the info, it might be useful for future Googlers! – Florian Margaine Jun 4 '15 at 17:13
  • 1
    @FlorianMargaine, your answer helped and I wanted to share my experience in dealing with this issue. – user2555595 Jun 5 '15 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.