Skip to content

Instantly share code, notes, and snippets.

@jkeenan
Created August 4, 2016 14:07
Show Gist options
  • Save jkeenan/b573fbe505b85d9c679f0e623137533b to your computer and use it in GitHub Desktop.
Save jkeenan/b573fbe505b85d9c679f0e623137533b to your computer and use it in GitHub Desktop.
'vagrant up' fails to find VirtualBox

Immediate problem:

$ vagrant up --provider virtualbox
No usable default provider could be found for your system.

Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.

The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.

If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.

Background:

Several days ago I installed VirtualBox Version 5.1.2 r108956 on my Ubuntu Linux 16.04 LTS x86_64 machine. Installation was successful. I subsequently successfully installed VirtualBox 5.1.2 Oracle VM VirtualBox Extension Pack.

I then followed instructions at https://www.freebsdfoundation.org/freebsd/how-to-guides/installing-freebsd-with-virtualbox/#! to install FreeBSD version 10.3 as a VM. I have successfully started, configured, utilized and stopped the FreeBSD VM many times since then.

I then decided to try to manage VirtualBox via Vagrant. I used 'apt-get' to install vagrant. The version of vagrant associated with Ubuntu 16.04 was 1.8.1. That version only works with VirtualBox up to VB's version 5.0; it would not support 5.1.2. I subsequently was able to install a newer version of vagrant from Debian testing:

$ apt-cache show vagrant
Package: vagrant
Version: 1.8.4+dfsg-2
...

$ vagrant --version
Vagrant 1.8.4

I was subsequently able to use Vagrant to add an OpenBSD box from Atlas:

$ vagrant box list
kaorimatz/openbsd-5.9-amd64 (virtualbox, 20160703.0.0)

According to this page from the Vagrant documentation, https://www.vagrantup.com/docs/providers/basic_usage.html, I should, at this point, have been able to launch the VM with Vagrant simply by saying:

$ vagrant up

However, when I did so, I got the error message displayed at the top of this gist. I have consistently gotten the same error message with this variants:

$ vagrant up --provider virtualbox

... and by adding:

config.vm.provider "virtualbox"

just before 'end' in my Vagrantfile.

What am I missing?

@jkeenan
Copy link
Author

jkeenan commented Aug 4, 2016

Raul Cuza called my attention to the fact that Hashicorp had released vagrant 1.8.5 on their web site: https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5_x86_64.deb

I downloaded this file and let the Ubuntu Software Center application handle the work of installing it. It did so successfully.

$ vagrant --version
Vagrant 1.8.5

Then, the acid test:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'kaorimatz/openbsd-5.9-amd64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'kaorimatz/openbsd-5.9-amd64' is up to date...
==> default: Setting the name of the VM: jkeenan_default_1470323055431_16333
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
[~] 90 $ vagrant ssh
OpenBSD 5.9 (GENERIC) #1761: Fri Feb 26 01:15:04 MST 2016

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

$ pwd
/home/vagrant
$ ls -al
total 40
drwxr-xr-x  3 vagrant  vagrant  512 Jul  3 15:39 .
drwxr-xr-x  3 root     wheel    512 Jul  3 15:49 ..
-rw-r--r--  1 vagrant  vagrant   87 Feb 26 08:07 .Xdefaults
-rw-r--r--  1 vagrant  vagrant  773 Feb 26 08:07 .cshrc
-rw-r--r--  1 vagrant  vagrant  103 Feb 26 08:07 .cvsrc
-rw-r--r--  1 vagrant  vagrant  359 Feb 26 08:07 .login
-rw-r--r--  1 vagrant  vagrant  175 Feb 26 08:07 .mailrc
-rw-r--r--  1 vagrant  vagrant  218 Feb 26 08:07 .profile
drwx------  2 vagrant  vagrant  512 Aug  4 15:04 .ssh
-rw-r--r--  1 vagrant  vagrant    6 Jul  3 15:39 .vbox_version
$ 

Success!

Thanks, Raul!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment