diff --git a/plugins/providers/virtualbox/util/compile_forwarded_ports.rb b/plugins/providers/virtualbox/util/compile_forwarded_ports.rb index fb8953f56..fe281c970 100644 --- a/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +++ b/plugins/providers/virtualbox/util/compile_forwarded_ports.rb @@ -1,7 +1,11 @@ +require "vagrant/util/scoped_hash_override" + module VagrantPlugins module ProviderVirtualBox module Util module CompileForwardedPorts + include Vagrant::Util::ScopedHashOverride + # This method compiles the forwarded ports into {ForwardedPort} # models. def compile_forwarded_ports(config) @@ -12,6 +16,7 @@ module VagrantPlugins guest_port = args[0] host_port = args[1] options = args[2] || {} + options = scoped_hash_override(options, :virtualbox) id = options[:id] || "#{guest_port.to_s(32)}-#{host_port.to_s(32)}"