-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HTTPIP on Windows gets IP address from wrong Ethernet adapter #10168
Comments
Hi @Weilbyte thanks for reaching out. The HTTP server IP detection will default to the first non-loopback interface. Unfortunately selecting the correct interface is not something Packer can do without a little help. There is a configuration option called Have you tired setting http_interface? I understand how that makes the configuration a bit host specific so I would recommend using a variable for setting the interface. If you don't set a default value the build will require the user to set it at run time to the appropriate value. With that said, the HTTP server is actually bond to 0.0.0.0 so if you provide the configuration the correct address back to the machine running the build it should be able to access the server. This means that instead of using {{ .HTTPIP}} you would hard code the IP. This is a workaround. I think the correct path forward would be to use the I don't think this is a bug so I am going to add the question label to this issue for now. But if you think differently or run into problems with the suggested solutions please don't hesitate to let us know. Cheers! |
Thanks @nywilken for responding. A variable for |
Glad to hear the
Regarding your question, I don't think that this is something that Packer would be able to guarantee to be correct even with added logic for testing connectivity to and from the guest host, Internet, etc. With that said, I can see a case where Packer is working in entirely closed network where Internet is not available. In these cases our approach is to let the user tell Packer what the right path is to avoid any issues. I'm going to close this issue since I don't think there is anything for us to do here. But if you or another member of the Packer community is interested in opening up a PR that improves on interface/Ethernet detection we would be happy to review and take it into consideration. Cheers 😄 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Overview of the Issue
When using Packer on Windows, the
{{ .HTTPIP }}
variable picks up the wrong IP address. Myipconfig
looks like this below:The last adapter,
Ethernet
is the one that should be picked as that is the only one accessible by my local server where the VM is provisioned. However Packer insists on using172.25.16.1
for HTTPIP. This can probably be avoided by specifying bind address to the correct one, but then this configuration becomes specific to the machine it runs on as the bind address would need to be changed.Reproduction Steps
Packer version
Packer v1.6.4
Simplified Packer Buildfile
Shouldn't be buildfile specific.
Operating system and Environment details
Running from Windows 10 machine.
Using Proxmox builder.
The text was updated successfully, but these errors were encountered: