From dbcc936a713d2d7683dfbe2d691a758754fd8083 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 8 Oct 2015 12:41:16 -0400 Subject: [PATCH] kernel/v2: box is optional if clone is set --- plugins/kernel_v2/config/vm.rb | 2 +- plugins/providers/virtualbox/action/match_mac_address.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 3d87e2b87..3020611f4 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -559,7 +559,7 @@ module VagrantPlugins def validate(machine) errors = _detected_errors - if !box && !machine.provider_options[:box_optional] + if !box && !clone && !machine.provider_options[:box_optional] errors << I18n.t("vagrant.config.vm.box_missing") end diff --git a/plugins/providers/virtualbox/action/match_mac_address.rb b/plugins/providers/virtualbox/action/match_mac_address.rb index a66f40bad..10e998b2e 100644 --- a/plugins/providers/virtualbox/action/match_mac_address.rb +++ b/plugins/providers/virtualbox/action/match_mac_address.rb @@ -7,6 +7,9 @@ module VagrantPlugins end def call(env) + # If we cloned, we don't need a base mac, it is already set! + return @app.call(env) if env[:machine].config.vm.clone + raise Vagrant::Errors::VMBaseMacNotSpecified if !env[:machine].config.vm.base_mac # Create the proc which we want to use to modify the virtual machine