I am diving into Packer head first and have ran into an issue where it will not get an IP address. I suspect it is due to the DHCP helper in place for our current imaging method with SCCM, but I am not sure how to verify.
Is there a way to set a static IP for the template?
I am not sure that helps. I am doing this for Windows by the way, but I did find the winrm stuff off of your link. I believe my issue occurs well before either comes into play. Packer creates the vm and powers it on, but then stalls out.
I’m having the exact same issue. Attempting to build a Windows Server 2019 image and getting stuck on Waiting for IP…
I read through the vsphere-iso builder documentation (VSphere ISO - Builders | Packer by HashiCorp) and didn’t see anywhere to set a static IP. I read elsewhere that vmware tools needs to be installed first, but this is so early in the process I don’t think VMware tools can be installed yet.
I actually got it figured out. I never saw the answer anywhere, but after some trial and error, I found that it is working correctly, but you have to wait for Windows to setup and vmware tools to install. Also, you need to make sure vmware tools gets installed in the Specialize pass of the autounattend. That way it will reboot before doing the other stuff. Once it reboots after vmware tools, it gets an IP and you will find the packer process starts moving again.
Thank you. After messing around with it some more I was able to get mine working as well. For me it was a facepalm issue where I had a typo in the iso path so it wasn’t even mounting my Windows ISO. D’oh!
There are many topics related to the windows/winrm/waiting for ip problem(s). Most of the time the machines had to be rebooted (typical Windows problem solving) one or two times for getting vmware tools/ winrm up and running.
Using “Packer windows winrm” as search string there will be some more hints.
Could you please tell me how you got this to work? I’ve added my vmware tools install script into the Specialize pass now, but I’m still getting stuck at “Waiting for IP” with the Packer build. The Server ISO loads, and I know my DHCP server is definitely working… but the VM is just sitting at the Windows Setup screen and doesn’t seem to be moving on from there.
Any help would be greatly appreciated!