Open zarr12steven opened 3 years ago
Have the same problem. Host is Windows 10, guest is Ubuntu 18 using VirtualBox-iso source and ssh_port is recognised if I set skip_nat_mapping=true but on Packer 1.7.4 ssh_host was ignored.
Downgrading to 1.6.6 fixes the issue for me too.
it seems to work again on 1.8.0, but gets broken again on 1.8.2
Still broken on 1.9.4 (VirtualBox 6.1.38). ssh_host
is apparently ignored so I can't make the communicator connect directly to the other host only adapter in the machine.
What is further annoying is that the port mapping is broken as well. It adds the mapping with a source host of 127.0.0.1
, however this does not work. On my machine at least it's the IP address of my local ethernet adapter that needs to be specified in the VirtualBox port mapping.
I proved this by letting Packer start the virtual machine then manually going in and changing the port mapping that it has created - eh voila.
Quite a frustrating start to proceedings.
Edit:
I've managed to solve this by manually overriding the port mapping:
skip_nat_mapping = true
ssh_port = "2322"
vboxmanage = [
["modifyvm", "{{.Name}}", "--natpf1", "packer,tcp,,2322,,22"],
]
Host Information
v1.7.3
6.1.22r144080
Guest VM
CentOS Linux release 7.9.2009 (Core)
ks.cfg
centos7.json
Packer Debug Log
Exepct step
I already setting
ssh_host
:192.168.1.126
in centos7.json, but I check log show meTCP connection to SSH ip/port failed: dial tcp 127.0.0.1:22: connect: connection refused
, how to resolve this issue ?By the way, I can build success before on packer 1.6.X.