mwrock / packer-templates

Templates for creating vagrant boxes
Other
535 stars 250 forks source link

Either set "ssh_skip_nat_mapping" or let Packer select a WinRM port dynamically #82

Closed frischke closed 7 years ago

frischke commented 7 years ago

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 to true (default is false).

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:

frischke commented 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.

mwrock commented 7 years ago

closing this for now. I removed the winrm port setting alltogether and packer can now connect.