hashicorp / packer-plugin-virtualbox

Packer plugin for VritualBox Builder
https://www.packer.io/docs/builders/virtualbox
Mozilla Public License 2.0
22 stars 36 forks source link

HTTP server is unreachable by default in recent Virtualbox versions #104

Closed kristianheljas closed 6 months ago

kristianheljas commented 1 year ago

Overview of the Issue

Starting from Virtualbox 7.0.0, packer http server is not reachable from the guests by default.

This is due to a new security option --nat-localhostreachableN (introduced in Virtualbox 7.0.0) which is "off" by default, disabling access to host gateway (10.0.2.2) directly. This is not apparent in changelogs as this is a security change, which Oracle does not communicate transparently.

Thanks klaus-vb from #vbox:irc.oftc.net for this info!

Proposed fix

Configure virtualbox vm with --nat-localhostreachable1 on on Virtualbox versions >= 7.0.0 (<7.0.0 do not have this option).

Until then, this is the workaround:

vboxmanage = [
  ["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
]

Reproduction Steps

See https://github.com/hashicorp/packer/issues/12118

ifurther commented 4 months ago

@lbajolet-hashicorp Does have the plan public new version ?