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
jordanm
  • 41,988
  • 9
  • 116
  • 113
Florian Margaine
  • 523
  • 4
  • 11
  • I would've loved to add the following tags, but do not have enough reputation to create them: [tag:fedora-21] [tag:libvirt] – Florian Margaine Apr 06 '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 06 '15 at 23:38

2 Answers2

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
Florian Margaine
  • 523
  • 4
  • 11
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.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
user2555595
  • 938
  • 1
  • 12
  • 28
  • 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 04 '15 at 17:13
  • 1
    @FlorianMargaine, your answer helped and I wanted to share my experience in dealing with this issue. – user2555595 Jun 05 '15 at 16:27