Closed frischke closed 7 years ago
Unfortunately, the Packer documentation does not state that ssh_skip_nat_mapping
also applies to the WinRM port (see the current Packer doc). I will probably open an issue in the Packer repository regarding this behavior too.
closing this for now. I removed the winrm port setting alltogether and packer can now connect.
In the current version of Packer (0.12.3), the virtualbox-iso builder tries to discover a suitable port for forwarding winrm (and ssh) traffic dynamically. Unfortunately Packer also overwrites an explicitly configured winrm_port with the discovered port, unless
ssh_skip_nat_mapping
is also set totrue
(default isfalse
).As a consequence, the vbox builds will eventually time out since Packer cannot connect to the Virtualbox VM successfully. I suggest to either add the
"ssh_skip_nat_mapping": "true"
option to the vbox-\<os>.json config files or remove the explicitly configured winrm_port and the corresponding VBox port forwarding rule entirely and let Packer find a suitable port.Relevant code references in Packer:
ssh_skip_nat_mapping
istrue
, it tries to discover a port and if found, configures port forwarding on the vbox vm. The discovered port is stored in the StateBag under the"sshHostPort"
key.WinRMPort
.