Reputation: 1343
I recently noticed that I managed to have a version of Vagrant and VirtualBox installed that did not work with my Vagrantfile
. Upgrading to the latest Vagrant & VirtualBox fixed the problem.
Is it possible to ensure minimum Vagrant and VirtualBox versions are installed before allowing vagrant up
to launch?
Upvotes: 4
Views: 391
Reputation: 3054
For Vagrant itself, there is built-in support:
Vagrant.require_version ">= 1.3.5"
For Virtualbox, you can run some code at the top of your Vagrantfile like this:
if Gem::Version.new(`VBoxManage --version`.strip) <
Gem::Version.new('5.1.6')
abort "Please upgrade Virtualbox to 5.1.6 or later!"
end
Upvotes: 4