hashicorp / packer-plugin-virtualbox

Packer plugin for VritualBox Builder
https://www.packer.io/docs/builders/virtualbox
Mozilla Public License 2.0
22 stars 36 forks source link

Ability to change the ssh port forwarding interface #134

Open ejdre-vestas opened 2 months ago

ejdre-vestas commented 2 months ago

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

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.

ejdre-vestas commented 1 month ago

"Go validate" action will fail until the dependency is merged.