bento
bento copied to clipboard
Ubuntu 22.04 build for qemu provider is failing
Version:
[Version of the project installed]
Environment:
macOS 12.4 packer 1.8.0
Scenario:
Building the Ubuntu 22.04 for libvirt is failing due to ssh handshake failure.
Steps to Reproduce:
Build the Ubuntu 22.04 by running the below command
bento build --version 202206.03.0 --only qemu packer_templates/ubuntu/ubuntu-22.04-amd64.json
Expected Result:
The build should be successful and the artifact should be created.
Actual Result:
The build is failing with the below error.
==> Starting build for templates:
- packer_templates/ubuntu/ubuntu-22.04-amd64
==> [ubuntu-22.04-amd64] Building: 'packer build -var headless=true -only=qemu -force -var-file=/var/folders/j4/n0d0xzg13kn96fx3hwmfjf104km1m3/T/ubuntu-22.04-amd64-metadata.json20220609-32665-fcbvbw ubuntu-22.04-amd64.json'
qemu: output will be in this color.
==> qemu: Retrieving ISO
==> qemu: Trying http://releases.ubuntu.com/jammy/ubuntu-22.04-live-server-amd64.iso
==> qemu: Trying http://releases.ubuntu.com/jammy/ubuntu-22.04-live-server-amd64.iso?checksum=sha256%3A84aeaf7823c8c61baa0ae862d0a06b03409394800000b3235854a6b38eb4856f
==> qemu: http://releases.ubuntu.com/jammy/ubuntu-22.04-live-server-amd64.iso?checksum=sha256%3A84aeaf7823c8c61baa0ae862d0a06b03409394800000b3235854a6b38eb4856f => /Users/asaidala/.cache/packer/b9441068de828d36573e1274dfe77f69aebda15a.iso
==> qemu: Starting HTTP server on port 8093
==> qemu: Found port for communicator (SSH, WinRM, etc): 2580.
==> qemu: Looking for available port between 5900 and 6000 on 127.0.0.1
==> qemu: Starting VM, booting from CD-ROM
qemu: The VM will be run headless, without a GUI. If you want to
qemu: view the screen of the VM, connect via VNC without a password to
qemu: vnc://127.0.0.1:5925
==> qemu: Overriding default Qemu arguments with qemuargs template option...
==> qemu: Waiting 5s for boot...
==> qemu: Connecting to VM via VNC (127.0.0.1:5925)
==> qemu: Typing the boot command over VNC...
qemu: Not using a NetBridge -- skipping StepWaitGuestAddress
==> qemu: Using SSH communicator to connect: 127.0.0.1
==> qemu: Waiting for SSH to become available...
==> qemu: Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> qemu: Deleting output directory...
Build 'qemu' errored after 5 minutes 53 seconds: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> Wait completed after 5 minutes 53 seconds
==> Some builds didn't complete successfully and had errors:
--> qemu: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> Builds finished but no artifacts were created.
>>> [ubuntu-22.04-amd64] Error building, exited
same issue
➜ ~ packer version Packer v1.8.1
macOS version 11.6 (20G165) arm64
Well, that's a fun issue. Ubuntu 20.04, Packer 1.8.1
This command worked:
packer build -only=qemu packer_templates/ubuntu/ubuntu-22.04-amd64.json
I don't have the bento
tool installed, so didn't use that.
Not sure whether I am doing any mistakes while building the box, but I got the same error on an Ubuntu machine as well.
ubuntu@ip-172-31-26-80:~/bento$ bento build --version 202206.03.0 --only qemu packer_templates/ubuntu/ubuntu-22.04-amd64.json
==> Starting build for templates:
- packer_templates/ubuntu/ubuntu-22.04-amd64
==> [ubuntu-22.04-amd64] Building: 'packer build -var headless=true -only=qemu -force -var-file=/tmp/ubuntu-22.04-amd64-metadata.json20220613-66878-fi0o0u ubuntu-22.04-amd64.json'
qemu: output will be in this color.
==> qemu: Retrieving ISO
==> qemu: Trying http://releases.ubuntu.com/jammy/ubuntu-22.04-live-server-amd64.iso
==> qemu: Trying http://releases.ubuntu.com/jammy/ubuntu-22.04-live-server-amd64.iso?checksum=sha256%3A84aeaf7823c8c61baa0ae862d0a06b03409394800000b3235854a6b38eb4856f
==> qemu: http://releases.ubuntu.com/jammy/ubuntu-22.04-live-server-amd64.iso?checksum=sha256%3A84aeaf7823c8c61baa0ae862d0a06b03409394800000b3235854a6b38eb4856f => /home/ubuntu/.cache/packer/b9441068de828d36573e1274dfe77f69aebda15a.iso
==> qemu: Starting HTTP server on port 8978
==> qemu: Found port for communicator (SSH, WinRM, etc): 2929.
==> qemu: Looking for available port between 5900 and 6000 on 127.0.0.1
==> qemu: Starting VM, booting from CD-ROM
qemu: The VM will be run headless, without a GUI. If you want to
qemu: view the screen of the VM, connect via VNC without a password to
qemu: vnc://127.0.0.1:5957
==> qemu: Overriding default Qemu arguments with qemuargs template option...
==> qemu: Waiting 5s for boot...
==> qemu: Connecting to VM via VNC (127.0.0.1:5957)
==> qemu: Typing the boot command over VNC...
qemu: Not using a NetBridge -- skipping StepWaitGuestAddress
==> qemu: Using SSH communicator to connect: 127.0.0.1
==> qemu: Waiting for SSH to become available...
==> qemu: Error waiting for SSH: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> qemu: Deleting output directory...
Build 'qemu' errored after 6 minutes 51 seconds: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> Wait completed after 6 minutes 51 seconds
==> Some builds didn't complete successfully and had errors:
--> qemu: Packer experienced an authentication error when trying to connect via SSH. This can happen if your username/password are wrong. You may want to double-check your credentials as part of your debugging process. original error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none password], no supported methods remain
==> Builds finished but no artifacts were created.
>>> [ubuntu-22.04-amd64] Error building, exited
ubuntu@ip-172-31-26-80:~/bento$
Same issue and error message occurs when building 20.04, from a 22.10 host.
host os: Ubuntu 22.10 Packer: 1.6.6 (from default repositories) qemu: 7.0.0 (Debian 1:7.0+dfsg-7ubuntu2 kernel: 5.19.0-23-generic ssh: OpenSSH_9.0p1 Ubuntu-1ubuntu7, OpenSSL 3.0.5 5 Jul 2022 kvm module: kvm_intel
However, I also tried fedora-36 and it built successfully!
PACKER_LOG=1 packer build -only=qemu fedora-36-x86_64.json
Please test with the latest version of bento packer code. You may have to add -var "qemu_accelerator=hvf"
to the command if running on macos.
This has been tested and is working with the latest version of macos, qemu, packer, and bento code. closing this as complete. Feel free to reopen or submit a new issue if you find the issue still persists.