diff --git a/plugins/providers/virtualbox/config.rb b/plugins/providers/virtualbox/config.rb index d7d3b2269..0aa9bde1d 100644 --- a/plugins/providers/virtualbox/config.rb +++ b/plugins/providers/virtualbox/config.rb @@ -120,6 +120,14 @@ module VagrantPlugins end end + # Verify that internal networks are only on private networks. + machine.config.vm.networks.each do |type, data| + if data[:virtualbox__intnet] && type != :private_network + errors << I18n.t("vagrant.virtualbox.config.intnet_on_bad_type") + break + end + end + { "VirtualBox Provider" => errors } end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 0348d4ddc..c22812f43 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -61,6 +61,8 @@ en: config: id_in_pre_import: |- The ':id' parameter is not available in "pre-import" customizations. + intnet_on_bad_type: |- + VirtualBox internal networks can only be enabled on "private_networks" invalid_event: |- %{event} is not a valid event for customization. Valid events are: %{valid_events}