From d53e18906353ace5956d57a2feb01c4b5122ed2b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 6 Feb 2013 16:55:49 -0800 Subject: [PATCH] Use the proper provider upgrade mechanism in V1 VM --- plugins/kernel_v1/config/vm.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/kernel_v1/config/vm.rb b/plugins/kernel_v1/config/vm.rb index 368ab148f..271e713b4 100644 --- a/plugins/kernel_v1/config/vm.rb +++ b/plugins/kernel_v1/config/vm.rb @@ -100,14 +100,20 @@ module VagrantPlugins new.vm.usable_port_range = self.auto_port_range if self.auto_port_range if self.boot_mode - # Enable the GUI if the boot mode is GUI. - new.vm.providers[:virtualbox].config.gui = (self.boot_mode.to_s == "gui") + new.vm.provider :virtualbox do |vb| + # Enable the GUI if the boot mode is GUI. + vb.gui = (self.boot_mode.to_s == "gui") + end end # If we have VM customizations, then we enable them on the # VirtualBox provider on the new VM. - self.customizations.each do |customization| - new.vm.providers[:virtualbox].config.customize(customization) + if !self.customizations.empty? + new.vm.provider :virtualbox do |vb| + self.customizations.each do |customization| + vb.customize(customization) + end + end end # Re-define all networks.