Open hc-github-team-packer opened 1 year ago
any updates on this issue, please?? I'm facing the same issue with RockyLinux9.1.
I am seeing the same, using a Debian iso, on Apple ARM (From the bento repo). Packer : 1.8.6 qemu-system-aarch64 : QEMU emulator version 7.2.1
Full command :
PACKER_LOG=1 PYTHONPATH=/Library/Frameworks/ParallelsVirtualizationSDK.framework/Versions/10/Libraries/Python/3.7 packer build -only=qemu.vm -var-file=os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl -var "qemu_accelerator=hvf" ./packer_templates
From debug output :
2023/04/07 14:13:00 [INFO] (telemetry) Starting builder qemu.vm
2023/04/07 14:13:00 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:00 Qemu path: /opt/homebrew/bin/qemu-system-aarch64, Qemu Image path: /opt/homebrew/bin/qemu-img
==> qemu.vm: Retrieving ISO
==> qemu.vm: Trying https://cdimage.debian.org/debian-cd/current/arm64/iso-dvd/debian-11.6.0-arm64-DVD-1.iso
2023/04/07 14:13:00 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:00 Acquiring lock for: https://cdimage.debian.org/debian-cd/current/arm64/iso-dvd/debian-11.6.0-arm64-DVD-1.iso?checksum=sha256%3Ab27ff768c10808518790d72d670c5588cdc60cf8934ef92773a89274a193a65f (/Users/wim.vandijck/.cache/packer/e4335719c1f02152968cbf9251bd3ad250b0f44f.iso.lock)
==> qemu.vm: Trying https://cdimage.debian.org/debian-cd/current/arm64/iso-dvd/debian-11.6.0-arm64-DVD-1.iso?checksum=sha256%3Ab27ff768c10808518790d72d670c5588cdc60cf8934ef92773a89274a193a65f
2023/04/07 14:13:03 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:03 Leaving retrieve loop for ISO
==> qemu.vm: https://cdimage.debian.org/debian-cd/current/arm64/iso-dvd/debian-11.6.0-arm64-DVD-1.iso?checksum=sha256%3Ab27ff768c10808518790d72d670c5588cdc60cf8934ef92773a89274a193a65f => /Users/wim.vandijck/.cache/packer/e4335719c1f02152968cbf9251bd3ad250b0f44f.iso
2023/04/07 14:13:03 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:03 No floppy files specified. Floppy disk will not be made.
2023/04/07 14:13:03 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:03 No CD files specified. CD disk will not be made.
==> qemu.vm: Copying hard drive...
2023/04/07 14:13:03 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:03 Executing qemu-img: []string{"convert", "-O", "qcow2", "/Users/wim.vandijck/.cache/packer/e4335719c1f02152968cbf9251bd3ad250b0f44f.iso", "builds/packer-debian-11.6-aarch64-qemu/debian-11.6-aarch64"}
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 stdout:
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 stderr:
==> qemu.vm: Resizing hard drive...
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Executing qemu-img: []string{"resize", "-f", "qcow2", "builds/packer-debian-11.6-aarch64-qemu/debian-11.6-aarch64", "65536M"}
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 stdout: Image resized.
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 stderr:
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Found available port: 8233 on IP: 0.0.0.0
==> qemu.vm: Starting HTTP server on port 8233
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Looking for available communicator (SSH, WinRM, etc) port between 2222 and 4444
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Found available port: 2747 on IP: 127.0.0.1
==> qemu.vm: Found port for communicator (SSH, WinRM, etc): 2747.
==> qemu.vm: Looking for available port between 5900 and 6000 on 127.0.0.1
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Looking for available port between 5900 and 6000 on 127.0.0.1
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Found available port: 5935 on IP: 127.0.0.1
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Found available VNC port: 5935 on IP: 127.0.0.1
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Qemu --version output: QEMU emulator version 7.2.1
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Qemu version: 7.2.1
==> qemu.vm: Starting VM, booting disk image
qemu.vm: The VM will be run headless, without a GUI. If you want to
qemu.vm: view the screen of the VM, connect via VNC without a password to
qemu.vm: vnc://127.0.0.1:5935
qemu.vm: view the screen of the VM, connect via VNC without a password to
qemu.vm: vnc://127.0.0.1:5935
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Qemu Builder has no floppy files, not attaching a floppy.
==> qemu.vm: Overriding default Qemu arguments with qemuargs template option...
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Executing /opt/homebrew/bin/qemu-system-aarch64: []string{"-smp", "2", "-device", "virtio-net,netdev=user.0", "-drive", "file=builds/packer-debian-11.6-aarch64-qemu/debian-11.6-aarch64,if=virtio,cache=writeback,discard=ignore,format=qcow2", "-vnc", "127.0.0.1:35", "-name", "debian-11.6-aarch64", "-netdev", "user,id=user.0,hostfwd=tcp::2747-:22", "-machine", "type=virt,accel=hvf", "-m", "2048M", "-boot", "strict=off"}
2023/04/07 14:13:06 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:06 Started Qemu. Pid: 9283
==> qemu.vm: Waiting 10s for boot...
==> qemu.vm: Connecting to VM via VNC (127.0.0.1:5935)
2023/04/07 14:13:18 packer-plugin-qemu_v1.0.9_x5.0_darwin_arm64 plugin: 2023/04/07 14:13:18 Connected to VNC desktop: QEMU (debian-11.6-aarch64)
==> qemu.vm: Typing the boot commands over VNC...
When I connect to the VNC, I see the QEmu monitor prompt. Then I see the boot command being typed, but this clearly isn't the boot prompt from the booted ISO.
Hi, you can try to change the qemuargs block as mentioned in the documentation https://developer.hashicorp.com/packer/plugins/builders/qemu#qemuargs
"qemuargs": [
["-cpu", "host"],
["-netdev", "user,id=user.0,",
"hostfwd=tcp::{{ .SSHHostPort }}-:22,",
"net=10.210.240.0/24,",
"dhcpstart=10.210.240.9",
""
],
["-device", "virtio-net,netdev=user.0"]
]
This issue was originally opened by @sreekanth-ragi in https://github.com/hashicorp/packer/issues/12125 and has been migrated to this repository. The original issue description is below.
Packer Version: 1.8.4 QEMU emulator version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.40) Rocky-9.0-20220808.0-x86_64-dvd.iso
Trying to build Rocky 9 image using ISO with static IP assignment, but getting issues with packer not being able to SSH into the guest VM. I can login to the guest VM directly by using VNC.
If do not provide the flags for net configuration, then everything is working fine. I want to understand if the process I'm following to assign the gues VM with a specific IP Address is correct or am I missing additional steps that would make this work.
Seeing the following error.
Thanks in Advance for the help.
Sreekanth