Troubleshooting winrm usually involves running the automation (Packer build / Terraform apply) until winrm fails, then inspecting the system to see where the failure is occurring. To do so please try the following steps.
If you have destroyed the infrastructure, please spin it back up with the automation tool (Packer or Terraform) and let the provisioner or build fail.
Establish that you have connectivity to the network that the VM is hosted on. This can be done by checking the IP address(es) and using a tool like route
.
Open a Powershell session on your Windows workstation. The winrm connectivity tools are not available on other operating systems. You can skip some steps or try to substitute for them, but it's best to use a Windows workstation. A Windows 10 VM can be spun up using Vagrant, for example.
Establish that a raw connection can be made to the winrm service from your workstation. Run the command Test-netConnection -Port 5985
, providing the IP address that Packer or Terraform is