Better VirtualBox detection in Vagrantfile#1578
Better VirtualBox detection in Vagrantfile#1578mzdaniel merged 1 commit intomoby:masterfrom jimmycuadra:vagrant-provider-detection
Conversation
|
Looks like this is the same issue as #1449. Apologies for not checking beforehand. (I think this is a cleaner implementation though.) It's also worth noting that the vagrant-vbguest plugin automates the installation of the guest additions and makes sure to match them against the version of VirtualBox the user has installed (whereas Docker's Vagrantfile has the version hardcoded.) It might be a good idea to remove guest addition logic from Docker entirely and just suggest that people using VirtualBox install the plugin. However, I'm not sure if the plugin will run in the correct order to install the guest additions after Docker's provisioning has upgraded the kernel. |
|
Thank you @jimmycuadra. Yes, I like your implementation. As discussed in #1449, we are planning to move away the guest additions VBox functionality from /Vagrantfile and possibly move it to /hack/Vagrantfile Let's discuss there. |
|
It turns out we are not quite ready to deprecate guest additions right now. |
|
Done! |
Better VirtualBox detection in Vagrantfile
|
Thank you @jimmycuadra. |
|
For completion, assumptions and unpinned kernel was added in 8878943 |
This patch improves detection of the VirtualBox provider during Vagrant provisioning so that it considers the environment variable
VAGRANT_DEFAULT_PROVIDER. If it's set, it will now assume that you are not using VirtualBox. The VB guest additions will still be installed in some unusual cases, e.g.:VAGRANT_DEFAULT_PROVIDER=virtualbox vagrant upVAGRANT_DEFAULT_PROVIDER=vmware_fusion vagrant up --provider virtualboxHowever, users are unlikely to invoke
vagrantwith those combinations as they don't really make sense. This simply makes an educated guess based on the presence of the environment variable.