While trying to run the virtual-box-iso builder on a WSL2 environment, I had issues getting the WSL2 to connect to the VirtualBox running on the Windows host through SSH.
This is because a connection coming from WSL is not considered a local connection (at least when using the default NAT networkingMode on WSL) and the virtual box is hard coded to port forward request coming on 127.0.0.1.
Changes
Added the property ssh_listen_address which makes it possible for clients to specify the address where the SSH port forwarding will be set to listen on.
Motivation
While trying to run the virtual-box-iso builder on a WSL2 environment, I had issues getting the WSL2 to connect to the VirtualBox running on the Windows host through SSH.
This is because a connection coming from WSL is not considered a local connection (at least when using the default
NAT
networkingMode on WSL) and the virtual box is hard coded to port forward request coming on127.0.0.1
.Changes
Added the property
ssh_listen_address
which makes it possible for clients to specify the address where the SSH port forwarding will be set to listen on.Dependency
This pull-request depends on https://github.com/hashicorp/packer-plugin-sdk/pull/257 since it was used to generate the documentation for the
http_network_protocol
property and to test the overall changes.