From 28e75b23b39aa0aee951378bf1039886c00f7783 Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Sat, 17 Aug 2013 23:58:04 -0700 Subject: [PATCH] Don't install VirtualBox Guest Additions if VAGRANT_DEFAULT_PROVIDER is set. --- Vagrantfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index ab631dbe26..4609f9fa2d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -22,11 +22,8 @@ Vagrant::Config.run do |config| # Add Ubuntu raring backported kernel pkg_cmd << "apt-get update -qq; apt-get install -q -y linux-image-generic-lts-raring; " # Add guest additions if local vbox VM - is_vbox = true - # The logic here makes a few assumptions (i.e. no one uses --provider=virtualbox) - ARGV.each do |arg| is_vbox &&= ( !arg.downcase.start_with?("--provider") && !ENV['VAGRANT_DEFAULT_PROVIDER'] )end - if is_vbox - pkg_cmd << "apt-get install -q -y linux-headers-generic-lts-raring dkms; " \ + if ENV["VAGRANT_DEFAULT_PROVIDER"].nil? && ARGV.none? { |arg| arg.downcase.start_with?("--provider") } + pkg_cmd << "apt-get install -q -y linux-headers-3.8.0-19-generic dkms; " \ "echo 'Downloading VBox Guest Additions...'; " \ "wget -q http://dlc.sun.com.edgesuite.net/virtualbox/4.2.12/VBoxGuestAdditions_4.2.12.iso; " # Prepare the VM to add guest additions after reboot