UEFI for windows 11 build for KVM/QEMU

Hi,

I have disabled the TPM while installing the windows, the image created by the packer works fine with the KVM’s VM when I run it with the Bios but it doesn’t run with the UEFI settings.

I have tried all settings for the UEFI but things don’t work. I have tried followings,

variable "efi_firmware_code" {

  type = string

default = "/usr/share/OVMF/OVMF_CODE.fd"

}

variable "efi_firmware_vars" {

type = string

default = "/usr/share/OVMF/OVMF_VARS.fd"

}

  # efi_boot = true

  # efi_firmware_code = "${var.efi_firmware_code}"

# efi_firmware_vars = "${var.efi_firmware_vars}"

# vtpm = false

When I bring in these settings, WinRM gets time_out with the following error.

0:54:13 [ERROR] WinRM connection err: unknown error Post “https://127.0.0.1:3760/wsman”: read tcp 127.0.0.1:47664->127.0.0.1:3760: read: connection reset by peer
2026/01/28 00:54:18 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2026/01/28 00:54:18 [INFO] Attempting WinRM connection…
2026/01/28 00:54:18 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2026/01/28 00:54:18 [DEBUG] connecting to remote shell using WinRM
==> qemu.win11_23h2: Timeout waiting for WinRM.
2026/01/28 00:54:19 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2026/01/28 00:54:19 failed to unlock port lockfile: close tcp 127.0.0.1:5973: use of closed network connection
2026/01/28 00:54:19 packer-plugin-qemu_v1.1.4_x5.0_linux_amd64 plugin: 2026/01/28 00:54:19 failed to unlock port lockfile: close tcp 127

Does anyone have a clue ?