core: VirtualBox is no longer the fallback, not hardcoded anywhere

This commit finally removes all traces of VirtualBox defaults from
Vagrant core. Vagrant now completely relies on its automated provider
detection to pick the best and most relevant provider that is available
on the system and for a specific development environment.

A "vagrant up" on one development environment might prefer VirtualBox,
another might prefer Docker. As a result of this commit (plus the few
prior), the developer doesn't need to know anymore and doesn't need to
specify a `--provider` flag. Vagrant just figures out the correct
provider.

Yay. :)
This commit is contained in:
Mitchell Hashimoto 2014-10-23 16:31:50 -07:00
parent db00c38217
commit cba76c3b68
3 changed files with 21 additions and 2 deletions

View File

@ -369,8 +369,8 @@ module Vagrant
return key if impl.usable?(false)
end
# If all else fails, return VirtualBox
return :virtualbox
# No providers available is a critical error for Vagrant.
raise Errors::NoDefaultProvider
end
# Returns the collection of boxes for the environment.

View File

@ -476,6 +476,10 @@ module Vagrant
error_key(:nfs_client_not_installed_in_guest)
end
class NoDefaultProvider < VagrantError
error_key(:no_default_provider)
end
class NoDefaultSyncedFolderImpl < VagrantError
error_key(:no_default_synced_folder_impl)
end

View File

@ -861,6 +861,21 @@ en:
If this message is erroneous, you may disable this check by setting
`config.nfs.verify_installed` to `false` in your Vagrantfile.
no_default_provider: |-
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.
no_default_synced_folder_impl: |-
No synced folder implementation is available for your synced folders!
Please consult the documentation to learn why this may be the case.