Open HariSekhon opened 1 year ago
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
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"],
]
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 unlessheadless = 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 thePATH
in the shell in case thepacker
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 spaceI 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
I've reproduced this on both Intel and Arm Macs - I have a config for each in that repo
Plugin and Packer version
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_LOG=1
for maximum log detail: