diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f458b764..2dd5c6ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ IMPROVEMENTS: - core: add `--color` to any Vagrant command to FORCE color output. [GH-2027] - core: "config.vm.host_name" works again, just an alias to hostname. - core: Reboots via SSH are now handled gracefully (without exception). + - core: Mark `disabled` as true on forwarded port to disable. [GH-1922] - commands/plugin/install: Post install message of a plugin will be shown if available. [GH-1986] - commands/status: cosmetic improvement to better align names and diff --git a/plugins/providers/virtualbox/util/compile_forwarded_ports.rb b/plugins/providers/virtualbox/util/compile_forwarded_ports.rb index 7c2bef66f..363722b18 100644 --- a/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +++ b/plugins/providers/virtualbox/util/compile_forwarded_ports.rb @@ -19,6 +19,9 @@ module VagrantPlugins options = scoped_hash_override(options, :virtualbox) id = options[:id] + # If the forwarded port was marked as disabled, ignore. + next if options[:disabled] + mappings[host_port.to_s + protocol.to_s] = Model::ForwardedPort.new(id, host_port, guest_port, options) end