Issue with Packer Qemu builder

I’m using the qemu builder to create a qcow2 image with ISO, below is my JSON template that i’m using to deploy. I’m not sure what’s exactly is causing the problem but i was not able to SSH into the temp VM that was booted from this ISO, i’m not sure if i’m boot command is correct or not, I’ve also added the Kickstart file that i’m using and the detailed log that i got. Any suggestions would be highly appreciated. Thanks in advance.
{
“builders”:
[
{
“type”: “qemu”,
“accelerator”: “kvm”,
“headless”: true,
“qemuargs”: [
[ “-m”, “2048M” ],
[ “-smp”, “cpus=1,maxcpus=16,cores=4” ]
],
“disk_interface”: “virtio”,
“disk_size”: “22528”,
“format”: “qcow2”,
“net_device”: “virtio-net”,

  "iso_url": "http://centos.excellmedia.net/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso",
  "iso_checksum": "07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a",

  "vm_name": "centos7-base",
  "output_directory": "centos7-base-img",

  "http_directory": "docroot",
  "http_port_min": 10082,
  "http_port_max": 10089,


  "ssh_username": "root",
  "ssh_password": "root@1234",
  "ssh_wait_timeout": "30m",

  "boot_wait": "40s",
  "boot_command": [
    "inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/c8-kvm-ks.cfg"
  ],

  "shutdown_command": "shutdown -P now"
}

],

Kickstart

Keyboard layouts

keyboard us

Root password

rootpw glis@1234

System timezone

timezone --utc UTC

Reboot after installation

reboot --eject

System language

lang en_US.UTF-8

Firewall configuration

firewall --enable --ssh

System authorization information

auth --useshadow --passalgo=sha512

Use text install

text

Dont’ start the Initial Setup application upon first sytem boot

firstboot --disabled

SELinux configuration

selinux --permissive

Networking

network --bootproto=dhcp --onboot=on --device=eth0 --ipv6=auto

Do not configure the X Window System

skipx

Accept EULA without user interaction

eula --agreed

System bootloader configuration

bootloader --location=mbr

Partition clearing information

clearpart --all
zerombr

Partition setup

part /boot --fstype=xfs --size 500
part pv.01 --fstype=xfs --size 1 --grow

LVM setup

volgroup System pv.01
logvol swap --vgname=System --fstype=swap --name=swap --recommended
logvol /home --vgname=System --fstype=xfs --size=1907 --name=home
logvol /tmp --vgname=System --fstype=xfs --size=1907 --name=tmp
logvol /var --vgname=System --fstype=xfs --size=4768 --name=var
logvol /var/log --vgname=System --fstype=xfs --size=4768 --name=var_log
logvol /var/log/audit --vgname=System --fstype=xfs --size=1907 --name=var_log_audit
logvol /var/tmp --vgname=System --fstype=xfs --size=1907 --name=var_tmp
logvol / --vgname=System --fstype=xfs --size=1 --grow --name=root

User setup

TODO: Test if no password is set and if adding a key still work

user --name=centos --groups=centos

Services

services --enabled=NetworkManager,sshd

Packages

%packages
@^Basic Web Server
%end

%post --log=/root/ks-post.log

yum install -y python3 epel-release
pip3 install passlib

yum install -y python2-pip
pip install --upgrade pip
pip install passlib
%end

root@opnstk-poc-1:~/packer/packer-centos7-kvm-example# PACKER_LOG=1 packer build centos7-base.json_old_bak
2021/07/27 06:03:17 [INFO] Packer version: 1.7.3 [go1.16.5 linux amd64]
2021/07/27 06:03:17 [TRACE] discovering plugins in /usr/bin
2021/07/27 06:03:17 [TRACE] discovering plugins in /root/.packer.d/plugins
2021/07/27 06:03:17 [TRACE] discovering plugins in .
2021/07/27 06:03:17 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/27 06:03:17 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2021/07/27 06:03:17 [WARN] Config file doesn’t exist: /root/.packerconfig
2021/07/27 06:03:17 [INFO] Setting cache directory: /root/packer/packer-centos7-kvm-example/packer_cache
2021/07/27 06:03:17 [TRACE] Starting internal plugin packer-builder-qemu
2021/07/27 06:03:17 Starting plugin: /usr/bin/packer string{"/usr/bin/packer", “plugin”, “packer-builder-qemu”}
2021/07/27 06:03:17 Waiting for RPC address for: /usr/bin/packer
2021/07/27 06:03:17 packer-builder-qemu plugin: [INFO] Packer version: 1.7.3 [go1.16.5 linux amd64]
2021/07/27 06:03:17 packer-builder-qemu plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/27 06:03:17 packer-builder-qemu plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2021/07/27 06:03:17 packer-builder-qemu plugin: [WARN] Config file doesn’t exist: /root/.packerconfig
2021/07/27 06:03:17 packer-builder-qemu plugin: [INFO] Setting cache directory: /root/packer/packer-centos7-kvm-example/packer_cache
2021/07/27 06:03:17 packer-builder-qemu plugin: args: string{“packer-builder-qemu”}
2021/07/27 06:03:17 packer-builder-qemu plugin: Plugin address: unix /tmp/packer-plugin267347805
2021/07/27 06:03:17 packer-builder-qemu plugin: Waiting for connection…
2021/07/27 06:03:17 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin267347805
2021/07/27 06:03:17 packer-builder-qemu plugin: Serving a plugin connection…
2021/07/27 06:03:17 [TRACE] Starting internal plugin packer-provisioner-shell-local
2021/07/27 06:03:17 Starting plugin: /usr/bin/packer string{"/usr/bin/packer", “plugin”, “packer-provisioner-shell-local”}
2021/07/27 06:03:17 Waiting for RPC address for: /usr/bin/packer
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: [INFO] Packer version: 1.7.3 [go1.16.5 linux amd64]
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: [WARN] Config file doesn’t exist: /root/.packerconfig
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: [INFO] Setting cache directory: /root/packer/packer-centos7-kvm-example/packer_cache
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: args: string{“packer-provisioner-shell-local”}
2021/07/27 06:03:17 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin423779472
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: Plugin address: unix /tmp/packer-plugin423779472
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: Waiting for connection…
2021/07/27 06:03:17 packer-provisioner-shell-local plugin: Serving a plugin connection…
2021/07/27 06:03:17 [TRACE] Starting internal plugin packer-provisioner-file
2021/07/27 06:03:17 Starting plugin: /usr/bin/packer string{"/usr/bin/packer", “plugin”, “packer-provisioner-file”}
2021/07/27 06:03:17 Waiting for RPC address for: /usr/bin/packer
2021/07/27 06:03:17 packer-provisioner-file plugin: [INFO] Packer version: 1.7.3 [go1.16.5 linux amd64]
2021/07/27 06:03:17 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/27 06:03:17 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2021/07/27 06:03:17 packer-provisioner-file plugin: [WARN] Config file doesn’t exist: /root/.packerconfig
2021/07/27 06:03:17 packer-provisioner-file plugin: [INFO] Setting cache directory: /root/packer/packer-centos7-kvm-example/packer_cache
2021/07/27 06:03:17 packer-provisioner-file plugin: args: string{“packer-provisioner-file”}
2021/07/27 06:03:17 packer-provisioner-file plugin: Plugin address: unix /tmp/packer-plugin863070684
2021/07/27 06:03:17 packer-provisioner-file plugin: Waiting for connection…
2021/07/27 06:03:17 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin863070684
2021/07/27 06:03:17 packer-provisioner-file plugin: Serving a plugin connection…
2021/07/27 06:03:17 [TRACE] Starting internal plugin packer-provisioner-shell
2021/07/27 06:03:17 Starting plugin: /usr/bin/packer string{"/usr/bin/packer", “plugin”, “packer-provisioner-shell”}
2021/07/27 06:03:17 Waiting for RPC address for: /usr/bin/packer
2021/07/27 06:03:17 packer-provisioner-shell plugin: [INFO] Packer version: 1.7.3 [go1.16.5 linux amd64]
2021/07/27 06:03:17 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/07/27 06:03:17 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2021/07/27 06:03:17 packer-provisioner-shell plugin: [WARN] Config file doesn’t exist: /root/.packerconfig
2021/07/27 06:03:17 packer-provisioner-shell plugin: [INFO] Setting cache directory: /root/packer/packer-centos7-kvm-example/packer_cache
2021/07/27 06:03:17 packer-provisioner-shell plugin: args: string{“packer-provisioner-shell”}
2021/07/27 06:03:17 packer-provisioner-shell plugin: Plugin address: unix /tmp/packer-plugin108999163
2021/07/27 06:03:17 packer-provisioner-shell plugin: Waiting for connection…
2021/07/27 06:03:17 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin108999163
2021/07/27 06:03:17 packer-provisioner-shell plugin: Serving a plugin connection…
2021/07/27 06:03:17 Preparing build: qemu
2021/07/27 06:03:17 packer-builder-qemu plugin: use specified accelerator: kvm
2021/07/27 06:03:17 packer-builder-qemu plugin: MemorySize 0 is too small, using default: 512
2021/07/27 06:03:17 packer-builder-qemu plugin: CpuCount 0 too small, using default: 1
2021/07/27 06:03:17 Build debug mode: false
2021/07/27 06:03:17 Force build: false
2021/07/27 06:03:17 On error:
2021/07/27 06:03:17 Waiting on builds to complete…
2021/07/27 06:03:17 Starting build run: qemu
2021/07/27 06:03:17 Running builder: qemu
qemu: output will be in this color.
2021/07/27 06:03:17 [INFO] (telemetry) Starting builder qemu

2021/07/27 06:03:17 packer-builder-qemu plugin: Qemu path: /usr/bin/qemu-system-x86_64, Qemu Image path: /usr/bin/qemu-img
==> qemu: Retrieving ISO
2021/07/27 06:03:17 packer-builder-qemu plugin: Acquiring lock for: http://centos.excellmedia.net/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso?checksum=sha256%3A07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a (/root/packer/packer-centos7-kvm-example/packer_cache/e476ea1d3ef3c2e3966a7081ac4239cd5ae5e8a3.iso.lock)
==> qemu: Trying http://centos.excellmedia.net/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
==> qemu: Trying http://centos.excellmedia.net/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso?checksum=sha256%3A07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a
2021/07/27 06:03:20 packer-builder-qemu plugin: Leaving retrieve loop for ISO
2021/07/27 06:03:20 packer-builder-qemu plugin: No floppy files specified. Floppy disk will not be made.
2021/07/27 06:03:20 packer-builder-qemu plugin: No CD files specified. CD disk will not be made.
2021/07/27 06:03:20 packer-builder-qemu plugin: [INFO] Creating disk with Path: centos7-base-img/centos7-base and Size: 22528M
2021/07/27 06:03:20 packer-builder-qemu plugin: Executing qemu-img: string{“create”, “-f”, “qcow2”, “centos7-base-img/centos7-base”, “22528M”}
==> qemu: http://centos.excellmedia.net/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso?checksum=sha256%3A07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a => /root/packer/packer-centos7-kvm-example/packer_cache/e476ea1d3ef3c2e3966a7081ac4239cd5ae5e8a3.iso
2021/07/27 06:03:20 packer-builder-qemu plugin: stdout: Formatting ‘centos7-base-img/centos7-base’, fmt=qcow2 size=23622320128 cluster_size=65536 lazy_refcounts=off refcount_bits=16
2021/07/27 06:03:20 packer-builder-qemu plugin: stderr:
2021/07/27 06:03:20 packer-builder-qemu plugin: Found available port: 10087 on IP: 0.0.0.0
==> qemu: Starting HTTP server on port 10087
2021/07/27 06:03:20 packer-builder-qemu plugin: Looking for available communicator (SSH, WinRM, etc) port between 2222 and 4444
2021/07/27 06:03:20 packer-builder-qemu plugin: Found available port: 3909 on IP: 127.0.0.1
==> qemu: Found port for communicator (SSH, WinRM, etc): 3909.
2021/07/27 06:03:20 packer-builder-qemu plugin: Looking for available port between 5900 and 6000 on 127.0.0.1
==> qemu: Looking for available port between 5900 and 6000 on 127.0.0.1
2021/07/27 06:03:20 packer-builder-qemu plugin: Found available port: 5958 on IP: 127.0.0.1
2021/07/27 06:03:20 packer-builder-qemu plugin: Found available VNC port: 5958 on IP: 127.0.0.1
2021/07/27 06:03:20 packer-builder-qemu plugin: Qemu --version output: QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.17)
2021/07/27 06:03:20 packer-builder-qemu plugin: Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
2021/07/27 06:03:20 packer-builder-qemu plugin: Qemu version: 4.2.1
==> qemu: Starting VM, booting from CD-ROM
qemu: view the screen of the VM, connect via VNC without a password to
qemu: vnc://127.0.0.1:5958
2021/07/27 06:03:20 packer-builder-qemu plugin: Qemu Builder has no floppy files, not attaching a floppy.
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:5958
==> qemu: Overriding default Qemu arguments with qemuargs template option…
2021/07/27 06:03:20 packer-builder-qemu plugin: Executing /usr/bin/qemu-system-x86_64: string{"-netdev", “user,id=user.0,hostfwd=tcp::3909-:22”, “-boot”, “once=d”, “-name”, “centos7-base”, “-m”, “2048M”, “-smp”, “cpus=1,maxcpus=16,cores=4”, “-machine”, “type=pc,accel=kvm”, “-vnc”, “127.0.0.1:58”, “-device”, “virtio-net,netdev=user.0”, “-drive”, “file=centos7-base-img/centos7-base,if=virtio,cache=writeback,discard=ignore,format=qcow2”, “-drive”, “file=/root/packer/packer-centos7-kvm-example/packer_cache/e476ea1d3ef3c2e3966a7081ac4239cd5ae5e8a3.iso,media=cdrom”}
2021/07/27 06:03:20 packer-builder-qemu plugin: Started Qemu. Pid: 955484
2021/07/27 06:03:20 packer-builder-qemu plugin: Qemu stderr: qemu-system-x86_64: warning: host doesn’t support requested feature: CPUID.80000001H:ECX.svm [bit 2]
==> qemu: Waiting 40s for boot…
==> qemu: Connecting to VM via VNC (127.0.0.1:5958)
2021/07/27 06:04:02 packer-builder-qemu plugin: Connected to VNC desktop: QEMU (centos7-base)
==> qemu: Typing the boot command over VNC…
2021/07/27 06:04:02 packer-builder-qemu plugin: Sending char ‘i’, code 0x69, shift false
2021/07/27 06:04:02 packer-builder-qemu plugin: Sending char ‘n’, code 0x6E, shift false
2021/07/27 06:04:02 packer-builder-qemu plugin: Sending char ‘s’, code 0x73, shift false
2021/07/27 06:04:03 packer-builder-qemu plugin: Sending char ‘t’, code 0x74, shift false
2021/07/27 06:04:03 packer-builder-qemu plugin: Sending char ‘.’, code 0x2E, shift false
2021/07/27 06:04:03 packer-builder-qemu plugin: Sending char ‘t’, code 0x74, shift false
2021/07/27 06:04:03 packer-builder-qemu plugin: Sending char ‘e’, code 0x65, shift false
2021/07/27 06:04:03 packer-builder-qemu plugin: Sending char ‘x’, code 0x78, shift false
2021/07/27 06:04:04 packer-builder-qemu plugin: Sending char ‘t’, code 0x74, shift false
2021/07/27 06:04:04 packer-builder-qemu plugin: Sending char ’ ', code 0x20, shift false
2021/07/27 06:04:04 packer-builder-qemu plugin: Sending char ‘i’, code 0x69, shift false
2021/07/27 06:04:04 packer-builder-qemu plugin: Sending char ‘n’, code 0x6E, shift false
2021/07/27 06:04:04 packer-builder-qemu plugin: Sending char ‘s’, code 0x73, shift false
2021/07/27 06:04:05 packer-builder-qemu plugin: Sending char ‘t’, code 0x74, shift false
2021/07/27 06:04:05 packer-builder-qemu plugin: Sending char ‘.’, code 0x2E, shift false
2021/07/27 06:04:05 packer-builder-qemu plugin: Sending char ‘k’, code 0x6B, shift false
2021/07/27 06:04:05 packer-builder-qemu plugin: Sending char ‘s’, code 0x73, shift false
2021/07/27 06:04:05 packer-builder-qemu plugin: Sending char ‘=’, code 0x3D, shift false
2021/07/27 06:04:06 packer-builder-qemu plugin: Sending char ‘h’, code 0x68, shift false
2021/07/27 06:04:06 packer-builder-qemu plugin: Sending char ‘t’, code 0x74, shift false
2021/07/27 06:04:06 packer-builder-qemu plugin: Sending char ‘t’, code 0x74, shift false
2021/07/27 06:04:06 packer-builder-qemu plugin: Sending char ‘p’, code 0x70, shift false
2021/07/27 06:04:06 packer-builder-qemu plugin: Sending char ‘:’, code 0x3A, shift true
2021/07/27 06:04:07 packer-builder-qemu plugin: Sending char ‘/’, code 0x2F, shift false
2021/07/27 06:04:07 packer-builder-qemu plugin: Sending char ‘/’, code 0x2F, shift false
2021/07/27 06:04:07 packer-builder-qemu plugin: Sending char ‘1’, code 0x31, shift false
2021/07/27 06:04:07 packer-builder-qemu plugin: Sending char ‘0’, code 0x30, shift false
2021/07/27 06:04:08 packer-builder-qemu plugin: Sending char ‘.’, code 0x2E, shift false
2021/07/27 06:04:08 packer-builder-qemu plugin: Sending char ‘0’, code 0x30, shift false
2021/07/27 06:04:08 packer-builder-qemu plugin: Sending char ‘.’, code 0x2E, shift false
2021/07/27 06:04:08 packer-builder-qemu plugin: Sending char ‘2’, code 0x32, shift false
2021/07/27 06:04:08 packer-builder-qemu plugin: Sending char ‘.’, code 0x2E, shift false
2021/07/27 06:04:09 packer-builder-qemu plugin: Sending char ‘2’, code 0x32, shift false
2021/07/27 06:04:09 packer-builder-qemu plugin: Sending char ‘:’, code 0x3A, shift true
2021/07/27 06:04:09 packer-builder-qemu plugin: Sending char ‘1’, code 0x31, shift false
2021/07/27 06:04:09 packer-builder-qemu plugin: Sending char ‘0’, code 0x30, shift false
2021/07/27 06:04:10 packer-builder-qemu plugin: Sending char ‘0’, code 0x30, shift false
2021/07/27 06:04:10 packer-builder-qemu plugin: Sending char ‘8’, code 0x38, shift false
2021/07/27 06:04:10 packer-builder-qemu plugin: Sending char ‘7’, code 0x37, shift false
2021/07/27 06:04:10 packer-builder-qemu plugin: Sending char ‘/’, code 0x2F, shift false
2021/07/27 06:04:10 packer-builder-qemu plugin: Sending char ‘c’, code 0x63, shift false
2021/07/27 06:04:11 packer-builder-qemu plugin: Sending char ‘8’, code 0x38, shift false
2021/07/27 06:04:11 packer-builder-qemu plugin: Sending char ‘-’, code 0x2D, shift false
2021/07/27 06:04:11 packer-builder-qemu plugin: Sending char ‘k’, code 0x6B, shift false
2021/07/27 06:04:11 packer-builder-qemu plugin: Sending char ‘v’, code 0x76, shift false
2021/07/27 06:04:12 packer-builder-qemu plugin: Sending char ‘m’, code 0x6D, shift false
2021/07/27 06:04:12 packer-builder-qemu plugin: Sending char ‘-’, code 0x2D, shift false
2021/07/27 06:04:12 packer-builder-qemu plugin: Sending char ‘k’, code 0x6B, shift false
2021/07/27 06:04:12 packer-builder-qemu plugin: Sending char ‘s’, code 0x73, shift false
2021/07/27 06:04:12 packer-builder-qemu plugin: Sending char ‘.’, code 0x2E, shift false
2021/07/27 06:04:13 packer-builder-qemu plugin: Sending char ‘c’, code 0x63, shift false
2021/07/27 06:04:13 packer-builder-qemu plugin: Sending char ‘f’, code 0x66, shift false
2021/07/27 06:04:13 packer-builder-qemu plugin: Sending char ‘g’, code 0x67, shift false
qemu: Not using a NetBridge – skipping StepWaitGuestAddress
==> qemu: Using SSH communicator to connect: 127.0.0.1
2021/07/27 06:04:13 packer-builder-qemu plugin: [INFO] Waiting for SSH, up to timeout: 30m0s
==> qemu: Waiting for SSH to become available…
2021/07/27 06:04:13 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:04:13 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:04:13 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:05:13 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:05:20 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:05:20 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:05:20 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:06:20 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:06:27 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:06:27 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:06:27 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:07:27 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:07:34 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:07:34 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:07:34 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:08:34 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:08:41 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:08:41 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:08:41 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:09:41 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:09:48 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:09:48 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:09:48 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:10:48 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:10:55 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:10:55 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:10:55 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:11:55 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:12:02 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:12:02 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:12:02 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:13:02 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:13:09 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:13:09 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:13:09 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:14:09 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:14:16 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:14:16 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:14:16 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:15:16 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:15:23 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:15:23 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:15:23 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:16:23 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:16:30 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:16:30 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2021/07/27 06:16:30 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2021/07/27 06:17:30 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2021/07/27 06:17:37 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:3909…
2021/07/27 06:17:37 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH

After 30mins it gets timeed out without SSH into it. Where i’m going wrong?

1 Like

Have you figured this out?

No, tried out diff approaches but still unable to figure out the exact root cause. Could you please help me with this issue. This would be a really great help for me.

I’m interested in this, because I’m trying to build a vagrant package for the first time and I need to use Qemu as well.

So here’s my suggestions:

  1. Fix your code in your opening post for starters.
  2. Confirm if JSON is still standard and not .pkr.hcl, because according to my own research hcl is the new standard. There’s some hashicorp page saying this.

I’m not pretty much sure on how hcl language works, so i prefer using json. I used json for openstack builder and it worked fine for me, i’m not sure why i’m not able to make this work for qemu builder. There is some thing i’m missing out.
Can you give a working template that used have previously deal with i can give a try.

I can’t.
I have pretty much the same issue, but on top of that, the OS I use is Arch Linux.

Can you please fix your opening post and add ```
at the beginning and end of your three code blocks.
And if it’s a file * put the filename above it in italics *

my_code.json

{
    "test": "This allows you to paste code like this."
}

Or are you no longer able to edit your first post?

My suggestions:

centos7-base.json

...
"ssh_username": "vagrant",
"ssh_password": "vagrant",
...
"boot_command": [
 "<up><wait><tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/c8-kvm-ks.cfg<enter><wait>"
],
...

c8-kvm-ks.cfg

...
# Root password
rootpw --plaintext vagrant
...
%packages --nobase --ignoremissing --excludedocs --instLangs=en_US.utf8
# vagrant needs this to copy initial files via scp
openssh-clients
...
%end
...

Try it with user/password being vagrant first.
The boot command is just something I’ve seen in a bento template.

Thanks a lot, it worked for me after making all the changes that you have suggested. i think the openssh-clients we mentioned in kickstart file has helped us to get through the issue.