Windows AWS Tutorial stuck on 'Waiting for WinRM to become available'

I’m running through the tutorial here Build a Windows Image | Packer - HashiCorp Learn.

It continuously gets stuck on the step:

==> amazon-ebs.firstrun-windows: Waiting for WinRM to become available...

The debug logging shows it repeatedly looping on these steps:

2021/06/14 17:06:08 packer-plugin-amazon_v0.0.1_x5.0_linux_amd64 plugin: 2021/06/14 17:06:08 [INFO] Attempting WinRM connection...
2021/06/14 17:06:08 packer-plugin-amazon_v0.0.1_x5.0_linux_amd64 plugin: 2021/06/14 17:06:08 [DEBUG] connecting to remote shell using WinRM
2021/06/14 17:06:38 packer-plugin-amazon_v0.0.1_x5.0_linux_amd64 plugin: 2021/06/14 17:06:38 [ERROR] connection error: unknown error Post "http://ec2-18-217-112-193.compute-1.amazonaws.com:5985/wsman": dial tcp 18.217.112.193:5985: i/o timeout

I’ve tried various solutions referenced online (changing admin password, different base AMI, etc) and nothing seems to work.

I can RDP into the instance and see that the WinRM firewall rules look correct, and it appears to be running. However, probing the port remotely via nc -zv $ip 5985 never returns.

Has anyone run through the tutorial verbatim recently? Is this just an issue on my end?

Edit: I’ve also just now realized the <powershell> tags are in the HTML and not in the code sample. Fixing that doesn’t change the behavior I’m seeing.

1 Like