diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 3f8e419b3..0b6cf528b 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -511,7 +511,7 @@ module VagrantPlugins @base_mac = nil if @base_mac == UNSET_VALUE @base_address = nil if @base_address == UNSET_VALUE @boot_timeout = 300 if @boot_timeout == UNSET_VALUE - @box = nil if @box == UNSET_VALUE + @box = nil if @box == UNSET_VALUE || @box.to_s.empty? @ignore_box_vagrantfile = false if @ignore_box_vagrantfile == UNSET_VALUE if @box_check_update == UNSET_VALUE diff --git a/test/unit/plugins/kernel_v2/config/vm_test.rb b/test/unit/plugins/kernel_v2/config/vm_test.rb index 914d3c74f..bf3ec3aae 100644 --- a/test/unit/plugins/kernel_v2/config/vm_test.rb +++ b/test/unit/plugins/kernel_v2/config/vm_test.rb @@ -86,6 +86,12 @@ describe VagrantPlugins::Kernel_V2::VMConfig do assert_invalid end + it "cannot be an empty string" do + subject.box = "" + subject.finalize! + assert_invalid + end + it "is not required if the provider says so" do machine.provider_options[:box_optional] = true subject.box = nil