You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before I go into my issue with packer and/or qemu, I need to point out that I'm, generally, an idiot when it comes to getting around Linux in the CLI, so, please be patient if I ask stupid questions.
I am running packer from one of the machines that my company has in a off-site datacenter, it is also the same machine that we're running MaaS on. This isn't my first time using packer, I have been able to create images for CentOS 7/8, Rocky 8, and RHEL 7/8/9.
After navigating over to my packer install location and into the Rocky9 directory, I ran the init on the rocky9.pkr.hcl file that was auto included in the packer-maas install from github.
When the make command errored out with qemu.rocky9: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info, I re-ran the command with the the log activated.
:~/packer-maas/rocky9$ PACKER_LOG=1 packer build .
2024/12/23 10:30:32 [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/12/23 10:30:32 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/12/23 10:30:32 [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/hybridos/.packerconfig
2024/12/23 10:30:32 [WARN] Config file doesn't exist: /home/hybridos/.packerconfig
2024/12/23 10:30:32 [INFO] Setting cache directory: /home/hybridos/.cache/packer
2024/12/23 10:30:32 [TRACE] listing potential installations for "github.com/hashicorp/qemu" that match "~> 1.0". plugingetter.ListInstallationsOptions{PluginDirectory:"/home/hybridos/.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)(0xc0005cc100)}}, ReleasesOnly:false}}
2024/12/23 10:30:33 [TRACE] Found the following "github.com/hashicorp/qemu" installations: [{/home/hybridos/.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 10:30:33 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/12/23 10:30:33 [TRACE] listing potential installations for <nil> that match "". plugingetter.ListInstallationsOptions{PluginDirectory:"/home/hybridos/.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)(0xc000592000)}}, ReleasesOnly:false}}
2024/12/23 10:30:33 [INFO] found external [-packer-default-plugin-name-] builders from qemu plugin
2024/12/23 10:30:33 [TRACE] validateValue: not active for ks_appstream_repos, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for ks_proxy, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for rocky_iso_url, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for ks_os_repos, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for ks_base_os_repos, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for ks_extras_repos, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for ks_mirror, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for timeout, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for filename, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for headless, so skipping
2024/12/23 10:30:33 [TRACE] validateValue: not active for rocky_sha256sum_url, so skipping
2024/12/23 10:30:33 [INFO] Starting external plugin /home/hybridos/.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 10:30:33 Starting plugin: /home/hybridos/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 []string{"/home/hybridos/.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 10:30:33 Waiting for RPC address for: /home/hybridos/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64
2024/12/23 10:30:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:33 Plugin address: unix /tmp/packer-plugin3542778678
2024/12/23 10:30:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:33 Waiting for connection...
2024/12/23 10:30:33 Received unix RPC address for /home/hybridos/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: addr is /tmp/packer-plugin3542778678
2024/12/23 10:30:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:33 Serving a plugin connection...
2024/12/23 10:30:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:33 [TRACE] starting builder -packer-default-plugin-name-
2024/12/23 10:30:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:33 use detected accelerator: tcg
2024/12/23 10:30:33 [INFO] Starting internal plugin packer-post-processor-shell-local
2024/12/23 10:30:33 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "execute", "packer-post-processor-shell-local"}
2024/12/23 10:30:33 Waiting for RPC address for: /usr/bin/packer
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: [INFO] Packer version: 1.11.2 [go1.21.12 linux amd64]
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/hybridos/.packerconfig
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: [WARN] Config file doesn't exist: /home/hybridos/.packerconfig
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: [INFO] Setting cache directory: /home/hybridos/.cache/packer
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: args: []string{"packer-post-processor-shell-local"}
2024/12/23 10:30:33 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin360564939
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: Plugin address: unix /tmp/packer-plugin360564939
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: Waiting for connection...
2024/12/23 10:30:33 packer-post-processor-shell-local plugin: Serving a plugin connection...
2024/12/23 10:30:33 Build debug mode: false
2024/12/23 10:30:33 Force build: false
2024/12/23 10:30:33 On error:
2024/12/23 10:30:33 Waiting on builds to complete...
2024/12/23 10:30:33 Starting build run: qemu.rocky9
2024/12/23 10:30:33 Running builder: qemu
2024/12/23 10:30:33 [INFO] (telemetry) Starting builder qemu.rocky9
qemu.rocky9: output will be in this color.
2024/12/23 10:30:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:33 Qemu path: /usr/bin/qemu-system-x86_64, Qemu Image path: /usr/bin/qemu-img
==> qemu.rocky9: Retrieving ISO
==> qemu.rocky9: Trying https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-x86_64-boot.iso
2024/12/23 10:30:33 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:33 Acquiring lock for: https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-x86_64-boot.iso?checksum=sha256%!A(MISSING)628c069c9685477360640a6b58dc919692a11c44b49a50a024b5627ce3c27d5f (/home/hybridos/.cache/packer/afd1755c2f018d3b33fb0817318704c503df54f4.iso.lock)
==> qemu.rocky9: Trying https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-x86_64-boot.iso?checksum=sha256%3A628c069c9685477360640a6b58dc919692a11c44b49a50a024b5627ce3c27d5f
==> qemu.rocky9: https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-x86_64-boot.iso?checksum=sha256%3A628c069c9685477360640a6b58dc919692a11c44b49a50a024b5627ce3c27d5f => /home/hybridos/.cache/packer/afd1755c2f018d3b33fb0817318704c503df54f4.iso
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Leaving retrieve loop for ISO
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 No floppy files specified. Floppy disk will not be made.
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 No CD files specified. CD disk will not be made.
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 [INFO] Creating disk with Path: output-rocky9/packer-rocky9 and Size: 4G
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Executing qemu-img: []string{"create", "-f", "qcow2", "output-rocky9/packer-rocky9", "4G"}
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 stdout: Formatting 'output-rocky9/packer-rocky9', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=4294967296 lazy_refcounts=off refcount_bits=16
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 stderr:
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Found available port: 8077 on IP: 0.0.0.0
==> qemu.rocky9: Starting HTTP server on port 8077
qemu.rocky9: No communicator is set; skipping port forwarding setup.
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Looking for available port between 5900 and 6000 on 127.0.0.1
==> qemu.rocky9: Looking for available port between 5900 and 6000 on 127.0.0.1
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Found available port: 5942 on IP: 127.0.0.1
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Found available VNC port: 5942 on IP: 127.0.0.1
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Qemu --version output: QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.24)
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Qemu version: 6.2.0
==> qemu.rocky9: Starting VM, booting from CD-ROM
qemu.rocky9: view the screen of the VM, connect via VNC without a password to
qemu.rocky9: vnc://127.0.0.1:5942
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Qemu Builder has no floppy files, not attaching a floppy.
qemu.rocky9: The VM will be run headless, without a GUI. If you want to
qemu.rocky9: view the screen of the VM, connect via VNC without a password to
qemu.rocky9: vnc://127.0.0.1:5942
==> qemu.rocky9: Overriding default Qemu arguments with qemuargs template option...
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Executing /usr/bin/qemu-system-x86_64: []string{"-m", "2048M", "-device", "virtio-net,netdev=user.0", "-name", "packer-rocky9", "-netdev", "user,id=user.0", "-smp", "1", "-display", "none", "-machine", "type=pc,accel=tcg", "-vnc", "127.0.0.1:42", "-boot", "once=d", "-drive", "file=output-rocky9/packer-rocky9,if=virtio,cache=writeback,discard=ignore,format=qcow2", "-drive",
"file=/home/hybridos/.cache/packer/afd1755c2f018d3b33fb0817318704c503df54f4.iso,media=cdrom", "-serial", "stdio", "-cpu", "host"}
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Started Qemu. Pid: 6675
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 Qemu stderr: qemu-system-x86_64: CPU model 'host' requires KVM or HVF
==> qemu.rocky9: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info.
2024/12/23 10:30:39 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/12/23 10:30:39 failed to unlock port lockfile: close tcp 127.0.0.1:5942: use of closed network connection
==> qemu.rocky9: Deleting output directory...
2024/12/23 10:30:39 [INFO] (telemetry) ending qemu.rocky9
==> Wait completed after 5 seconds 922 milliseconds
2024/12/23 10:30:39 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2024/12/23 10:30:39 machine readable: qemu.rocky9,error []string{"Build was halted."}
==> Builds finished but no artifacts were created.
Build 'qemu.rocky9' errored after 5 seconds 922 milliseconds: Build was halted.
2024/12/23 10:30:39 [INFO] (telemetry) Finalizing.
==> Wait completed after 5 seconds 922 milliseconds
==> Some builds didn't complete successfully and had errors:
--> qemu.rocky9: Build was halted.
==> Builds finished but no artifacts were created.
2024/12/23 10:30:39 waiting for all plugin processes to complete...
2024/12/23 10:30:39 /usr/bin/packer: plugin process exited
2024/12/23 10:30:39 /home/hybridos/.config/packer/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.0_x5.0_linux_amd64: plugin process exited
I did try to update the local firewall settings and open the port via the sudo ufw allow 5975 command but that doesn't seem to have done anything. This might be an issue with qemu, something about the config, but, as you can probably, I can't tell.
I haven't changed anything in the rocky9.pkr.hcl file, it should be exactly as you see it in the repository.
If y'all can tell me if this is a packer issue, and help if possible, or if this is an issue with something else, I would greatly appreciate it.
The text was updated successfully, but these errors were encountered:
Howdy and happy holidays,
Before I go into my issue with packer and/or qemu, I need to point out that I'm, generally, an idiot when it comes to getting around Linux in the CLI, so, please be patient if I ask stupid questions.
I am running packer from one of the machines that my company has in a off-site datacenter, it is also the same machine that we're running MaaS on. This isn't my first time using packer, I have been able to create images for CentOS 7/8, Rocky 8, and RHEL 7/8/9.
OS: Ubuntu 22.04.3 LTS
MaaS Version: 3.5 (just updated/upgraded this morning)
Packer Version: 1.11.2
After navigating over to my packer install location and into the Rocky9 directory, I ran the init on the
rocky9.pkr.hcl
file that was auto included in the packer-maas install from github.When the
make
command errored out withqemu.rocky9: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info
, I re-ran the command with the the log activated.I did try to update the local firewall settings and open the port via the
sudo ufw allow 5975
command but that doesn't seem to have done anything. This might be an issue with qemu, something about the config, but, as you can probably, I can't tell.I haven't changed anything in the
rocky9.pkr.hcl
file, it should be exactly as you see it in the repository.If y'all can tell me if this is a packer issue, and help if possible, or if this is an issue with something else, I would greatly appreciate it.
The text was updated successfully, but these errors were encountered: