Host: RHEL 6.7
packer version : 2016/01/10 01:20:58 [INFO] Packer version: 0.8.6 f8f7b7a34c1be06058f5aca23a51247db12cdbc5+CHANGE
qemu binary path : /usr/libexec/qemu-kvm
2016/01/10 01:21:07 packer-builder-qemu: 2016/01/10 01:21:07 Executing /usr/libexec/qemu-kvm: []string{"-device", "virtio-net,netdev=mynet0", "-boot", "once=d", "-name", "packer-qemu", "-vnc", "0.0.0.0:47", "-display", "sdl", "-m", "1024M", "--no-acpi", "-drive", "file=output-qemu/packer-qemu,if=virtio,cache=writeback,discard=ignore", "-cdrom", "/home/shamim/Desktop/DEVOPS/packer-templates/rhel-5.10/RHEL5.10-Server-20130910.0-x86_64-DVD.iso", "-netdev", "user,id=mynet0,hostfwd=hostip:hostport-guestip:guestport", "-machine", "type=pc,accel=kvm"}
2016/01/10 01:21:07 packer-builder-qemu: 2016/01/10 01:21:07 Started Qemu. Pid: 32406
2016/01/10 01:21:07 packer-builder-qemu: 2016/01/10 01:21:07 Qemu stderr: qemu-kvm: -display: invalid option
2016/01/10 01:21:07 ui error: ==> qemu: Error launching VM: Qemu failed to start. Please run with logs to get more info.
==> qemu: Error launching VM: Qemu failed to start. Please run with logs to get more info.
2016/01/10 01:21:07 ui: ==> qemu: Deleting output directory...
==> qemu: Deleting output directory...
2016/01/10 01:21:07 ui error: Build 'qemu' errored: Build was halted.
2016/01/10 01:21:07 Builds completed. Waiting on interrupt barrier..
What's your qemu version?
[[email protected]]$ /usr/libexec/qemu-kvm --version
QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2-2.479.el6_7.1), Copyright (c) 2003-2008 Fabrice Bellard
[shamim@oc4683017473 rhel-5.10]$
qemu-system-x86_64 --version
Why do you use qemu-kvm
?
This is company's laptop and already installed this version of qemu. and i dont see the qemu-system-x86_64 executable in my system.
@rickard-von-essen : Do you think this is a bug or is there any mistake from my side?
@vtolstov any insights? Does this work with qemu-kvm
v 0.12 ?
Try to use packer from master, as i know, some of my pr accepted but does not get to release. packer debug log or log must contain : Qemu version xxx,
in this case packer detect qemu version properly and can use needed qemu args.
But as i see, this is older packer version.
I'm seeing something similar on OS X and Qemu 2.5.0 from Homebrew:
2016/01/21 23:37:08 packer-builder-qemu: 2016/01/21 23:37:08 Started Qemu. Pid: 1633
2016/01/21 23:37:08 packer-builder-qemu: 2016/01/21 23:37:08 Qemu stderr: qemu-system-x86_64: -display sdl: SDL support is disabled
In the same time this works just fine and displays console:
qemu-system-x86_64 trusty-server-cloudimg-amd64-disk1.img
@altvnk I think that's a different issue. Try:
brew uninstall qemu
brew install qemu --with-sdl
@shamimgeek Where you able to try this with packer built from master?
The qemu stuff works perfectly for me on Debian Jessie x86_64 with the "stock" qemu/kvm 2.1.2. However, I never really got qemu stuff working on Mac before so, today, I installed it with brew on Mac OS X El Capitan 10.11.3 using the --with-sdl
option as suggested by @cbednarski (this ticket helped me past the "-display sdl" problem; I also have the 2.5.0 version of qemu on OS X).
I'm currently testing with Packer v0.9.0.rc2 (1c61c06ff8a3ead60db2851a6a6114a1fdfed21b)
and https://github.com/tylert/packer-build/blob/36d799a546386ac2b1d95d90a6720a6ae7d2503b/debian/jessie/base-jessie64.json
It seems to get hung up on something else for me on Mac OS X (NOTE: As stated previously, this template builds fine with stock qemu on jessie)...
2016/02/18 12:11:20 ui: ==> qemu: Overriding defaults Qemu arguments with QemuArgs...
==> qemu: Overriding defaults Qemu arguments with QemuArgs...
2016/02/18 12:11:20 packer: 2016/02/18 12:11:20 Executing /usr/local/bin/qemu-system-x86_64: []string{"-machine", "type=pc,accel=kvm", "-netdev", "user,id=user.0,hostfwd=tcp::2558-:22", "-device", "virtio-net,netdev=user.0", "-drive", "file=build/2016-02-18-17-11/base-jessie64,if=scsi,cache=writeback,discard=ignore", "-m", "512M", "-cdrom", "/Users/zero/packer_cache/debian-8.3.0-amd64-i386-netinst.iso", "-boot", "once=d", "-name", "base-jessie64", "-smp", "1", "-vnc", "0.0.0.0:71", "-display", "sdl"}
2016/02/18 12:11:20 packer: 2016/02/18 12:11:20 Started Qemu. Pid: 10250
2016/02/18 12:11:20 packer: 2016/02/18 12:11:20 Qemu stderr: "kvm" accelerator not found.
2016/02/18 12:11:20 packer: 2016/02/18 12:11:20 Qemu stderr: No accelerator found!
2016/02/18 12:11:20 ui error: ==> qemu: Error launching VM: Qemu failed to start. Please run with logs to get more info.
==> qemu: Error launching VM: Qemu failed to start. Please run with logs to get more info.
==> qemu: Deleting output directory...
2016/02/18 12:11:20 ui: ==> qemu: Deleting output directory...
2016/02/18 12:11:20 ui error: Build 'qemu' errored: Build was halted.
2016/02/18 12:11:20 Builds completed. Waiting on interrupt barrier...
2016/02/18 12:11:20 machine readable: error-count []string{"1"}
2016/02/18 12:11:20 ui error:
==> Some builds didn't complete successfully and had errors:
2016/02/18 12:11:20 machine readable: qemu,error []string{"Build was halted."}
2016/02/18 12:11:20 ui error: --> qemu: Build was halted.
2016/02/18 12:11:20 ui:
==> Builds finished but no artifacts were created.
2016/02/18 12:11:20 waiting for all plugin processes to complete...
Build 'qemu' errored: Build was halted.
==> Some builds didn't complete successfully and had errors:
--> qemu: Build was halted.
==> Builds finished but no artifacts were created.
2016/02/18 12:11:21 /Users/zero/bin/packer: plugin process exited
2016/02/18 12:11:21 /Users/zero/bin/packer: plugin process exited
2016/02/18 12:11:21 /Users/zero/bin/packer: plugin process exited
2016/02/18 12:11:21 /Users/zero/bin/packer: plugin process exited
2016/02/18 12:11:21 /Users/zero/bin/packer: plugin process exited
please, enable packer debug log and attach it
@vtolstov https://gist.github.com/tylert/3c9a3c941772c7b057d341015676d3bc (<-- Packer 0.10.0 on OSX 10.11.3)
Even after installing with brew uninstall qemu ; brew install qemu --with-sdl
(as suggested by @cbednarski), it is still erroring out on OSX. It would seem that Qemu stderr: "kvm" accelerator not found.
is the primary reason for the failure on OSX. This issue may no longer be exactly the same as the original issue (the OP was using RHEL).
However, the Packer QEMU builder works _perfectly_ for me on Debian 8.x amd64.
Thanks again.
@tylert KVM is a linux kernel feature and is not supported on OS X or Windows. You will need to change accelerator
to none
on non-Linux systems.
Since the original poster has not responded in awhile I'm going to close this. @shamimgeek if you are still having a problem with the latest packer, please feel free to re-open with the debug output requested above. I suspect this is an issue with how QEMU is installed on your computer and not an issue with packer specifically.
Thanks to the rest of you folks for providing feedback and helping out here!
Run into the same issue on OS X. qemu wasn't installed with SDL support. Doing:
brew uninstall qemu sdl
brew install qemu --with-sdl
Fixed it.
As on Feb 2018, it is recommended to use
brew install qemu --with-sdl2
April 2019 and brew install qemu --with-sdl
and brew install qemu --with-sdl2
both fail with a brew error: Error: invalid option: --with-sdl
Looks like homebrew no longer maintains the -with-sdl option.
Is there any alternative for the same?
Why not use vnc ?
Annoyingly, VNC isn't working for me. I don't know if it is my setup or there's something I'm missing, but I've tried VNC. It opens the port, I can see it, but it won't connect.
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
As on Feb 2018, it is recommended to use