diff --git a/tools/windows-vm/win11.pkr.hcl b/tools/windows-vm/win11.pkr.hcl index 8c0f97f..99d2c1b 100644 --- a/tools/windows-vm/win11.pkr.hcl +++ b/tools/windows-vm/win11.pkr.hcl @@ -90,6 +90,7 @@ source "proxmox-iso" "win11" { } boot_iso { + type = "ide" iso_file = var.iso_file unmount = true } @@ -105,7 +106,7 @@ source "proxmox-iso" "win11" { # which also validates the XML first - an invalid answer file makes Setup # reboot in a loop, which is a miserable thing to debug. additional_iso_files { - device = "ide0" + device = "ide2" iso_file = "local:iso/answer.iso" unmount = true iso_storage_pool = "local" @@ -113,13 +114,20 @@ source "proxmox-iso" "win11" { # This is the whole point of the exercise. Repeat the spacebar rather than # pressing once: the prompt renders a variable beat after the DVD is selected. - boot = "order=ide0;virtio0" - boot_wait = "4s" - boot_command = [ - "", - "", - "", - ] + boot = "order=ide0;virtio0" + # The media prompt appears ~10-20 s into UEFI boot, not at 4 s, so wait longer + # and keep tapping across a 40-second span. One press is a race against the + # prompt rendering; forty spaced presses is not. + # BLOCKED, do not re-add: the VM is created with only a usb-tablet, so the VNC + # boot_command has no keyboard to land on and the "press any key" media prompt + # times out -> UEFI falls through to "no bootable option". The fix would be + # qemu_additional_args = "-device usb-kbd" + # but Proxmox answers 500 "only root can set 'args' config" for any API user + # other than root@pam. Either build with a root@pam token, or strip + # efi/microsoft/boot/bootfix.bin from the ISO so no keypress is needed. + + boot_wait = "10s" + boot_command = ["${join("", [for i in range(40) : ""])}"] # Wait for Setup to finish, reboot, and land on the desktop; then let # sysprep/generalise (invoked by firstboot.ps1) shut the machine down.