Skip to content

Better VirtualBox detection in Vagrantfile#1578

Merged
mzdaniel merged 1 commit intomoby:masterfrom
jimmycuadra:vagrant-provider-detection
Sep 4, 2013
Merged

Better VirtualBox detection in Vagrantfile#1578
mzdaniel merged 1 commit intomoby:masterfrom
jimmycuadra:vagrant-provider-detection

Conversation

@jimmycuadra
Copy link
Copy Markdown
Contributor

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 up
  • VAGRANT_DEFAULT_PROVIDER=vmware_fusion vagrant up --provider virtualbox

However, users are unlikely to invoke vagrant with those combinations as they don't really make sense. This simply makes an educated guess based on the presence of the environment variable.

@jimmycuadra
Copy link
Copy Markdown
Contributor Author

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.

@mzdaniel
Copy link
Copy Markdown
Contributor

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.

@mzdaniel mzdaniel closed this Aug 19, 2013
@mzdaniel mzdaniel reopened this Sep 4, 2013
@ghost ghost assigned mzdaniel Sep 4, 2013
@mzdaniel
Copy link
Copy Markdown
Contributor

mzdaniel commented Sep 4, 2013

It turns out we are not quite ready to deprecate guest additions right now.
Would you mind rebasing your commit for merging?

@jimmycuadra
Copy link
Copy Markdown
Contributor Author

Done!

mzdaniel added a commit that referenced this pull request Sep 4, 2013
Better VirtualBox detection in Vagrantfile
@mzdaniel mzdaniel merged commit 8e3844c into moby:master Sep 4, 2013
@mzdaniel
Copy link
Copy Markdown
Contributor

mzdaniel commented Sep 4, 2013

Thank you @jimmycuadra.

mzdaniel added a commit that referenced this pull request Sep 4, 2013
@mzdaniel
Copy link
Copy Markdown
Contributor

mzdaniel commented Sep 4, 2013

For completion, assumptions and unpinned kernel was added in 8878943

@jimmycuadra jimmycuadra deleted the vagrant-provider-detection branch October 6, 2013 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants