Issue with win RM while configuring VM in the backend

Varma 1,495 Reputation points
2024-02-12T05:18:00.07+00:00

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.User's image

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,014 questions
{count} votes

Accepted answer
  1. Martin Therkelsen 1,410 Reputation points MVP
    2024-02-13T14:54:17.4933333+00:00

    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.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.