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

Qemu not launching VNC Viewer to connect to VM even with explicit setting 'headless = false' #144

Open
HariSekhon opened this issue Jun 11, 2023 · 2 comments
Labels

Comments

@HariSekhon
Copy link

HariSekhon commented Jun 11, 2023

Overview of the Issue

Qemu is not launching the user VNC Viewer automatically on my Macs.

The docs on this page for the headless setting implies that it should be launching the vncviewer unless headless = true:

https://developer.hashicorp.com/packer/plugins/builders/qemu

I've set headless = false explicitly in the packer config and it still doesn't start the user VNC Viewer.

RealVNC Viewer is installed to the standard location of /Applications/VNC Viewer.app/Contents/MacOS/vncviewer.

I've tried this on 2 different Macs, one Intel, one Arm, one installed from the RealVNC website and the other from brew - both install to the same place.

I also added /Applications/VNC Viewer.app/Contents/MacOS to the PATH in the shell in case the packer command wasn't finding it and even thought perhaps the space in the path may have been a problem so symlinked it to avoid the space

ln -s "/Applications/VNC Viewer.app" ~/bin/vncviewer

export PATH+=":$HOME/bin/vncviewer"

which -a 
/Users/hari/bin/vncviewer/Contents/MacOS/vncviewer

I can connect vncviewer manually, but when running packer a lot it's just very inconvenient - the plugin should be launching the GUI automatically.

Reproduction Steps

git clone https://github.com/HariSekhon/Packer-templates pack

cd pack

arch="$(uname -m)"

packer build ubuntu-$arch.qemu.pkr.hcl

I've reproduced this on both Intel and Arm Macs - I have a config for each in that repo

Plugin and Packer version

packer version
Packer v1.9.1

Simplified Packer Buildfile

https://github.com/HariSekhon/Packer-templates

ubuntu-x86_64.qemu.pkr.hcl

and

ubuntu-arm64.qemu.pkr.hcl

Operating system and Environment details

Intel Mac - macOS 11.7 Big Sur

Arm Mac M1 - macOS 13.4 Ventura

Log Fragments and crash.log files

packer build --force ubuntu-arm64.qemu.pkr.hcl
ubuntu.qemu.ubuntu: output will be in this color.

==> ubuntu.qemu.ubuntu: Retrieving ISO
==> ubuntu.qemu.ubuntu: Trying https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso
==> ubuntu.qemu.ubuntu: Trying https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso?checksum=sha256%3A12eed04214d8492d22686b72610711882ddf6222b4dc029c24515a85c4874e95
==> ubuntu.qemu.ubuntu: https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso?checksum=sha256%3A12eed04214d8492d22686b72610711882ddf6222b4dc029c24515a85c4874e95 => /Users/hari/.cache/packer/1bb131b162f10e50ac7d8671a71f4a0e13e36197.iso
==> ubuntu.qemu.ubuntu: Copying hard drive...
==> ubuntu.qemu.ubuntu: Resizing hard drive...
==> ubuntu.qemu.ubuntu: Starting HTTP server on port 8980
==> ubuntu.qemu.ubuntu: Found port for communicator (SSH, WinRM, etc): 3824.
==> ubuntu.qemu.ubuntu: Looking for available port between 5900 and 6000 on 127.0.0.1
==> ubuntu.qemu.ubuntu: Starting VM, booting disk image
==> ubuntu.qemu.ubuntu: Overriding default Qemu arguments with qemuargs template option...
==> ubuntu.qemu.ubuntu: Waiting 5s for boot...
==> ubuntu.qemu.ubuntu: Connecting to VM via VNC (127.0.0.1:5904)
==> ubuntu.qemu.ubuntu: Typing the boot commands over VNC...
    ubuntu.qemu.ubuntu: Not using a NetBridge -- skipping StepWaitGuestAddress
==> ubuntu.qemu.ubuntu: Using SSH communicator to connect: 127.0.0.1
==> ubuntu.qemu.ubuntu: Waiting for SSH to become available...

PACKER_LOG=1 for maximum log detail:

PACKER_LOG=1 packer build --force ubuntu-arm64.qemu.pkr.hcl
2023/06/11 03:59:50 [INFO] Packer version: 1.9.1 [go1.20.4 darwin arm64]
2023/06/11 03:59:50 [TRACE] discovering plugins in /opt/homebrew/Cellar/packer/1.9.1/libexec/bin
2023/06/11 03:59:50 [TRACE] discovering plugins in /Users/hari/.config/packer/plugins
2023/06/11 03:59:50 [DEBUG] Discovered plugin: tart = /Users/hari/.config/packer/plugins/github.com/cirruslabs/tart/packer-plugin-tart_v1.3.1_x5.0_darwin_arm64
2023/06/11 03:59:50 [DEBUG] Discovered plugin: virtualbox = /Users/hari/.config/packer/plugins/github.com/hashicorp/virtualbox/packer-plugin-virtualbox_v1.0.4_x5.0_darwin_arm64
2023/06/11 03:59:51 [INFO] found external [iso ovf vm] builders from virtualbox plugin
2023/06/11 03:59:51 [INFO] found external [cli] builders from tart plugin
2023/06/11 03:59:51 [TRACE] discovering plugins in .
2023/06/11 03:59:51 [TRACE] discovering plugins in
2023/06/11 03:59:51 [TRACE] discovering plugins in /opt/homebrew/bin
2023/06/11 03:59:51 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/11 03:59:51 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/hari/.packerconfig
2023/06/11 03:59:51 [WARN] Config file doesn't exist: /Users/hari/.packerconfig
2023/06/11 03:59:51 [INFO] Setting cache directory: /Users/hari/.cache/packer
2023/06/11 03:59:51 [TRACE] validateValue: not active for version, so skipping
2023/06/11 03:59:51 [TRACE] validateValue: not active for iso, so skipping
2023/06/11 03:59:51 [TRACE] validateValue: not active for checksum, so skipping
2023/06/11 03:59:51 [TRACE] Starting internal plugin packer-builder-qemu
2023/06/11 03:59:51 Starting plugin: /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer []string{"/opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer", "plugin", "packer-builder-qemu"}
2023/06/11 03:59:51 Waiting for RPC address for: /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer
2023/06/11 03:59:51 packer-builder-qemu plugin: [INFO] Packer version: 1.9.1 [go1.20.4 darwin arm64]
2023/06/11 03:59:51 packer-builder-qemu plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/11 03:59:51 packer-builder-qemu plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/hari/.packerconfig
2023/06/11 03:59:51 packer-builder-qemu plugin: [WARN] Config file doesn't exist: /Users/hari/.packerconfig
2023/06/11 03:59:51 packer-builder-qemu plugin: [INFO] Setting cache directory: /Users/hari/.cache/packer
2023/06/11 03:59:51 packer-builder-qemu plugin: args: []string{"packer-builder-qemu"}
2023/06/11 03:59:51 packer-builder-qemu plugin: Plugin address: unix /var/folders/18/zv7bm4b55cj500q22s15lygh0000gn/T/packer-plugin1440191271
2023/06/11 03:59:51 packer-builder-qemu plugin: Waiting for connection...
2023/06/11 03:59:51 Received unix RPC address for /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer: addr is /var/folders/18/zv7bm4b55cj500q22s15lygh0000gn/T/packer-plugin1440191271
2023/06/11 03:59:51 packer-builder-qemu plugin: Serving a plugin connection...
2023/06/11 03:59:51 packer-builder-qemu plugin: use detected accelerator: tcg
2023/06/11 03:59:51 [TRACE] Starting internal plugin packer-provisioner-file
2023/06/11 03:59:51 Starting plugin: /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer []string{"/opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer", "plugin", "packer-provisioner-file"}
2023/06/11 03:59:51 Waiting for RPC address for: /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer
2023/06/11 03:59:51 packer-provisioner-file plugin: [INFO] Packer version: 1.9.1 [go1.20.4 darwin arm64]
2023/06/11 03:59:51 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/11 03:59:51 packer-provisioner-file plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/hari/.packerconfig
2023/06/11 03:59:51 packer-provisioner-file plugin: [WARN] Config file doesn't exist: /Users/hari/.packerconfig
2023/06/11 03:59:51 packer-provisioner-file plugin: [INFO] Setting cache directory: /Users/hari/.cache/packer
2023/06/11 03:59:51 packer-provisioner-file plugin: args: []string{"packer-provisioner-file"}
2023/06/11 03:59:51 packer-provisioner-file plugin: Plugin address: unix /var/folders/18/zv7bm4b55cj500q22s15lygh0000gn/T/packer-plugin1899239085
2023/06/11 03:59:51 Received unix RPC address for /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer: addr is /var/folders/18/zv7bm4b55cj500q22s15lygh0000gn/T/packer-plugin1899239085
2023/06/11 03:59:51 packer-provisioner-file plugin: Waiting for connection...
2023/06/11 03:59:51 packer-provisioner-file plugin: Serving a plugin connection...
2023/06/11 03:59:51 [TRACE] Starting internal plugin packer-provisioner-shell
2023/06/11 03:59:51 Starting plugin: /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer []string{"/opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer", "plugin", "packer-provisioner-shell"}
2023/06/11 03:59:51 Waiting for RPC address for: /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer
2023/06/11 03:59:51 packer-provisioner-shell plugin: [INFO] Packer version: 1.9.1 [go1.20.4 darwin arm64]
2023/06/11 03:59:51 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/11 03:59:51 packer-provisioner-shell plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/hari/.packerconfig
2023/06/11 03:59:51 packer-provisioner-shell plugin: [WARN] Config file doesn't exist: /Users/hari/.packerconfig
2023/06/11 03:59:51 packer-provisioner-shell plugin: [INFO] Setting cache directory: /Users/hari/.cache/packer
2023/06/11 03:59:51 packer-provisioner-shell plugin: args: []string{"packer-provisioner-shell"}
2023/06/11 03:59:51 packer-provisioner-shell plugin: Plugin address: unix /var/folders/18/zv7bm4b55cj500q22s15lygh0000gn/T/packer-plugin2802359150
2023/06/11 03:59:51 packer-provisioner-shell plugin: Waiting for connection...
2023/06/11 03:59:51 Received unix RPC address for /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer: addr is /var/folders/18/zv7bm4b55cj500q22s15lygh0000gn/T/packer-plugin2802359150
2023/06/11 03:59:51 packer-provisioner-shell plugin: Serving a plugin connection...
2023/06/11 03:59:51 [TRACE] Starting internal plugin packer-post-processor-checksum
2023/06/11 03:59:51 Starting plugin: /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer []string{"/opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer", "plugin", "packer-post-processor-checksum"}
2023/06/11 03:59:51 Waiting for RPC address for: /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer
2023/06/11 03:59:51 packer-post-processor-checksum plugin: [INFO] Packer version: 1.9.1 [go1.20.4 darwin arm64]
2023/06/11 03:59:51 packer-post-processor-checksum plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/06/11 03:59:51 packer-post-processor-checksum plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/hari/.packerconfig
2023/06/11 03:59:51 packer-post-processor-checksum plugin: [WARN] Config file doesn't exist: /Users/hari/.packerconfig
2023/06/11 03:59:51 packer-post-processor-checksum plugin: [INFO] Setting cache directory: /Users/hari/.cache/packer
2023/06/11 03:59:51 packer-post-processor-checksum plugin: args: []string{"packer-post-processor-checksum"}
2023/06/11 03:59:51 Received unix RPC address for /opt/homebrew/Cellar/packer/1.9.1/libexec/bin/packer: addr is /var/folders/18/zv7bm4b55cj500q22s15lygh0000gn/T/packer-plugin2061801742
2023/06/11 03:59:51 packer-post-processor-checksum plugin: Plugin address: unix /var/folders/18/zv7bm4b55cj500q22s15lygh0000gn/T/packer-plugin2061801742
2023/06/11 03:59:51 packer-post-processor-checksum plugin: Waiting for connection...
2023/06/11 03:59:51 packer-post-processor-checksum plugin: Serving a plugin connection...
2023/06/11 03:59:51 Build debug mode: false
2023/06/11 03:59:51 Force build: true
2023/06/11 03:59:51 On error:
2023/06/11 03:59:51 Waiting on builds to complete...
ubuntu.qemu.ubuntu: output will be in this color.

2023/06/11 03:59:51 Starting build run: ubuntu.qemu.ubuntu
2023/06/11 03:59:51 Running builder:
2023/06/11 03:59:51 [INFO] (telemetry) Starting builder qemu.ubuntu
2023/06/11 03:59:51 packer-builder-qemu plugin: Qemu path: /opt/homebrew/bin/qemu-system-aarch64, Qemu Image path: /opt/homebrew/bin/qemu-img
==> ubuntu.qemu.ubuntu: Retrieving ISO
==> ubuntu.qemu.ubuntu: Trying https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso
2023/06/11 03:59:51 packer-builder-qemu plugin: Acquiring lock for: https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso?checksum=sha256%3A12eed04214d8492d22686b72610711882ddf6222b4dc029c24515a85c4874e95 (/Users/hari/.cache/packer/1bb131b162f10e50ac7d8671a71f4a0e13e36197.iso.lock)
==> ubuntu.qemu.ubuntu: Trying https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso?checksum=sha256%3A12eed04214d8492d22686b72610711882ddf6222b4dc029c24515a85c4874e95
2023/06/11 03:59:52 packer-builder-qemu plugin: Leaving retrieve loop for ISO
==> ubuntu.qemu.ubuntu: https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso?checksum=sha256%3A12eed04214d8492d22686b72610711882ddf6222b4dc029c24515a85c4874e95 => /Users/hari/.cache/packer/1bb131b162f10e50ac7d8671a71f4a0e13e36197.iso
2023/06/11 03:59:52 packer-builder-qemu plugin: No floppy files specified. Floppy disk will not be made.
2023/06/11 03:59:52 packer-builder-qemu plugin: No CD files specified. CD disk will not be made.
==> ubuntu.qemu.ubuntu: Copying hard drive...
2023/06/11 03:59:52 packer-builder-qemu plugin: Executing qemu-img: []string{"convert", "-O", "qcow2", "/Users/hari/.cache/packer/1bb131b162f10e50ac7d8671a71f4a0e13e36197.iso", "output-ubuntu-22.04-arm64/ubuntu-22.04"}
2023/06/11 03:59:52 packer-builder-qemu plugin: stdout:
2023/06/11 03:59:52 packer-builder-qemu plugin: stderr:
==> ubuntu.qemu.ubuntu: Resizing hard drive...
2023/06/11 03:59:52 packer-builder-qemu plugin: Executing qemu-img: []string{"resize", "-f", "qcow2", "output-ubuntu-22.04-arm64/ubuntu-22.04", "40960M"}
2023/06/11 03:59:52 packer-builder-qemu plugin: stdout: Image resized.
2023/06/11 03:59:52 packer-builder-qemu plugin: stderr:
2023/06/11 03:59:52 packer-builder-qemu plugin: Found available port: 8348 on IP: 0.0.0.0
==> ubuntu.qemu.ubuntu: Starting HTTP server on port 8348
2023/06/11 03:59:52 packer-builder-qemu plugin: Looking for available communicator (SSH, WinRM, etc) port between 2222 and 4444
2023/06/11 03:59:52 packer-builder-qemu plugin: Found available port: 4020 on IP: 127.0.0.1
==> ubuntu.qemu.ubuntu: Found port for communicator (SSH, WinRM, etc): 4020.
2023/06/11 03:59:52 packer-builder-qemu plugin: Looking for available port between 5900 and 6000 on 127.0.0.1
==> ubuntu.qemu.ubuntu: Looking for available port between 5900 and 6000 on 127.0.0.1
2023/06/11 03:59:52 packer-builder-qemu plugin: Found available port: 5986 on IP: 127.0.0.1
2023/06/11 03:59:52 packer-builder-qemu plugin: Found available VNC port: 5986 on IP: 127.0.0.1
2023/06/11 03:59:52 packer-builder-qemu plugin: Qemu --version output: QEMU emulator version 8.0.2
2023/06/11 03:59:52 packer-builder-qemu plugin: Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
2023/06/11 03:59:52 packer-builder-qemu plugin: Qemu version: 8.0.2
==> ubuntu.qemu.ubuntu: Starting VM, booting disk image
2023/06/11 03:59:52 packer-builder-qemu plugin: Qemu Builder has no floppy files, not attaching a floppy.
==> ubuntu.qemu.ubuntu: Overriding default Qemu arguments with qemuargs template option...
2023/06/11 03:59:52 packer-builder-qemu plugin: Executing /opt/homebrew/bin/qemu-system-aarch64: []string{"-smbios", "type=1,serial=ds=nocloud-net;instance-id=packer;seedfrom=http://10.0.2.2:8348/", "-name", "ubuntu-22.04", "-machine", "type=virt,accel=tcg", "-vnc", "127.0.0.1:86", "-netdev", "user,id=user.0,hostfwd=tcp::4020-:22", "-smp", "3", "-drive", "file=output-ubuntu-22.04-arm64/ubuntu-22.04,if=virtio,cache=writeback,discard=unmap,format=qcow2", "-boot", "c", "-m", "3072M", "-device", "virtio-net,netdev=user.0"}
2023/06/11 03:59:52 packer-builder-qemu plugin: Started Qemu. Pid: 91209
==> ubuntu.qemu.ubuntu: Waiting 5s for boot...
==> ubuntu.qemu.ubuntu: Connecting to VM via VNC (127.0.0.1:5986)
2023/06/11 03:59:59 packer-builder-qemu plugin: Connected to VNC desktop: QEMU (ubuntu-22.04)
==> ubuntu.qemu.ubuntu: Typing the boot commands over VNC...
2023/06/11 03:59:59 packer-builder-qemu plugin: Sending char 'c', code 0x63, shift false
2023/06/11 03:59:59 packer-builder-qemu plugin: [INFO] Waiting 1s
2023/06/11 04:00:00 packer-builder-qemu plugin: Sending char 'l', code 0x6C, shift false
2023/06/11 04:00:01 packer-builder-qemu plugin: Sending char 'i', code 0x69, shift false
2023/06/11 04:00:01 packer-builder-qemu plugin: Sending char 'n', code 0x6E, shift false
2023/06/11 04:00:01 packer-builder-qemu plugin: Sending char 'u', code 0x75, shift false
2023/06/11 04:00:01 packer-builder-qemu plugin: Sending char 'x', code 0x78, shift false
2023/06/11 04:00:01 packer-builder-qemu plugin: Sending char ' ', code 0x20, shift false
2023/06/11 04:00:02 packer-builder-qemu plugin: Sending char '/', code 0x2F, shift false
2023/06/11 04:00:02 packer-builder-qemu plugin: Sending char 'c', code 0x63, shift false
2023/06/11 04:00:02 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2023/06/11 04:00:02 packer-builder-qemu plugin: Sending char 's', code 0x73, shift false
2023/06/11 04:00:02 packer-builder-qemu plugin: Sending char 'p', code 0x70, shift false
2023/06/11 04:00:03 packer-builder-qemu plugin: Sending char 'e', code 0x65, shift false
2023/06/11 04:00:03 packer-builder-qemu plugin: Sending char 'r', code 0x72, shift false
2023/06/11 04:00:03 packer-builder-qemu plugin: Sending char '/', code 0x2F, shift false
2023/06/11 04:00:03 packer-builder-qemu plugin: Sending char 'v', code 0x76, shift false
    ubuntu.qemu.ubuntu: Not using a NetBridge -- skipping StepWaitGuestAddress
2023/06/11 04:00:03 packer-builder-qemu plugin: Sending char 'm', code 0x6D, shift false
==> ubuntu.qemu.ubuntu: Using SSH communicator to connect: 127.0.0.1
==> ubuntu.qemu.ubuntu: Waiting for SSH to become available...
2023/06/11 04:00:04 packer-builder-qemu plugin: Sending char 'l', code 0x6C, shift false
2023/06/11 04:00:04 packer-builder-qemu plugin: Sending char 'i', code 0x69, shift false
2023/06/11 04:00:04 packer-builder-qemu plugin: Sending char 'n', code 0x6E, shift false
2023/06/11 04:00:04 packer-builder-qemu plugin: Sending char 'u', code 0x75, shift false
2023/06/11 04:00:04 packer-builder-qemu plugin: Sending char 'z', code 0x7A, shift false
2023/06/11 04:00:05 packer-builder-qemu plugin: Sending char ' ', code 0x20, shift false
2023/06/11 04:00:05 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2023/06/11 04:00:05 packer-builder-qemu plugin: Sending char 'u', code 0x75, shift false
2023/06/11 04:00:05 packer-builder-qemu plugin: Sending char 't', code 0x74, shift false
2023/06/11 04:00:05 packer-builder-qemu plugin: Sending char 'o', code 0x6F, shift false
2023/06/11 04:00:06 packer-builder-qemu plugin: Sending char 'i', code 0x69, shift false
2023/06/11 04:00:06 packer-builder-qemu plugin: Sending char 'n', code 0x6E, shift false
2023/06/11 04:00:06 packer-builder-qemu plugin: Sending char 's', code 0x73, shift false
2023/06/11 04:00:06 packer-builder-qemu plugin: Sending char 't', code 0x74, shift false
2023/06/11 04:00:06 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2023/06/11 04:00:07 packer-builder-qemu plugin: Sending char 'l', code 0x6C, shift false
2023/06/11 04:00:07 packer-builder-qemu plugin: Sending char 'l', code 0x6C, shift false
2023/06/11 04:00:07 packer-builder-qemu plugin: Sending char ' ', code 0x20, shift false
2023/06/11 04:00:07 packer-builder-qemu plugin: Sending char ''', code 0x27, shift false
2023/06/11 04:00:07 packer-builder-qemu plugin: Sending char 'd', code 0x64, shift false
2023/06/11 04:00:08 packer-builder-qemu plugin: Sending char 's', code 0x73, shift false
2023/06/11 04:00:08 packer-builder-qemu plugin: Sending char '=', code 0x3D, shift false
2023/06/11 04:00:08 packer-builder-qemu plugin: Sending char 'n', code 0x6E, shift false
2023/06/11 04:00:08 packer-builder-qemu plugin: Sending char 'o', code 0x6F, shift false
2023/06/11 04:00:08 packer-builder-qemu plugin: Sending char 'c', code 0x63, shift false
2023/06/11 04:00:09 packer-builder-qemu plugin: Sending char 'l', code 0x6C, shift false
2023/06/11 04:00:09 packer-builder-qemu plugin: Sending char 'o', code 0x6F, shift false
2023/06/11 04:00:09 packer-builder-qemu plugin: Sending char 'u', code 0x75, shift false
2023/06/11 04:00:09 packer-builder-qemu plugin: Sending char 'd', code 0x64, shift false
2023/06/11 04:00:09 packer-builder-qemu plugin: Sending char '-', code 0x2D, shift false
2023/06/11 04:00:10 packer-builder-qemu plugin: Sending char 'n', code 0x6E, shift false
2023/06/11 04:00:10 packer-builder-qemu plugin: Sending char 'e', code 0x65, shift false
2023/06/11 04:00:10 packer-builder-qemu plugin: Sending char 't', code 0x74, shift false
2023/06/11 04:00:10 packer-builder-qemu plugin: Sending char ';', code 0x3B, shift false
2023/06/11 04:00:10 packer-builder-qemu plugin: Sending char 's', code 0x73, shift false
2023/06/11 04:00:11 packer-builder-qemu plugin: Sending char '=', code 0x3D, shift false
2023/06/11 04:00:11 packer-builder-qemu plugin: Sending char 'h', code 0x68, shift false
2023/06/11 04:00:11 packer-builder-qemu plugin: Sending char 't', code 0x74, shift false
2023/06/11 04:00:11 packer-builder-qemu plugin: Sending char 't', code 0x74, shift false
2023/06/11 04:00:11 packer-builder-qemu plugin: Sending char 'p', code 0x70, shift false
2023/06/11 04:00:12 packer-builder-qemu plugin: Sending char ':', code 0x3A, shift true
2023/06/11 04:00:12 packer-builder-qemu plugin: Sending char '/', code 0x2F, shift false
2023/06/11 04:00:12 packer-builder-qemu plugin: Sending char '/', code 0x2F, shift false
2023/06/11 04:00:12 packer-builder-qemu plugin: Sending char '1', code 0x31, shift false
2023/06/11 04:00:13 packer-builder-qemu plugin: Sending char '0', code 0x30, shift false
2023/06/11 04:00:13 packer-builder-qemu plugin: Sending char '.', code 0x2E, shift false
2023/06/11 04:00:13 packer-builder-qemu plugin: Sending char '0', code 0x30, shift false
2023/06/11 04:00:13 packer-builder-qemu plugin: Sending char '.', code 0x2E, shift false
2023/06/11 04:00:14 packer-builder-qemu plugin: Sending char '2', code 0x32, shift false
2023/06/11 04:00:14 packer-builder-qemu plugin: Sending char '.', code 0x2E, shift false
2023/06/11 04:00:14 packer-builder-qemu plugin: Sending char '2', code 0x32, shift false
2023/06/11 04:00:14 packer-builder-qemu plugin: Sending char ':', code 0x3A, shift true
2023/06/11 04:00:15 packer-builder-qemu plugin: Sending char '8', code 0x38, shift false
2023/06/11 04:00:15 packer-builder-qemu plugin: Sending char '3', code 0x33, shift false
2023/06/11 04:00:15 packer-builder-qemu plugin: Sending char '4', code 0x34, shift false
2023/06/11 04:00:15 packer-builder-qemu plugin: Sending char '8', code 0x38, shift false
2023/06/11 04:00:15 packer-builder-qemu plugin: Sending char '/', code 0x2F, shift false
2023/06/11 04:00:16 packer-builder-qemu plugin: Sending char ''', code 0x27, shift false
2023/06/11 04:00:16 packer-builder-qemu plugin: Sending char ' ', code 0x20, shift false
2023/06/11 04:00:16 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2023/06/11 04:00:16 packer-builder-qemu plugin: [INFO] Waiting 1s
2023/06/11 04:00:17 packer-builder-qemu plugin: Sending char 'i', code 0x69, shift false
2023/06/11 04:00:17 packer-builder-qemu plugin: Sending char 'n', code 0x6E, shift false
2023/06/11 04:00:18 packer-builder-qemu plugin: Sending char 'i', code 0x69, shift false
2023/06/11 04:00:18 packer-builder-qemu plugin: Sending char 't', code 0x74, shift false
2023/06/11 04:00:18 packer-builder-qemu plugin: Sending char 'r', code 0x72, shift false
2023/06/11 04:00:18 packer-builder-qemu plugin: Sending char 'd', code 0x64, shift false
2023/06/11 04:00:18 packer-builder-qemu plugin: Sending char ' ', code 0x20, shift false
2023/06/11 04:00:19 packer-builder-qemu plugin: Sending char '/', code 0x2F, shift false
2023/06/11 04:00:19 packer-builder-qemu plugin: Sending char 'c', code 0x63, shift false
2023/06/11 04:00:19 packer-builder-qemu plugin: Sending char 'a', code 0x61, shift false
2023/06/11 04:00:19 packer-builder-qemu plugin: Sending char 's', code 0x73, shift false
2023/06/11 04:00:19 packer-builder-qemu plugin: Sending char 'p', code 0x70, shift false
2023/06/11 04:00:20 packer-builder-qemu plugin: Sending char 'e', code 0x65, shift false
2023/06/11 04:00:20 packer-builder-qemu plugin: Sending char 'r', code 0x72, shift false
2023/06/11 04:00:20 packer-builder-qemu plugin: Sending char '/', code 0x2F, shift false
2023/06/11 04:00:20 packer-builder-qemu plugin: Sending char 'i', code 0x69, shift false
2023/06/11 04:00:20 packer-builder-qemu plugin: Sending char 'n', code 0x6E, shift false
2023/06/11 04:00:21 packer-builder-qemu plugin: Sending char 'i', code 0x69, shift false
2023/06/11 04:00:21 packer-builder-qemu plugin: Sending char 't', code 0x74, shift false
2023/06/11 04:00:21 packer-builder-qemu plugin: Sending char 'r', code 0x72, shift false
2023/06/11 04:00:21 packer-builder-qemu plugin: Sending char 'd', code 0x64, shift false
2023/06/11 04:00:21 packer-builder-qemu plugin: Sending char ' ', code 0x20, shift false
2023/06/11 04:00:22 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2023/06/11 04:00:22 packer-builder-qemu plugin: [INFO] Waiting 1s
2023/06/11 04:00:23 packer-builder-qemu plugin: Sending char 'b', code 0x62, shift false
2023/06/11 04:00:23 packer-builder-qemu plugin: Sending char 'o', code 0x6F, shift false
2023/06/11 04:00:23 packer-builder-qemu plugin: Sending char 'o', code 0x6F, shift false
2023/06/11 04:00:23 packer-builder-qemu plugin: Sending char 't', code 0x74, shift false
2023/06/11 04:00:24 packer-builder-qemu plugin: Sending char ' ', code 0x20, shift false
2023/06/11 04:00:24 packer-builder-qemu plugin: Special code '<enter>' found, replacing with: 0xFF0D
2023/06/11 04:00:24 packer-builder-qemu plugin: [INFO] Waiting for SSH, up to timeout: 30m0s
2023/06/11 04:00:24 packer-builder-qemu plugin: [INFO] Attempting SSH connection to 127.0.0.1:4020...
2023/06/11 04:00:24 packer-builder-qemu plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/11 04:00:24 packer-builder-qemu plugin: [DEBUG] handshaking with SSH
2023/06/11 04:01:24 packer-builder-qemu plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
@timharris777
Copy link

The same thing is happening for me. I have to manually look at the logs and then manually connect via vnc to the given local port. Trying to figure out why it's not opening the window automatically

@timharris777
Copy link

I figured out what is going on... For some reason on mac when you run qemu with the -vnc option it will not show the normal display unless you add -Display cocoa. I verified that this works with packer by adding the following:

qemuargs = [
    ["-display", "cocoa"],
]

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

2 participants