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

Unable to build Windows Image due to error : Qemu stdout: !!!! X64 Exception Type - 0D(#GP - General Protection) CPU Apic ID - 00000000 !!!! #267

Open
nics90 opened this issue Sep 11, 2024 · 15 comments
Labels

Comments

@nics90
Copy link

nics90 commented Sep 11, 2024

Hi, I'm trying to create a Windows Server 2019 image but I'm getting the below error:

root@machine01:~/latest-packer-maas/packer-maas/windows# 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/11 06:12:38 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/09/11 06:12:38 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/09/11 06:12:38 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/09/11 06:12:38 [WARN] Config file doesn't exist: /root/.packerconfig
2024/09/11 06:12:38 [INFO] Setting cache directory: /root/.cache/packer
2024/09/11 06:12:38 [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)(0xc000137200)}}, ReleasesOnly:true}}
2024/09/11 06:12:38 [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)(0xc000137200)}}, ReleasesOnly:true}}
2024/09/11 06:12:38 [INFO] (telemetry) Finalizing.
2024/09/11 06:12:39 waiting for all plugin processes to complete...
2024/09/11 06:12:39 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/09/11 06:12:39 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/09/11 06:12:39 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/09/11 06:12:39 [WARN] Config file doesn't exist: /root/.packerconfig
2024/09/11 06:12:39 [INFO] Setting cache directory: /root/.cache/packer
2024/09/11 06:12:39 [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)(0xc0006a6000)}}, ReleasesOnly:false}}
2024/09/11 06:12:39 [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/11 06:12:39 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/09/11 06:12:39 [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)(0xc0006a6080)}}, ReleasesOnly:false}}
2024/09/11 06:12:39 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/09/11 06:12:39 [TRACE] validateValue: not active for iso_path, so skipping
2024/09/11 06:12:39 [TRACE] validateValue: not active for ovmf_suffix, so skipping
2024/09/11 06:12:39 [TRACE] validateValue: not active for filename, so skipping
2024/09/11 06:12:39 [TRACE] validateValue: not active for headless, so skipping
2024/09/11 06:12:39 [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/09/11 06:12:39 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/09/11 06:12:39 Waiting for RPC address for: /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Plugin address: unix /tmp/packer-plugin2536017594
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Waiting for connection...
2024/09/11 06:12:39 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-plugin2536017594
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Serving a plugin connection...
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 [TRACE] starting builder -packer-default-plugin-name-
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 use specified accelerator: kvm
2024/09/11 06:12:39 [INFO] Starting internal plugin packer-post-processor-shell-local
2024/09/11 06:12:39 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "execute", "packer-post-processor-shell-local"}
2024/09/11 06:12:39 Waiting for RPC address for: /usr/bin/packer
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: [INFO] Setting cache directory: /root/.cache/packer
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: args: []string{"packer-post-processor-shell-local"}
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: Plugin address: unix /tmp/packer-plugin1196141136
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: Waiting for connection...
2024/09/11 06:12:39 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin1196141136
2024/09/11 06:12:39 packer-post-processor-shell-local plugin: Serving a plugin connection...
2024/09/11 06:12:39 [INFO] Starting internal plugin packer-post-processor-compress
2024/09/11 06:12:39 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "execute", "packer-post-processor-compress"}
2024/09/11 06:12:39 Waiting for RPC address for: /usr/bin/packer
2024/09/11 06:12:39 packer-post-processor-compress plugin: [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/09/11 06:12:39 packer-post-processor-compress plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/09/11 06:12:39 packer-post-processor-compress plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2024/09/11 06:12:39 packer-post-processor-compress plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2024/09/11 06:12:39 packer-post-processor-compress plugin: [INFO] Setting cache directory: /root/.cache/packer
2024/09/11 06:12:39 packer-post-processor-compress plugin: args: []string{"packer-post-processor-compress"}
2024/09/11 06:12:39 packer-post-processor-compress plugin: Plugin address: unix /tmp/packer-plugin2660479874
2024/09/11 06:12:39 packer-post-processor-compress plugin: Waiting for connection...
2024/09/11 06:12:39 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin2660479874
2024/09/11 06:12:39 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/09/11 06:12:39 Build debug mode: false
2024/09/11 06:12:39 Force build: false
2024/09/11 06:12:39 On error:
2024/09/11 06:12:39 Waiting on builds to complete...
2024/09/11 06:12:39 Starting build run: qemu.windows_builder
2024/09/11 06:12:39 Running builder: qemu
2024/09/11 06:12:39 [INFO] (telemetry) Starting builder qemu.windows_builder
Warning: A checksum of 'none' was specified. Since ISO files are so big,
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/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Qemu path: /usr/bin/qemu-system-x86_64, Qemu Image path: /usr/bin/qemu-img
==> qemu.windows_builder: Retrieving ISO
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 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/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Leaving retrieve loop for ISO
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 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/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Floppy path: /tmp/packer1366264689
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Initializing block device backed by temporary file
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Formatting the block device with a FAT filesystem...
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Initializing FAT filesystem on block device
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 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/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 No CD files specified. CD disk will not be made.
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 [INFO] Creating disk with Path: output-windows_builder/packer-windows_builder and Size: 20G
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Executing qemu-img: []string{"create", "-f", "raw", "output-windows_builder/packer-windows_builder", "20G"}
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 stdout: Formatting 'output-windows_builder/packer-windows_builder', fmt=raw size=21474836480
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 stderr:
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Found available port: 8877 on IP: 0.0.0.0
==> qemu.windows_builder: Starting HTTP server on port 8877
    qemu.windows_builder: No communicator is set; skipping port forwarding setup.
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Looking for available port between 5900 and 6000 on 0.0.0.0
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Found available port: 5988 on IP: 0.0.0.0
==> qemu.windows_builder: Looking for available port between 5900 and 6000 on 0.0.0.0
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Found available VNC port: 5988 on IP: 0.0.0.0
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Qemu --version output: QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.22)
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 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:5988
    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:5988
==> qemu.windows_builder: Overriding default Qemu arguments with qemuargs template option...
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Executing /usr/bin/qemu-system-x86_64: []string{"-device", "e1000,netdev=user.0", "-m", "4096M", "-cpu", "host", "-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", "-boot", "d", "-smp", "2", "-vnc", "0.0.0.0:88", "-machine", "type=q35,accel=kvm", "-serial", "stdio", "-cdrom", "/root/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso", "-name", "packer-windows_builder", "-netdev", "user,id=user.0", "-fda", "/tmp/packer1366264689"}
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Started Qemu. Pid: 1059741
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Qemu stderr: WARNING: Image format was not specified for '/tmp/packer1366264689' and probing guessed raw.
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 Qemu stderr:          Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
2024/09/11 06:12:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:39 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:5988)
2024/09/11 06:12:42 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:42 Connected to VNC desktop: QEMU (packer-windows_builder)
==> qemu.windows_builder: Typing the boot commands over VNC...
2024/09/11 06:12:42 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:42 Special code '<enter>' found, replacing with: 0xFF0D
2024/09/11 06:12:42 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:42 [INFO] communicator disabled, will not connect
    qemu.windows_builder: No communicator is configured -- skipping StepWaitGuestAddress
2024/09/11 06:12:42 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:42 Unable to load communicator config from state to populate provisionHookData
2024/09/11 06:12:42 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:42 Running the provision hook
==> qemu.windows_builder: Waiting for shutdown...
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: !!!! X64 Exception Type - 0D(#GP - General Protection)  CPU Apic ID - 00000000 !!!!
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: ExceptionData - 0000000000000000
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: RIP  - 000000007FA6CBC6, CS  - 0000000000000038, RFLAGS - 0000000000010002
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: RAX  - 49C7C83113FA7698, RCX - 0000000000000000, RDX - 000000007F92E018
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: RBX  - 0000000000000020, RSP - 000000007FF00990, RBP - 00000000746E7684
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: RSI  - 00000000746E7668, RDI - 000000007F92E018
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: R8   - 8000000000000001, R9  - 000000007FF00AC0, R10 - 0000000000000000
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: R11  - 0000000000001000, R12 - 00000000746E7665, R13 - 00000000FFE00000
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: R14  - 0000000000000000, R15 - 000000007F436818
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: GS   - 0000000000000030, SS  - 0000000000000030
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: CR0  - 0000000080010033, CR2 - 0000000000000000, CR3 - 000000007FC01000
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: CR4  - 0000000000000668, CR8 - 0000000000000000
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: GDTR - 000000007F9DE000 0000000000000047, LDTR - 0000000000000000
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: IDTR - 000000007F470018 0000000000000FFF,   TR - 0000000000000000
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: FXSAVE_STATE - 000000007FF005F0
2024/09/11 06:12:45 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:12:45 Qemu stdout: !!!! Find image based on IP(0x7FA6CBC6) (No PDB)  (ImageBase=000000007FA67000, EntryPoint=000000007FAA7503) !!!!
@nics90
Copy link
Author

nics90 commented Sep 11, 2024

Eventually it got failed with below errors:

ImageBase=000000007FA67000, EntryPoint=000000007FAA7503) !!!!
==> qemu.windows_builder: Failed to shutdown
2024/09/11 06:57:42 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:57:42 Unable to load communicator config from state to populate provisionHookData
==> qemu.windows_builder: Provisioning step had errors: Running the cleanup provisioner, if present...
==> qemu.windows_builder: Deleting output directory...
2024/09/11 06:57:42 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:57:42 failed to unlock port lockfile: close tcp [::]:5988: use of closed network connection
2024/09/11 06:57:42 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/11 06:57:42 Deleting floppy disk: /tmp/packer1366264689
2024/09/11 06:57:42 [INFO] (telemetry) ending qemu.windows_builder
==> Wait completed after 45 minutes 3 seconds
Build 'qemu.windows_builder' errored after 45 minutes 3 seconds: Failed to shutdown

2024/09/11 06:57:42 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2024/09/11 06:57:42 machine readable: qemu.windows_builder,error []string{"Failed to shutdown"}
==> Builds finished but no artifacts were created.
2024/09/11 06:57:42 [INFO] (telemetry) Finalizing.
==> Wait completed after 45 minutes 3 seconds

==> Some builds didn't complete successfully and had errors:
--> qemu.windows_builder: Failed to shutdown

==> Builds finished but no artifacts were created.
2024/09/11 06:57:43 waiting for all plugin processes to complete...
2024/09/11 06:57:43 /usr/bin/packer: plugin process exited
2024/09/11 06:57:43 /root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: plugin process exited
2024/09/11 06:57:43 /usr/bin/packer: plugin process exited
make: *** [Makefile:58: windows] Error 1
rm http/Autounattend.xml

@nics90
Copy link
Author

nics90 commented Sep 20, 2024

@jurekh , @alexsander-souza : Could you please look into it as this is a blocker for us to use MAAS in production.

@erickellerek1
Copy link

this relates to this already closed issue: #252

@erickellerek1
Copy link

is also reproducible with other iso e.g. windows server 2022.

==> qemu.windows_builder: Overriding default Qemu arguments with qemuargs template option...
2024/09/24 22:10:36 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 22:10:36 Executing /usr/bin/qemu-system-x86_64: []string{"-serial", "stdio", "-device", "e1000,netdev=user.0", "-fda", "/tmp/packer2705162775", "-m", "4096M", "-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", "-boot", "d", "-machine", "type=q35,accel=kvm", "-vnc", "0.0.0.0:61", "-cdrom", "/home/eric/Downloads/en-us_windows_server_2022_updated_sep_2024_x64_dvd_cab4e960.iso", "-cpu", "host", "-name", "packer-windows_builder", "-netdev", "user,id=user.0"}
2024/09/24 22:10:36 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 22:10:36 Started Qemu. Pid: 670815
2024/09/24 22:10:36 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 22:10:36 Qemu stderr: WARNING: Image format was not specified for '/tmp/packer2705162775' and probing guessed raw.
2024/09/24 22:10:36 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 22:10:36 Qemu stderr:          Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
2024/09/24 22:10:36 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/09/24 22:10:36 Qemu stderr:          Specify the 'raw' format explicitly to remove the restrictions.

@nics90
Copy link
Author

nics90 commented Sep 26, 2024

@erickellerek1 : Correct I tried with 2019 and 2022 and the same issue is replicable. Although #252 is closed but the issue is still there.

@jurekh
Copy link
Contributor

jurekh commented Sep 26, 2024

I cannot reproduce this in my env:

Windows Server 2022 downloaded from https://go.microsoft.com/fwlink/p/?LinkID=2195280&clcid=0x409&culture=en-us&country=US

$ cat .git/HEAD
ref: refs/heads/main

$ cat .git/refs/heads/main
2ad168c0858f8584e3db3b73d5b480c587cbfe09

$ packer --version
1.8.5

$ uname -srvmpio
Linux 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

$ lscpu
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          39 bits physical, 48 bits virtual
  Byte Order:             Little Endian
CPU(s):                   8
  On-line CPU(s) list:    0-7
Vendor ID:                GenuineIntel
  Model name:             11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    CPU family:           6
    Model:                140
    Thread(s) per core:   2
    Core(s) per socket:   4
    Socket(s):            1
    Stepping:             1
    CPU(s) scaling MHz:   55%
    CPU max MHz:          4700.0000
    CPU min MHz:          400.0000
    BogoMIPS:             5606.40
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall
                           nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_fre
                          q pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_dead
                          line_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 cdp_l2 ssbd ibrs ibpb stibp ibrs_enhanced
                           tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx
                           smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves split_lock_detect us
                          er_shstk dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2
                          gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2intersect md_clear ibt f
                          lush_l1d arch_capabilities
Virtualisation features:
  Virtualisation:         VT-x
Caches (sum of all):
  L1d:                    192 KiB (4 instances)
  L1i:                    128 KiB (4 instances)
  L2:                     5 MiB (4 instances)
  L3:                     12 MiB (1 instance)
NUMA:
  NUMA node(s):           1
  NUMA node0 CPU(s):      0-7
Vulnerabilities:
  Gather data sampling:   Mitigation; Microcode
  Itlb multihit:          Not affected
  L1tf:                   Not affected
  Mds:                    Not affected
  Meltdown:               Not affected
  Mmio stale data:        Not affected
  Reg file data sampling: Not affected
  Retbleed:               Not affected
  Spec rstack overflow:   Not affected
  Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
  Srbds:                  Not affected
  Tsx async abort:        Not affected

$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

$ cd windows
$ sudo make windows ISO=~/Downloads/SERVER_EVAL_x64FRE_en-us.iso VERSION=2022 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: 2048
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.uefi.template > http/Autounattend.xml
packer init . && packer build -var iso_path=~/Downloads/SERVER_EVAL_x64FRE_en-us.iso \
                -var headless=true \
                -var ovmf_suffix=_4M \
                windows.pkr.hcl
Installed plugin github.com/hashicorp/qemu v1.1.0 in "/root/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64"
Warning: A checksum of 'none' was specified. Since ISO files are so big,
a checksum is highly recommended.

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


qemu.windows_builder: output will be in this color.

==> qemu.windows_builder: Retrieving ISO
==> qemu.windows_builder: Trying ~/Downloads/SERVER_EVAL_x64FRE_en-us.iso
==> qemu.windows_builder: Trying ~/Downloads/SERVER_EVAL_x64FRE_en-us.iso
==> qemu.windows_builder: ~/Downloads/SERVER_EVAL_x64FRE_en-us.iso => ~/Downloads/SERVER_EVAL_x64FRE_en-us.iso
==> qemu.windows_builder: Creating floppy disk...
    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
==> qemu.windows_builder: Starting HTTP server on port 8605
    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
==> qemu.windows_builder: Starting VM, booting from CD-ROM
    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:5911
==> qemu.windows_builder: Overriding default Qemu arguments with qemuargs template option...
==> qemu.windows_builder: Waiting 1s for boot...
==> qemu.windows_builder: Connecting to VM via VNC (0.0.0.0:5911)
==> qemu.windows_builder: Typing the boot commands over VNC...
    qemu.windows_builder: No communicator is configured -- skipping StepWaitGuestAddress
==> qemu.windows_builder: Waiting for shutdown...
==> qemu.windows_builder: Running post-processor:  (type shell-local)
==> qemu.windows_builder (shell-local): Running local shell script: /tmp/packer-shell3080678634
    qemu.windows_builder (shell-local): Syncing output-windows_builder/packer-windows_builder...
    qemu.windows_builder (shell-local): Loading nbd...
    qemu.windows_builder (shell-local): Using /dev/nbd0
    qemu.windows_builder (shell-local): Binding image to /dev/nbd0...
    qemu.windows_builder (shell-local): /dev/nbd0 disconnected
    qemu.windows_builder (shell-local): Waiting for partitions to be created...
    qemu.windows_builder (shell-local): Adding curtin-hooks to image...
    qemu.windows_builder (shell-local): /dev/nbd0 disconnected
==> qemu.windows_builder: Running post-processor:  (type compress)
==> qemu.windows_builder (compress): Using pgzip compression with 8 cores for windows.dd.gz
==> qemu.windows_builder (compress): Archiving output-windows_builder/packer-windows_builder with pgzip
==> qemu.windows_builder (compress): Archive windows.dd.gz completed
Build 'qemu.windows_builder' finished after 18 minutes 7 seconds.

==> Wait completed after 18 minutes 7 seconds

==> Builds finished. The artifacts of successful builds are:
--> qemu.windows_builder: VM files in directory: output-windows_builder
--> qemu.windows_builder: VM files in directory: output-windows_builder
--> qemu.windows_builder: compressed artifacts in: windows.dd.gz
rm http/Autounattend.xml

This might not be an issue related to the packer template, but to the combination of the HW platform and qemu that you're using. Can you try another environment to help isolate the cause?

Update: added lscpu and /etc/*release contents for future comparison.

@nics90
Copy link
Author

nics90 commented Sep 26, 2024

Will try and check but below are details of my setup:

lscpu
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          46 bits physical, 48 bits virtual
  Byte Order:             Little Endian
CPU(s):                   40
  On-line CPU(s) list:    0-39
Vendor ID:                GenuineIntel
  Model name:             Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
    CPU family:           6
    Model:                63
    Thread(s) per core:   2
    Core(s) per socket:   10
    Socket(s):            2
    Stepping:             2
    CPU max MHz:          3000.0000
    CPU min MHz:          1200.0000
    BogoMIPS:             4599.87
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall n
                          x pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64
                          monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xs
                          ave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept
                          _ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flus
                          h_l1d
Virtualization features:
  Virtualization:         VT-x
cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
uname -a
Linux master01 5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

@MggMuggins
Copy link

If anyone is looking for a workaround, it's been reported that performing the build on Ubuntu 24.04 doesn't run into the exception.

@nics90
Copy link
Author

nics90 commented Oct 28, 2024

Image Building worked fine, but while provisioning the OS from same, it failed with below errors:

Running command ['sh', '-cf', 'wget "$1" --progress=dot:mega -O - |smtar -C "$2" --xattrs --xattrs-include=* -Sxpf - --numeric-owner', '--', 'http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz', '/tmp/tmplkx33zym/target'] with allowed return codes [0] (capture=False)
--2024-10-28 06:49:29-- http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz
Connecting to 192.168.103.11:5248... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5924918134 (5.5G) [application/octet-stream]
Saving to: ‘STDOUT’

 0K ....tar: This does not look like a tar archive

tar: Skipping to next header
tar: Exiting with failure status due to previous errors
.. 0% 9.03M=0.04s

Cannot write to ‘-’ (Broken pipe).
finish: cmd-install/stage-extract/builtin/cmd-extract: FAIL: acquiring and extracting image from http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz
finish: cmd-install/stage-extract/builtin/cmd-extract: FAIL: curtin command extract
Traceback (most recent call last):
File "/curtin/curtin/commands/main.py", line 202, in main
ret = args.func(args)
File "/curtin/curtin/commands/extract.py", line 258, in extract
extract_source(source, target)
File "/curtin/curtin/commands/extract.py", line 211, in extract_source
extract_root_tgz_url(source['uri'], target=target)
File "/curtin/curtin/commands/extract.py", line 58, in extract_root_tgz_url
util.subp(args=['sh', '-cf',
File "/curtin/curtin/util.py", line 280, in subp
return _subp(args, kwargs)
File "/curtin/curtin/util.py", line 144, in _subp
raise ProcessExecutionError(stdout=out, stderr=err,
curtin.util.ProcessExecutionError: Unexpected error while running command.
Command: ['sh', '-cf', 'wget "$1" --progress=dot:mega -O - |smtar -C "$2" --xattrs --xattrs-include=
-Sxpf - --numeric-owner', '--', 'http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz', '/tmp/tmplkx33zym/target']
Exit code: 2
Reason: -
Stdout: ''
Stderr: ''
Unexpected error while running command.
Command: ['sh', '-cf', 'wget "$1" --progress=dot:mega -O - |smtar -C "$2" --xattrs --xattrs-include=
-Sxpf - --numeric-owner', '--', 'http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz', '/tmp/tmplkx33zym/target']
Exit code: 2
Reason: -
Stdout: ''
Stderr: ''
curtin: Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'extract']
Exit code: 3
Reason: -
Stdout: start: cmd-install/stage-extract/builtin/cmd-extract: curtin command extract
Installing sources: [{'type': 'tgz', 'uri': 'http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz'}] to target at /tmp/tmplkx33zym/target
start: cmd-install/stage-extract/builtin/cmd-extract: acquiring and extracting image from http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz
Running command ['tar', '--help'] with allowed return codes [0] (capture=True)
Running command ['sh', '-cf', 'wget "$1" --progress=dot:mega -O - |smtar -C "$2" --xattrs --xattrs-include=
-Sxpf - --numeric-owner', '--', 'http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz', '/tmp/tmplkx33zym/target'] with allowed return codes [0] (capture=False)
--2024-10-28 06:49:29-- http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz
Connecting to 192.168.103.11:5248... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5924918134 (5.5G) [application/octet-stream]
Saving to: ‘STDOUT’

         0K ....tar: This does not look like a tar archive
    tar: Skipping to next header
    tar: Exiting with failure status due to previous errors
    ..                                                 0% 9.03M=0.04s
    
    
    Cannot write to ‘-’ (Broken pipe).
    finish: cmd-install/stage-extract/builtin/cmd-extract: FAIL: acquiring and extracting image from http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz
    finish: cmd-install/stage-extract/builtin/cmd-extract: FAIL: curtin command extract
    Traceback (most recent call last):
      File "/curtin/curtin/commands/main.py", line 202, in main
        ret = args.func(args)
      File "/curtin/curtin/commands/extract.py", line 258, in extract
        extract_source(source, target)
      File "/curtin/curtin/commands/extract.py", line 211, in extract_source
        extract_root_tgz_url(source['uri'], target=target)
      File "/curtin/curtin/commands/extract.py", line 58, in extract_root_tgz_url
        util.subp(args=['sh', '-cf',
      File "/curtin/curtin/util.py", line 280, in subp
        return _subp(*args, **kwargs)
      File "/curtin/curtin/util.py", line 144, in _subp
        raise ProcessExecutionError(stdout=out, stderr=err,
    curtin.util.ProcessExecutionError: Unexpected error while running command.
    Command: ['sh', '-cf', 'wget "$1" --progress=dot:mega -O - |smtar -C "$2" --xattrs --xattrs-include=* -Sxpf - --numeric-owner', '--', 'http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz', '/tmp/tmplkx33zym/target']
    Exit code: 2
    Reason: -
    Stdout: ''
    Stderr: ''
    Unexpected error while running command.
    Command: ['sh', '-cf', 'wget "$1" --progress=dot:mega -O - |smtar -C "$2" --xattrs --xattrs-include=* -Sxpf - --numeric-owner', '--', 'http://192.168.103.11:5248/images/6cae7a18f76457c2e29d611017514cbf4f801df4c0b1f1db7bf7d35a4da59db1/custom/amd64/generic/cloudlyte-win2k19/uploaded/root.tgz', '/tmp/tmplkx33zym/target']
    Exit code: 2
    Reason: -
    Stdout: ''
    Stderr: ''

Stderr: ''

@iamtinu
Copy link

iamtinu commented Nov 21, 2024

If anyone is looking for a workaround, it's been reported that performing the build on Ubuntu 24.04 doesn't run into the exception.

I am having all the issues mentioned above. the latest commit also resulted in failure. I am building a ubuntu 24 VM now to try this. Thanks for suggestion. I will update here if successful to back you up.

@iamtinu
Copy link

iamtinu commented Nov 22, 2024

If anyone is looking for a workaround, it's been reported that performing the build on Ubuntu 24.04 doesn't run into the exception.

Hello Guys. Just an update, after wasting a week on the problem, and a day working on ubuntu 24, I can confirm the above solution mentioned by the user works. If you are getting frustrated as me on ubuntu22 please try ubuntu 24 for successful builds.

Thank You

@iamtinu
Copy link

iamtinu commented Nov 25, 2024

@nics90 I got the image working by making new image . I had to make changes in pkr.hcl file. Can't find the another thread in which we were having conversation for the problem tar: This does not look like a tar archive

@iamtinu
Copy link

iamtinu commented Nov 25, 2024

I have posted the script in a different issue. please read it.

#278

@alanbach
Copy link
Contributor

Hello Everyone! Please note that Windows images are not tar.gz. They are DD images and need to be imported accordingly in MAAS. Please see the README file for an example also this:

maas ${PROFILE} boot-resources create name='windows/windows-11' title='Windows 11' architecture='amd64/generic' filetype=ddgz content@=windows11.dd.gz

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 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants