» Basic Provider Usage
Installing boxes has not changed at all:
Vagrant now automatically detects what provider a box is for. This isvisible when listing boxes. Vagrant puts the provider in parentheses nextto the name, as can be seen below.
Once a provider is installed, you can use it by calling with the —provider
flag. This will force Vagrant to use that specificprovider. No other configuration is necessary!
In normal day-to-day usage, the —provider
flag is not necessarysince Vagrant can usually pick the right provider for you. More detailson how it does this is below.
Vagrant currently restricts you to bringing up one provider per machine.If you have a multi-machine environment, you can bring up one machinebacked by VirtualBox and another backed by VMware Fusion, for example, but youcannot back the same machine with both VirtualBox andVMware Fusion. This is a limitation that will be removed in a futureversion of Vagrant.
As mentioned earlier, you typically do not need to specify —provider
ever. Vagrant is smart enough about being able to detect the provideryou want for a given environment.
Vagrant attempts to find the default provider in the following order:
The flag on a
vagrant up
is chosen above all else, if it is present.Vagrant will go through all installed provider plugins (including the ones that come with Vagrant), and find the first plugin that reports it is usable. There is a priority system here: systems that are known better have a higher priority than systems that are worse. For example, if you have the VMware provider installed, it will always take priority over VirtualBox.
If Vagrant still has not found any usable providers, it will error.
Using this method, there are very few cases that Vagrant does not find thecorrect provider for you. This also allows eachVagrantfile to define what providersthe development environment is made for by ordering provider configurations.