Closed erickellerek1 closed 2 months ago
This issue is stale because it has been open for 30 days with no activity.
Hey @erickellerek1 Would you please see if adding the following parameter to the qemu arguments section of the HCL file resolves the issue?
["-cpu", "host"],
The addition of above flag didn't help as I'm facing same issue:
make windows ISO=/root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso VERSION=2019 HEADLESS=true
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 Server 2019 SERVERSTANDARD"#g http/Autounattend.xml.uefi.template > http/Autounattend.xml
packer init . && packer build -var iso_path=/root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso \
-var headless=true \
-var ovmf_suffix= \
windows.pkr.hcl
2024/09/10 11:41:29 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/09/10 11:41:29 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/09/10 11:41:29 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/09/10 11:41:29 [WARN] Config file doesn't exist: /root/.packerconfig
2024/09/10 11:41:29 [INFO] Setting cache directory: /root/.cache/packer
2024/09/10 11:41: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)(0xc0004c3200)}}, ReleasesOnly:true}}
2024/09/10 11:41: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)(0xc0004c3200)}}, ReleasesOnly:true}}
2024/09/10 11:41:29 [INFO] (telemetry) Finalizing.
2024/09/10 11:41:30 waiting for all plugin processes to complete...
2024/09/10 11:41:30 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/09/10 11:41:30 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/09/10 11:41:30 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/09/10 11:41:30 [WARN] Config file doesn't exist: /root/.packerconfig
2024/09/10 11:41:30 [INFO] Setting cache directory: /root/.cache/packer
2024/09/10 11:41: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)(0xc00014f200)}}, ReleasesOnly:false}}
2024/09/10 11:41: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/09/10 11:41:30 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/09/10 11:41:30 [TRACE] listing potential installations for
on windows.pkr.hcl line 33: (source code not available)
2024/09/10 11:41:30 Build debug mode: false 2024/09/10 11:41:30 Force build: false 2024/09/10 11:41:30 On error: Warning: A checksum of 'none' was specified. Since ISO files are so big, 2024/09/10 11:41:30 Waiting on builds to complete... 2024/09/10 11:41:30 Starting build run: qemu.windows_builder 2024/09/10 11:41:30 Running builder: qemu 2024/09/10 11:41:30 [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/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Qemu path: /usr/bin/qemu-system-x86_64, Qemu Image path: /usr/bin/qemu-img
==> qemu.windows_builder: Retrieving ISO
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Acquiring lock for: /root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso (/root/.cache/packer/d09b17e2871977097a6c2ad8a0fc25fd1fe0ef02.iso.lock)
==> qemu.windows_builder: Trying /root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
==> qemu.windows_builder: Trying /root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Leaving retrieve loop for ISO
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Floppy label is set to flop
==> qemu.windows_builder: /root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso => /root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
==> qemu.windows_builder: Creating floppy disk...
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Floppy path: /tmp/packer3967695040
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Initializing block device backed by temporary file
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Formatting the block device with a FAT filesystem...
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Initializing FAT filesystem on block device
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 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/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 No CD files specified. CD disk will not be made.
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 [INFO] Creating disk with Path: output-windows_builder/packer-windows_builder and Size: 20G
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Executing qemu-img: []string{"create", "-f", "raw", "output-windows_builder/packer-windows_builder", "20G"}
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 stdout: Formatting 'output-windows_builder/packer-windows_builder', fmt=raw size=21474836480
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 stderr:
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Found available port: 8083 on IP: 0.0.0.0
==> qemu.windows_builder: Starting HTTP server on port 8083
qemu.windows_builder: No communicator is set; skipping port forwarding setup.
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Looking for available port between 5900 and 6000 on 0.0.0.0
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Retryable error: port 5909 cannot be opened: listen tcp 0.0.0.0:5909: bind: address already in use
==> qemu.windows_builder: Looking for available port between 5900 and 6000 on 0.0.0.0
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Found available port: 5970 on IP: 0.0.0.0
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Found available VNC port: 5970 on IP: 0.0.0.0
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Qemu --version output: QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.22)
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Qemu version: 6.2.0
==> qemu.windows_builder: Starting VM, booting from CD-ROM
qemu.windows_builder: view the screen of the VM, connect via VNC without a password to
qemu.windows_builder: vnc://0.0.0.0:5970
qemu.windows_builder: The VM will be run headless, without a GUI. If you want to
qemu.windows_builder: view the screen of the VM, connect via VNC without a password to
qemu.windows_builder: vnc://0.0.0.0:5970
==> qemu.windows_builder: Overriding default Qemu arguments with qemuargs template option...
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Executing /usr/bin/qemu-system-x86_64: []string{"-device", "e1000,netdev=user.0", "-netdev", "user,id=user.0", "-smp", "2", "-drive", "if=pflash,format=raw,id=ovmf_code,readonly=on,file=/usr/share/OVMF/OVMF_CODE.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", "-machine", "type=q35,accel=kvm", "-name", "packer-windows_builder", "-serial", "stdio", "-fda", "/tmp/packer3967695040", "-cpu", "host", "-boot", "d", "-vnc", "0.0.0.0:70", "-m", "4096M", "-cdrom", "/root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso"}
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Started Qemu. Pid: 970950
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Qemu stderr: WARNING: Image format was not specified for '/tmp/packer3967695040' and probing guessed raw.
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Qemu stderr: Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
2024/09/10 11:41:30 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:30 Qemu stderr: Specify the 'raw' format explicitly to remove the restrictions.
==> qemu.windows_builder: Waiting 1s for boot...
==> qemu.windows_builder: Connecting to VM via VNC (0.0.0.0:5970)
2024/09/10 11:41:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:33 Connected to VNC desktop: QEMU (packer-windows_builder)
==> qemu.windows_builder: Typing the boot commands over VNC...
2024/09/10 11:41:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/10 11:41:33 Special code '
I can confirm that I still have the same issue:
==> qemu.windows_builder: Waiting for shutdown...
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: !!!! X64 Exception Type - 0D(#GP - General Protection) CPU Apic ID - 00000000 !!!!
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: ExceptionData - 0000000000000000
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: RIP - 000000007FA6CBC6, CS - 0000000000000038, RFLAGS - 0000000000010002
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: RAX - 49C7C83113FA7698, RCX - 0000000000000000, RDX - 000000007F92E018
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: RBX - 0000000000000020, RSP - 000000007FF00990, RBP - 00000000746E7684
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: RSI - 00000000746E7668, RDI - 000000007F92E018
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: R8 - 8000000000000001, R9 - 000000007FF00AC0, R10 - 0000000000000000
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: R11 - 0000000000001000, R12 - 00000000746E7665, R13 - 00000000FFE00000
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: R14 - 0000000000000000, R15 - 000000007F436818
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: DS - 0000000000000030, ES - 0000000000000030, FS - 0000000000000030
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: GS - 0000000000000030, SS - 0000000000000030
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: CR0 - 0000000080010033, CR2 - 0000000000000000, CR3 - 000000007FC01000
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: CR4 - 0000000000000668, CR8 - 0000000000000000
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: DR0 - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: DR3 - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: GDTR - 000000007F9DE000 0000000000000047, LDTR - 0000000000000000
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: IDTR - 000000007F470018 0000000000000FFF, TR - 0000000000000000
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: FXSAVE_STATE - 000000007FF005F0
2024/09/24 21:59:51 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 21:59:51 Qemu stdout: !!!! Find image based on IP(0x7FA6CBC6) (No PDB) (ImageBase=000000007FA67000, EntryPoint=000000007FAA7503) !!!!
even having the "-cpu", "host"
fix... 2cad5680cf7116097c605d92b36f116d625b1bdd could we re-open this issue?
Hi there, I wanted to give a try to the windows image generation with the packer script.
This unfortunatelly resulted in:
I am using ubuntu LTS 22.04 and packer: v1.11.1
Any idea what coudl help to unlock the situation here?