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).
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:
Reproduction Steps
See https://github.com/hashicorp/packer/issues/12118