Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qemu stderr: gtk initialization failed #272

Open
mikoday opened this issue Oct 28, 2024 · 9 comments
Open

Qemu stderr: gtk initialization failed #272

mikoday opened this issue Oct 28, 2024 · 9 comments

Comments

@mikoday
Copy link

mikoday commented Oct 28, 2024

Hello, I'm trying to make Windows image on Ubuntu 24.04.1 (Noble Numbat) but have below error:
Qemu stderr: gtk initialization failed
I even build Qemu from source with these parameters but without success.
./configure --enable-gtk --enable-slirp

Here is my output:
root@maas:/home/maas/packer-maas/windows# make windows ISO=/home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso VERSION=11 windows.json PACKER_LOG=1
rm -f -rf output-* windows.tar.gz http/Autounattend.xml \
drivers.iso OVMF_VARS.fd
cp -v /usr/share/OVMF/OVMF_VARS_4M.fd OVMF_VARS.fd
'/usr/share/OVMF/OVMF_VARS_4M.fd' -> 'OVMF_VARS.fd'
mkisofs -o drivers.iso -V 'Extra Drivers' -input-charset utf-8 drivers
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 2198
Path table size(bytes): 22
Max brk space used 0
176 extents written (0 MB)
sed s#@VERSION@#"Windows 11 PRO"#g http/Autounattend.xml.uefi.template > http/Autounattend.xml
sed -i 's/<!--<LocalAccounts>/<LocalAccounts>/;s/<\/LocalAccounts>-->/<\/LocalAccounts>/' http/Autounattend.xml
packer init . && packer build -var iso_path=/home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso \
-var headless=false \
-var ovmf_suffix=_4M \
windows.pkr.hcl
2024/10/28 15:49:37 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/10/28 15:49:37 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/10/28 15:49:37 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/10/28 15:49:37 [WARN] Config file doesn't exist: /root/.packerconfig
2024/10/28 15:49:37 [INFO] Setting cache directory: /root/.cache/packer
2024/10/28 15:49:37 [TRACE] init: plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0007ee000)}}, ReleasesOnly:true}}
2024/10/28 15:49:37 [TRACE] listing potential installations for "github.com/hashicorp/qemu" that match "~> 1.0". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0007ee000)}}, ReleasesOnly:true}}
2024/10/28 15:49:37 [INFO] (telemetry) Finalizing.
2024/10/28 15:49:37 waiting for all plugin processes to complete...
2024/10/28 15:49:37 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/10/28 15:49:37 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/10/28 15:49:37 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/10/28 15:49:37 [WARN] Config file doesn't exist: /root/.packerconfig
2024/10/28 15:49:37 [INFO] Setting cache directory: /root/.cache/packer
2024/10/28 15:49:37 [TRACE] listing potential installations for "github.com/hashicorp/qemu" that match "~> 1.0". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0000d8a80)}}, ReleasesOnly:false}}
2024/10/28 15:49:37 [TRACE] Found the following "github.com/hashicorp/qemu" installations: [{/root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 v1.1.0 x5.0}]
2024/10/28 15:49:37 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/10/28 15:49:37 [TRACE] listing potential installations for <nil> that match "". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000802100)}}, ReleasesOnly:false}}
2024/10/28 15:49:37 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/10/28 15:49:37 [TRACE] validateValue: not active for iso_path, so skipping
2024/10/28 15:49:37 [TRACE] validateValue: not active for ovmf_suffix, so skipping
2024/10/28 15:49:37 [TRACE] validateValue: not active for filename, so skipping
2024/10/28 15:49:37 [TRACE] validateValue: not active for headless, so skipping
2024/10/28 15:49:37 [INFO] Starting external plugin /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 start builder -packer-default-plugin-name-
2024/10/28 15:49:37 Starting plugin: /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 []string{"/root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64", "start", "builder", "-packer-default-plugin-name-"}
2024/10/28 15:49:37 Waiting for RPC address for: /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Plugin address: unix /tmp/packer-plugin4224969945
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Waiting for connection...
2024/10/28 15:49:37 Received unix RPC address for /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: addr is /tmp/packer-plugin4224969945
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Serving a plugin connection...
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 [TRACE] starting builder -packer-default-plugin-name-
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 use specified accelerator: kvm
2024/10/28 15:49:37 [INFO] Starting internal plugin packer-post-processor-shell-local
2024/10/28 15:49:37 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "execute", "packer-post-processor-shell-local"}
2024/10/28 15:49:37 Waiting for RPC address for: /usr/bin/packer
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: [INFO] Setting cache directory: /root/.cache/packer
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: args: []string{"packer-post-processor-shell-local"}
2024/10/28 15:49:37 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin3417990858
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: Plugin address: unix /tmp/packer-plugin3417990858
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: Waiting for connection...
2024/10/28 15:49:37 packer-post-processor-shell-local plugin: Serving a plugin connection...
2024/10/28 15:49:37 [INFO] Starting internal plugin packer-post-processor-compress
2024/10/28 15:49:37 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "execute", "packer-post-processor-compress"}
2024/10/28 15:49:37 Waiting for RPC address for: /usr/bin/packer
2024/10/28 15:49:37 packer-post-processor-compress plugin: [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/10/28 15:49:37 packer-post-processor-compress plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/10/28 15:49:37 packer-post-processor-compress plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/10/28 15:49:37 packer-post-processor-compress plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2024/10/28 15:49:37 packer-post-processor-compress plugin: [INFO] Setting cache directory: /root/.cache/packer
2024/10/28 15:49:37 packer-post-processor-compress plugin: args: []string{"packer-post-processor-compress"}
2024/10/28 15:49:37 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin1639003625
2024/10/28 15:49:37 packer-post-processor-compress plugin: Plugin address: unix /tmp/packer-plugin1639003625
2024/10/28 15:49:37 packer-post-processor-compress plugin: Waiting for connection...
2024/10/28 15:49:37 packer-post-processor-compress plugin: Serving a plugin connection...
a checksum is highly recommended.
on windows.pkr.hcl line 33:
(source code not available)
2024/10/28 15:49:37 Build debug mode: false
2024/10/28 15:49:37 Force build: false
2024/10/28 15:49:37 On error:
Warning: A checksum of 'none' was specified. Since ISO files are so big,
2024/10/28 15:49:37 Waiting on builds to complete...
2024/10/28 15:49:37 Starting build run: qemu.windows_builder
2024/10/28 15:49:37 Running builder: qemu
2024/10/28 15:49:37 [INFO] (telemetry) Starting builder qemu.windows_builder
a checksum is highly recommended.
on windows.pkr.hcl line 33:
(source code not available)
qemu.windows_builder: output will be in this color.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu path: /usr/local/bin/qemu-system-x86_64, Qemu Image path: /usr/local/bin/qemu-img
==> qemu.windows_builder: Retrieving ISO
==> qemu.windows_builder: Trying /home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Acquiring lock for: /home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso (/root/.cache/packer/84ed5b25e3023beebbaf63bf14ff2ed108102fa9.iso.lock)
==> qemu.windows_builder: Trying /home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Leaving retrieve loop for ISO
==> qemu.windows_builder: /home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso => /home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Floppy label is set to flop
==> qemu.windows_builder: Creating floppy disk...
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Floppy path: /tmp/packer65686085
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Initializing block device backed by temporary file
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Formatting the block device with a FAT filesystem...
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Initializing FAT filesystem on block device
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Reading the root directory from the filesystem
qemu.windows_builder: Copying files flatly from floppy_files
qemu.windows_builder: Copying file: ./http/Autounattend.xml
qemu.windows_builder: Copying file: ./http/logon.ps1
qemu.windows_builder: Copying file: ./http/rh.cer
qemu.windows_builder: Done copying files from floppy_files
qemu.windows_builder: Collecting paths from floppy_dirs
qemu.windows_builder: Resulting paths from floppy_dirs : []
qemu.windows_builder: Done copying paths from floppy_dirs
qemu.windows_builder: Copying files from floppy_content
qemu.windows_builder: Done copying files from floppy_content
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 No CD files specified. CD disk will not be made.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 [INFO] Creating disk with Path: output-windows_builder/packer-windows_builder and Size: 20G
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Executing qemu-img: []string{"create", "-f", "raw", "output-windows_builder/packer-windows_builder", "20G"}
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 stdout: Formatting 'output-windows_builder/packer-windows_builder', fmt=raw size=21474836480
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 stderr:
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Found available port: 8750 on IP: 0.0.0.0
==> qemu.windows_builder: Starting HTTP server on port 8750
qemu.windows_builder: No communicator is set; skipping port forwarding setup.
==> qemu.windows_builder: Looking for available port between 5900 and 6000 on 0.0.0.0
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Looking for available port between 5900 and 6000 on 0.0.0.0
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Found available port: 5955 on IP: 0.0.0.0
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Found available VNC port: 5955 on IP: 0.0.0.0
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu --version output: QEMU emulator version 9.1.1
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu version: 9.1.1
==> qemu.windows_builder: Starting VM, booting from CD-ROM
==> qemu.windows_builder: Overriding default Qemu arguments with qemuargs template option...
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Executing /usr/local/bin/qemu-system-x86_64: []string{"-machine", "type=q35,accel=kvm", "-cpu", "host", "-name", "packer-windows_builder", "-fda", "/tmp/packer65686085", "-drive", "if=pflash,format=raw,id=ovmf_code,readonly=on,file=/usr/share/OVMF/OVMF_CODE_4M.fd", "-drive", "if=pflash,format=raw,id=ovmf_vars,file=OVMF_VARS.fd", "-drive", "file=output-windows_builder/packer-windows_builder,format=raw", "-drive", "file=drivers.iso,media=cdrom,index=3", "-cdrom", "/home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso", "-smp", "2", "-display", "gtk", "-device", "e1000,netdev=user.0", "-serial", "stdio", "-boot", "d", "-netdev", "user,id=user.0", "-vnc", "0.0.0.0:55", "-m", "4096M"}
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Started Qemu. Pid: 2153
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu stderr: WARNING: Image format was not specified for '/tmp/packer65686085' and probing guessed raw.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu stderr: Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu stderr: Specify the 'raw' format explicitly to remove the restrictions.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu stderr: gtk initialization failed
==> qemu.windows_builder: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 failed to unlock port lockfile: close tcp [::]:5955: use of closed network connection
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Deleting floppy disk: /tmp/packer65686085
==> qemu.windows_builder: Deleting output directory...
2024/10/28 15:49:37 [INFO] (telemetry) ending qemu.windows_builder
==> Wait completed after 136 milliseconds 120 microseconds
2024/10/28 15:49:37 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2024/10/28 15:49:37 machine readable: qemu.windows_builder,error []string{"Build was halted."}
==> Builds finished but no artifacts were created.
Build 'qemu.windows_builder' errored after 136 milliseconds 102 microseconds: Build was halted.
2024/10/28 15:49:37 [INFO] (telemetry) Finalizing.
==> Wait completed after 136 milliseconds 120 microseconds
==> Some builds didn't complete successfully and had errors:
--> qemu.windows_builder: Build was halted.
==> Builds finished but no artifacts were created.
2024/10/28 15:49:38 waiting for all plugin processes to complete...
2024/10/28 15:49:38 /usr/bin/packer: plugin process exited
2024/10/28 15:49:38 /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: plugin process exited
2024/10/28 15:49:38 /usr/bin/packer: plugin process exited
make: *** [Makefile:58: windows] Error 1
rm http/Autounattend.xml

@alanbach
Copy link
Contributor

Hello @mikoday Try adding the following under the qemuargs in the hcl file to to see if the error goes away?

["-display", "none"]

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 13, 2024
@tdtmusic2
Copy link

Same issue here, I would add that line in the hcl file to see if it fixes it but there is no qemuargs section, or at least I don't know where to find it...

@github-actions github-actions bot removed the stale label Dec 23, 2024
@ITBalancer
Copy link

Hello,
@alanbach I have tried with adding "-display", "none" into qemuargs, but still not work.

qemuargs = concat(local.baseargs, (var.use_tpm == "yes" ? local.tpmargs : ["-display", "none"]))

rm -f -rf output-* windows.dd.gz http/Autounattend.xml \
drivers.iso windows_builder.img OVMF_VARS.fd
cp -v /usr/share/OVMF/OVMF_VARS.ms.fd OVMF_VARS.fd
'/usr/share/OVMF/OVMF_VARS.ms.fd' -> 'OVMF_VARS.fd'
mkisofs -o drivers.iso -V 'Extra Drivers' -input-charset utf-8 drivers
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 2198
Path table size(bytes): 22
Max brk space used 0
176 extents written (0 MB)
sed s#@VERSION@#"Windows 11 PRO"#g http/Autounattend.xml.ISO.template > http/Autounattend.xml
sed -i 's/<!--<LocalAccounts>/<LocalAccounts>/;s/<\/LocalAccounts>-->/<\/LocalAccounts>/' http/Autounattend.xml
mkdir -p /tmp/swtpm; \
swtpm socket --daemon --tpm2 --tpmstate dir=/tmp/swtpm --ctrl type=unixio,path=/tmp/swtpm/swtpm-sock --log level=10
packer init . && packer build -var iso_path=/home/milutin/packer/windows-11/Win11_24H2_English_x64.iso \
                -var headless=false \
                -var ovmf_suffix= \
                -var is_vhdx=false \
                -var timeout=1h \
                -var use_tpm=yes \
                windows.pkr.hcl
2024/12/23 14:14:17 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/12/23 14:14:17 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/12/23 14:14:17 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/12/23 14:14:17 [WARN] Config file doesn't exist: /root/.packerconfig
2024/12/23 14:14:17 [INFO] Setting cache directory: /root/.cache/packer
2024/12/23 14:14:17 [TRACE] init: plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc00004a080)}}, ReleasesOnly:true}}
2024/12/23 14:14:17 [TRACE] listing potential installations for "github.com/hashicorp/qemu" that match "~> 1.0". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc00004a080)}}, ReleasesOnly:true}}
2024/12/23 14:14:18 [INFO] (telemetry) Finalizing.
2024/12/23 14:14:18 waiting for all plugin processes to complete...
2024/12/23 14:14:18 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/12/23 14:14:18 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/12/23 14:14:18 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/12/23 14:14:18 [WARN] Config file doesn't exist: /root/.packerconfig
2024/12/23 14:14:18 [INFO] Setting cache directory: /root/.cache/packer
2024/12/23 14:14:18 [TRACE] listing potential installations for "github.com/hashicorp/qemu" that match "~> 1.0". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0000e1080)}}, ReleasesOnly:false}}
2024/12/23 14:14:19 [TRACE] Found the following "github.com/hashicorp/qemu" installations: [{/root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 v1.1.0 x5.0}]
2024/12/23 14:14:19 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/12/23 14:14:19 [TRACE] listing potential installations for <nil> that match "". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0000e0280)}}, ReleasesOnly:false}}
2024/12/23 14:14:19 [INFO] found external [-packer-default-plugin-name- clone iso] builders from proxmox plugin
2024/12/23 14:14:19 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/12/23 14:14:19 [TRACE] validateValue: not active for filename, so skipping
2024/12/23 14:14:19 [TRACE] validateValue: not active for is_vhdx, so skipping
2024/12/23 14:14:19 [TRACE] validateValue: not active for use_tpm, so skipping
2024/12/23 14:14:19 [TRACE] validateValue: not active for timeout, so skipping
2024/12/23 14:14:19 [TRACE] validateValue: not active for headless, so skipping
2024/12/23 14:14:19 [TRACE] validateValue: not active for disk_size, so skipping
2024/12/23 14:14:19 [TRACE] validateValue: not active for iso_path, so skipping
2024/12/23 14:14:19 [TRACE] validateValue: not active for ovmf_suffix, so skipping
2024/12/23 14:14:19 [INFO] Starting external plugin /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 start builder -packer-default-plugin-name-
2024/12/23 14:14:19 Starting plugin: /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 []string{"/root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64", "start", "builder", "-packer-default-plugin-name-"}
2024/12/23 14:14:19 Waiting for RPC address for: /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64
2024/12/23 14:14:19 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 14:14:19 Plugin address: unix /tmp/packer-plugin698855976
2024/12/23 14:14:19 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 14:14:19 Waiting for connection...
2024/12/23 14:14:19 Received unix RPC address for /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: addr is /tmp/packer-plugin698855976
2024/12/23 14:14:19 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 14:14:19 Serving a plugin connection...
2024/12/23 14:14:19 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 14:14:19 [TRACE] starting builder -packer-default-plugin-name-
Error: Inconsistent conditional result types

  on windows.pkr.hcl line 92:
  (source code not available)

with local.tpmargs as tuple with 3 elements,
     var.use_tpm as "yes".

The true and false result expressions must have consistent types. The 'true'
tuple has length 3, but the 'false' tuple has length 2.



  on windows.pkr.hcl line 92:
  (source code not available)

with local.tpmargs as tuple with 3 elements,
     var.use_tpm as "yes".

The true and false result expressions must have consistent types. The 'true'
tuple has length 3, but the 'false' tuple has length 2.

2024/12/23 14:14:19 [INFO] (telemetry) Finalizing.
2024/12/23 14:14:20 waiting for all plugin processes to complete...
2024/12/23 14:14:20 /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: plugin process exited
make: *** [Makefile:70: windows] Error 1
rm http/Autounattend.xml

@ITBalancer
Copy link

Ah, this needs to be added into baseargs... I added I now seems that is working. Thank you!

@alanbach
Copy link
Contributor

Hello @ITBalancer @tdtmusic2 If you have a recent version of the windows template, I suppose the easiest way would be to send HEADLESS=true parameter when starting the build a long side ISO etc

@ITBalancer
Copy link

Yes, work as well @alanbach , but I didn't get to work at the end.
I tried with Jammy and Noble, on proxmox VM or full BMS server, multiple ISOs, but always ending here...
I found another posts where folks asking about this, but didn't find any good reply.

milutin@bmc-ubuntu01:~/packer/packer-maas/windows$ sudo make ISO=/home/milutin/packer/WindowsServer-2022.iso VERSION=2022 PACKER_LOG=1 HEADLESS=true
[sudo] password for milutin: 
rm -f -rf output-* windows.dd.gz http/Autounattend.xml \
drivers.iso windows_builder.img OVMF_VARS.fd
cp -v /usr/share/OVMF/OVMF_VARS_4M.ms.fd OVMF_VARS.fd
'/usr/share/OVMF/OVMF_VARS_4M.ms.fd' -> 'OVMF_VARS.fd'
mkisofs -o drivers.iso -V 'Extra Drivers' -input-charset utf-8 drivers
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 2198
Path table size(bytes): 22
Max brk space used 0
176 extents written (0 MB)
sed s#@VERSION@#"Windows Server 2022 SERVERSTANDARD"#g http/Autounattend.xml.ISO.template > http/Autounattend.xml
packer init . && packer build -var iso_path=/home/milutin/packer/WindowsServer-2022.iso \
                -var headless=true \
                -var ovmf_suffix=_4M \
                -var is_vhdx=false \
                -var timeout=1h \
                -var use_tpm= \
                windows.pkr.hcl
2024/12/23 20:58:29 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/12/23 20:58:29 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/12/23 20:58:29 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/12/23 20:58:29 [WARN] Config file doesn't exist: /root/.packerconfig
2024/12/23 20:58:29 [INFO] Setting cache directory: /root/.cache/packer
2024/12/23 20:58:29 [TRACE] init: plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0000f3180)}}, ReleasesOnly:true}}
2024/12/23 20:58:29 [TRACE] listing potential installations for "github.com/hashicorp/qemu" that match "~> 1.0". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0000f3180)}}, ReleasesOnly:true}}
2024/12/23 20:58:29 [INFO] (telemetry) Finalizing.
2024/12/23 20:58:29 waiting for all plugin processes to complete...
2024/12/23 20:58:30 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/12/23 20:58:30 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/12/23 20:58:30 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/12/23 20:58:30 [WARN] Config file doesn't exist: /root/.packerconfig
2024/12/23 20:58:30 [INFO] Setting cache directory: /root/.cache/packer
2024/12/23 20:58:30 [TRACE] listing potential installations for "github.com/hashicorp/qemu" that match "~> 1.0". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000890000)}}, ReleasesOnly:false}}
2024/12/23 20:58:30 [TRACE] Found the following "github.com/hashicorp/qemu" installations: [{/root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 v1.1.0 x5.0}]
2024/12/23 20:58:30 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/12/23 20:58:30 [TRACE] listing potential installations for <nil> that match "". plugingetter.ListInstallationsOptions{PluginDirectory:"/root/.config/packer/plugins", BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc0000f4700)}}, ReleasesOnly:false}}
2024/12/23 20:58:30 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/12/23 20:58:30 [TRACE] validateValue: not active for is_vhdx, so skipping
2024/12/23 20:58:30 [TRACE] validateValue: not active for use_tpm, so skipping
2024/12/23 20:58:30 [TRACE] validateValue: not active for timeout, so skipping
2024/12/23 20:58:30 [TRACE] validateValue: not active for headless, so skipping
2024/12/23 20:58:30 [TRACE] validateValue: not active for disk_size, so skipping
2024/12/23 20:58:30 [TRACE] validateValue: not active for iso_path, so skipping
2024/12/23 20:58:30 [TRACE] validateValue: not active for ovmf_suffix, so skipping
2024/12/23 20:58:30 [TRACE] validateValue: not active for filename, so skipping
2024/12/23 20:58:30 [INFO] Starting external plugin /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 start builder -packer-default-plugin-name-
2024/12/23 20:58:30 Starting plugin: /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 []string{"/root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64", "start", "builder", "-packer-default-plugin-name-"}
2024/12/23 20:58:30 Waiting for RPC address for: /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64
2024/12/23 20:58:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:30 Plugin address: unix /tmp/packer-plugin4083493851
2024/12/23 20:58:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:30 Waiting for connection...
2024/12/23 20:58:30 Received unix RPC address for /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: addr is /tmp/packer-plugin4083493851
2024/12/23 20:58:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:30 Serving a plugin connection...
2024/12/23 20:58:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:30 [TRACE] starting builder -packer-default-plugin-name-
2024/12/23 20:58:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:30 use specified accelerator: kvm
2024/12/23 20:58:30 [INFO] Starting internal plugin packer-post-processor-shell-local
2024/12/23 20:58:30 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "execute", "packer-post-processor-shell-local"}
2024/12/23 20:58:30 Waiting for RPC address for: /usr/bin/packer
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: [INFO] Setting cache directory: /root/.cache/packer
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: args: []string{"packer-post-processor-shell-local"}
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: Plugin address: unix /tmp/packer-plugin2801085969
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: Waiting for connection...
2024/12/23 20:58:30 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin2801085969
2024/12/23 20:58:30 packer-post-processor-shell-local plugin: Serving a plugin connection...
2024/12/23 20:58:30 [INFO] Starting internal plugin packer-post-processor-compress
2024/12/23 20:58:30 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "execute", "packer-post-processor-compress"}
2024/12/23 20:58:30 Waiting for RPC address for: /usr/bin/packer
2024/12/23 20:58:30 packer-post-processor-compress plugin: [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/12/23 20:58:30 packer-post-processor-compress plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/12/23 20:58:30 packer-post-processor-compress plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/12/23 20:58:30 packer-post-processor-compress plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2024/12/23 20:58:30 packer-post-processor-compress plugin: [INFO] Setting cache directory: /root/.cache/packer
2024/12/23 20:58:30 packer-post-processor-compress plugin: args: []string{"packer-post-processor-compress"}
2024/12/23 20:58:30 packer-post-processor-compress plugin: Plugin address: unix /tmp/packer-plugin3836269525
2024/12/23 20:58:30 packer-post-processor-compress plugin: Waiting for connection...
2024/12/23 20:58:30 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin3836269525
2024/12/23 20:58:30 packer-post-processor-compress plugin: Serving a plugin connection...
a checksum is highly recommended.

  on windows.pkr.hcl line 73:
  (source code not available)

2024/12/23 20:58:30 Build debug mode: false
2024/12/23 20:58:30 Force build: false
2024/12/23 20:58:30 On error: 
2024/12/23 20:58:30 Waiting on builds to complete...
Warning: A checksum of 'none' was specified. Since ISO files are so big,
2024/12/23 20:58:30 Starting build run: qemu.windows_builder
2024/12/23 20:58:30 Running builder: qemu
2024/12/23 20:58:30 [INFO] (telemetry) Starting builder qemu.windows_builder
a checksum is highly recommended.

  on windows.pkr.hcl line 73:
  (source code not available)


qemu.windows_builder: output will be in this color.

2024/12/23 20:58:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:30 Qemu path: /usr/bin/qemu-system-x86_64, Qemu Image path: /usr/bin/qemu-img
==> qemu.windows_builder: Retrieving ISO
==> qemu.windows_builder: Trying /home/milutin/packer/WindowsServer-2022.iso
2024/12/23 20:58:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:30 Acquiring lock for: /home/milutin/packer/WindowsServer-2022.iso (/root/.cache/packer/fe681bbb4e1fad432e5e8a18a7385281a229af65.iso.lock)
==> qemu.windows_builder: Trying /home/milutin/packer/WindowsServer-2022.iso
BdsDxe: loading Boot0001 "UEFI QEMU DVD-ROM QM00005 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0)
2024/12/23 20:58:31 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:31 Qemu stdout: BdsDxe: starting Boot0001 "UEFI QEMU DVD-ROM QM00005 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0)
==> qemu.windows_builder: Waiting 2s for boot...
==> qemu.windows_builder: Connecting to VM via VNC (0.0.0.0:5921)
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 Connected to VNC desktop: QEMU (packer-windows_builder)
==> qemu.windows_builder: Typing the boot commands over VNC...
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 Special code '<return>' found, replacing with: 0xFF0D
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 Qemu stdout: BdsDxe: failed to start Boot0001 "UEFI QEMU DVD-ROM QM00005 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0): Time out
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 Qemu stdout: BdsDxe: failed to load Boot0002 "UEFI QEMU DVD-ROM QM00007 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x3,0xFFFF,0x0): Not Found
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 Qemu stdout: BdsDxe: failed to load Boot0003 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0): Not Found
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 Qemu stdout:
    qemu.windows_builder: No communicator is configured -- skipping StepWaitGuestAddress
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 [INFO] communicator disabled, will not connect
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 Unable to load communicator config from state to populate provisionHookData
2024/12/23 20:58:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:58:34 Running the provision hook
==> qemu.windows_builder: Waiting for shutdown...
2024/12/23 20:59:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:59:34 Qemu stdout: >>Start PXE over IPv4.
2024/12/23 20:59:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:59:34 Qemu stdout:   PXE-E16: No valid offer received.
2024/12/23 20:59:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:59:34 Qemu stdout: BdsDxe: failed to load Boot0004 "UEFI PXEv4 (MAC:525400123456)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(525400123456,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0): Not Found
2024/12/23 20:59:34 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 20:59:34 Qemu stdout:
2024/12/23 21:00:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:00:37 Qemu stdout: >>Start PXE over IPv6.
2024/12/23 21:00:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:00:37 Qemu stdout:   PXE-E16: No valid offer received.
2024/12/23 21:00:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:00:37 Qemu stdout: BdsDxe: failed to load Boot0005 "UEFI PXEv6 (MAC:525400123456)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(525400123456,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000): Not Found
2024/12/23 21:00:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:00:37 Qemu stdout:
2024/12/23 21:01:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:01:37 Qemu stdout: >>Start HTTP Boot over IPv4.....
2024/12/23 21:01:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:01:37 Qemu stdout:   Error: Could not retrieve NBP file size from HTTP server.
2024/12/23 21:01:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:01:37 Qemu stdout:
2024/12/23 21:01:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:01:37 Qemu stdout:   Error: Server response timeout.
2024/12/23 21:01:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:01:37 Qemu stdout: BdsDxe: failed to load Boot0006 "UEFI HTTPv4 (MAC:525400123456)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(525400123456,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)/Uri(): Not Found
2024/12/23 21:01:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:01:37 Qemu stdout:
2024/12/23 21:02:40 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:40 Qemu stdout: >>Start HTTP Boot over IPv6.
2024/12/23 21:02:40 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:40 Qemu stdout:   Error: Could not retrieve NBP file size from HTTP server.
2024/12/23 21:02:40 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:40 Qemu stdout:
2024/12/23 21:02:40 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:40 Qemu stdout:   Error: Unexpected network error.
2024/12/23 21:02:40 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:40 Qemu stdout: BdsDxe: failed to load Boot0007 "UEFI HTTPv6 (MAC:525400123456)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(525400123456,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000)/Uri(): Not Found
2024/12/23 21:02:43 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:43 Qemu stdout: BdsDxe: No bootable option or device was found.
2024/12/23 21:02:43 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:43 Qemu stdout: BdsDxe: Press any key to enter the Boot Manager Menu.
2024/12/23 21:02:55 Cancelling builder after context cancellation context canceled
Cancelling build after receiving interrupt
2024/12/23 21:02:55 packer-post-processor-compress plugin: Received interrupt signal (count: 1). Ignoring.
2024/12/23 21:02:55 packer-post-processor-shell-local plugin: Received interrupt signal (count: 1). Ignoring.
2024/12/23 21:02:55 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:55 Received interrupt signal (count: 1). Ignoring.
2024/12/23 21:02:55 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:55 Qemu stderr: qemu-system-x86_64: terminating on signal 2
2024/12/23 21:02:55 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:55 VM shut down.
2024/12/23 21:02:55 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:55 failed to unlock port lockfile: close tcp [::]:5921: use of closed network connection
2024/12/23 21:02:55 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 21:02:55 Deleting floppy disk: /tmp/packer2104224235
==> qemu.windows_builder: Deleting output directory...
2024/12/23 21:02:55 [INFO] (telemetry) ending qemu.windows_builder
==> Wait completed after 4 minutes 25 seconds
2024/12/23 21:02:55 [INFO] (telemetry) Finalizing.
Build 'qemu.windows_builder' errored after 4 minutes 25 seconds: Build was cancelled.

==> Wait completed after 4 minutes 25 seconds
Cleanly cancelled builds after being interrupted.
2024/12/23 21:02:56 waiting for all plugin processes to complete...
2024/12/23 21:02:56 /usr/bin/packer: plugin process exited
2024/12/23 21:02:56 /usr/bin/packer: plugin process exited
2024/12/23 21:02:56 /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: plugin process exited
make: *** [Makefile:94: windows] Interrupt
make: *** Deleting intermediate file 'http/Autounattend.xml'

@alanbach
Copy link
Contributor

@ITBalancer I see! Depending on how fast or slow the build environment is, you may need to adjust the boot time here: https://github.com/canonical/packer-maas/blob/main/windows/windows.pkr.hcl#L76

Windows ISO images have this press any key message with a timeout which sometime cause the initial boot to fail if that timer is not set right.

I suggest starting with setting that to 5s and go from there. Connect via VNC to watch the console to see where it is breaking or getting stuck.

@ITBalancer
Copy link

Great sir! Gotcha! I realized boot time line, but wasn't think that can help.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants