windows-vm: Packer schema corrected; the keystroke path is blocked at the API

boot_iso needs an explicit type, otherwise the block is silently ignored and the
VM is built with no installation media at all. The media prompt is still missed:
Proxmox gives Packer's VM only a usb-tablet, and its own remedy for that
(qemu_additional_args) is refused with 500 "only root can set 'args' config".
Documented in place for whoever runs this next.
This commit is contained in:
ziadarafat committed 2026-11-28 20:29:28 -07:00
1 parent c1303d61c7
commit 0a1eaab6e7
1 file changed
+16 -8
+16 -8
View File
@@ -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 = [
"<wait><spacebar><wait><spacebar><wait><spacebar><wait><spacebar><wait>",
"<spacebar><wait><spacebar><wait><spacebar><wait><spacebar><wait>",
"<spacebar><wait><spacebar><wait><spacebar><wait><spacebar><wait>",
]
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 = ["<wait>${join("", [for i in range(40) : "<spacebar><wait>"])}"]
# Wait for Setup to finish, reboot, and land on the desktop; then let
# sysprep/generalise (invoked by firstboot.ps1) shut the machine down.