Hi Varma, Are you using the private IP option for the VM? If so, run the packer.exe file from the same virtual network the packer vm is building on. If you are using a public ip, make sure that you don't have an NSG or firewall blocking the WinRM requests.
Issue with win RM while configuring VM in the backend
Issue description:
When we run packer buid in the backend VM creates during this process we are seeing winrm time out issue
Error:
==> azure-arm.autogenerated_1: Removing the created Deployment object: 'kvpkrdpvdfu0h9tfg'
==> azure-arm.autogenerated_1:
==> azure-arm.autogenerated_1: The resource group was not created by Packer, not deleting ...
Build 'azure-arm.autogenerated_1' errored after 8 minutes 40 seconds: Timeout waiting for WinRM.
==> Wait completed after 8 minutes 40 seconds
==> Some builds didn't complete successfully and had errors:
--> azure-arm.autogenerated_1: Timeout waiting for WinRM.
==> Builds finished but no artifacts were created.
Azure Virtual Machines
1 additional answer
Sort by: Most helpful
-
vipullag-MSFT 26,487 Reputation points Moderator
2024-02-12T05:46:45.27+00:00 Hello Varma
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
Based on the details shared (issue related to the WinRM connection timing out while running the Packer build), this could happen if the WinRM service is not running or if there is a network connectivity issue between the Packer build machine and the target VM.
To troubleshoot this issue, you can try the following steps:
-Check if the WinRM service is running on the target VM.
-Check if the network connectivity between the Packer build machine and the target VM is working properly. You can do this by pinging the target VM from the Packer build machine and vice versa.
-Increase the WinRM timeout value in the Packer build configuration file.
If the issue persists, you can try using SSH instead of WinRM to connect to the target VM. To do this, you need to modify the Packer build configuration file to use SSH instead of WinRM. You can find more information on how to do this in the Packer documentation.
I hope this helps you resolve the issue.