-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to change the ssh port forwarding interface #134
base: main
Are you sure you want to change the base?
Conversation
"Go validate" action will fail until the dependency is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ejdre-vestas,
Thanks for this PR as well!
I have a comment that's quite similar to the one I left on your SDK PR, I would suggest making this a string, so users can specify whichever address is relevant to them, but aside from this nit, this looks good to me.
I'll let you address this when possible and I'll do another pass of review then.
Thanks!
@@ -26,6 +26,9 @@ type CommConfig struct { | |||
// does not setup forwarded port mapping for communicator (SSH or WinRM) requests and uses ssh_port or winrm_port | |||
// on the host to communicate to the virtual machine. | |||
SkipNatMapping bool `mapstructure:"skip_nat_mapping" required:"false"` | |||
// Defaults to false. When enabled, the ssh port forwarding will be set to listen on 0.0.0.0 | |||
// as opposed to 127.0.0.1 | |||
SSHListenOnAllInterfaces bool `mapstructure:"ssh_listen_on_all_interfaces" required:"false"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could specify the listening address to be whatever we choose here instead of this flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the comments. I have pushed a new commit.
…an specify the address
Hi, any chance to get this pull-request looked at again? I believe I have done all the requested changes. |
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 hashicorp/packer-plugin-sdk#257 since it was used to generate the documentation for the
http_network_protocol
property and to test the overall changes.