Skip to content

amazon-ebs: WinRM connection error unknown error Post "https://<ip>:5986/wsman": EOF #621

@zamanh

Description

@zamanh

Overview of the Issue

Getting an unusual error when I am trying to connect to a Windows instance from an already existing AMI.

12:42:39:342 INFO: [win2012_x64_aws_std_en_us] [packer] 2025/10/08 12:42:39 packer-plugin-amazon_v1.5.0_x5.0_windows_amd64.exe plugin: 2025/10/08 12:42:39 Using host value: 10.237.78.166
12:42:39:345 INFO: [win2012_x64_aws_std_en_us] [packer] 2025/10/08 12:42:39 packer-plugin-amazon_v1.5.0_x5.0_windows_amd64.exe plugin: 2025/10/08 12:42:39 [INFO] Attempting WinRM connection...
12:42:39:347 INFO: [win2012_x64_aws_std_en_us] [packer] 2025/10/08 12:42:39 packer-plugin-amazon_v1.5.0_x5.0_windows_amd64.exe plugin: 2025/10/08 12:42:39 [DEBUG] connecting to remote shell using WinRM
12:43:24:397 INFO: [win2012_x64_aws_std_en_us] [packer] 2025/10/08 12:43:24 packer-plugin-amazon_v1.5.0_x5.0_windows_amd64.exe plugin: 2025/10/08 12:43:24 [ERROR] connection error: unknown error Post "https://10.237.78.166:5986/wsman": EOF

Reproduction Steps

  • Attempt a packer build

Plugin and Packer version

  • Packer v1.14.2
  • Plugin version: 1.5.0

Simplified Packer Buildfile

Details
source "amazon-ebs" "win-ami" {
  region =  var.region
  vpc_id = var.vpc_id
  subnet_id = var.subnet
  security_group_id = var.security_group

  source_ami = var.ami_id  # use an existing Windows AMI

  instance_type =  var.instance_type

  communicator = "winrm"
  winrm_username       = var.ami_user
  winrm_password       = "${var.admin_password}"
  winrm_use_ssl        = true
  winrm_timeout        = "30m"
  winrm_port           = 5986
  winrm_insecure       = true 

  ssh_interface = "private_ip"
  ssh_username =  var.ami_user

  ami_name = "${var.vm_name}-{{uuid}}-{{timestamp}}"
  ami_description = "Packer-Import process: ${var.display_name}"
  ami_regions = [var.region]

  launch_block_device_mappings {
    device_name = var.ami_device_name
    volume_size = var.disk_size / 1024
    volume_type = "gp3"
    delete_on_termination = true
  }
}

Operating system and Environment details

  • Windows 11 25H2 (Powershell 7.5.3)
  • Ubuntu 24.04 (under WSL2 gives me the same issue too)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions