* BUG *
Build 'qemu' errored: Failed creating Qemu driver: exec: "qemu-system-x86_64": executable file not found in $PATH
^^ The reason this is a bug is because its not documented where or why "qemu-system-86_64" is needed, and also, it appears to be on my path (from any dir, i can auto-complete "qemu-system-x86_64").
** REPRODUCING THE ERROR **
./packer:> $HOME/Development/packer/packer build ex1
* (failed) ATTEMPTS TO FIX *
1) Added the qemu symlink into the $PATH:
/h~/j~/D~./packer:> echo $PATH | grep qem
/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/jvyas/bin:/home/jvyas/Development/apache-maven-3.0.4/bin:/home/jvyas/bin:/home/jvyas/Development/apache-maven-3.0.4/bin:/home/jvyas/Development/packer:/usr/libexec/qemu-system-x86:qemu-system-x86_64
2) I've tried adding a symlink in the startup dir:
/h~/j~/D~./packer:> ls | grep qem
packer-builder-qemu
qemu-system-x86
** CONCLUSION **
Thus, I assume packer is looking for the wrong thing somehow, when provisioning QEMU boxes. Any thoughts would be much appreciated.
Looking deeper, the error happens when "exec.LookPath" is called with "qemu-system-x86_64" as the argument.
Well, now looking further, the "exec.LookPath" doesnt read symlinks.
/usr/libexec:> mv qemu-kvm qemu-system-x86_64
Is a workaround. (not sure if its the right workaround, but at least it got me past this error message :))
CONFIRMED. The fix is to hard copy "qemu-kvm" to "qemu-system-x86_64" , in /usr/libexec, and add /usr/libexec to your PATH. At that point, everything should work normaly (note that i had to run as root also to get it working, and so added to PATH in root's .bash_profile.
Anyways, hope this helps someone out there, and in the future - mabye you folks should look into something a little more forginving than exec.LookPath , which didn't support symlinks.
well, that said, the substitution of the file doesnt actually result in a clean "packer build", because "QEMU failed to start". So maybe the dependency on "qemu-system-x86_64" is specific, and packer doesnt work with "qemu-kvm". ?
Well, finally i solved the problem by:
0) yum installing SDL*
1) compiling QEMU on RHEL from scratch with --enable-SDL
2) re running the command at the top.
I think running in "headless" mode might also alleviate this problem , (possibly).
hello there,
I installed packer using homebrew on Mac and was trying to create a centos qcow image. I encountered the same error that you have
I am not able apply the work around as I do not have the qemu-kvm in the /usr/libexec.
Please advice thank you.
For anyone coming here later, the real solution is simply using the "qemu-binary" argument in your JSON file to point to your system's qemu binary, for example "qemu_binary": "qemu-kvm"
. This avoids having to copy or symlink anything.
Documented here: https://packer.io/docs/builders/qemu.html#qemu_binary
Hi Developers,
I am also facing the same problem. I am giving some more details of my environment. Please have a look into this.
Build 'qemu' errored: Failed creating Qemu driver: exec: "qemu-system-x86_64": executable file not found in $PATH
below are the details provided you for further investigation why it is failing.
I also tried with following one by one in my json file but it did not help
"qemu_binary": "/usr/libexec/qemu-kvm",
"qemu_binary": "qemu-kvm",
"qemu_binary": "qemu-system-x86_64",
"qemu_binary": "qemu-system-i386",
Host Machine : RHEL 6.7
Packer version : Packer v0.8.6
[[email protected]]$ ls -l /usr/libexec/qemu*
-rwxr-xr-x. 1 root root 4014136 Aug 6 23:26 /usr/libexec/qemu-kvm
[[email protected]]$
below are the some warnaing shown at the end while running below command
/usr/libexec/qemu-kvm -h
[[email protected]]$ /usr/libexec/qemu-kvm -h
QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2-2.479.el6_7.1), Copyright (c) 2003-2008 Fabrice Bellard
WARNING: Direct use of qemu-kvm from the command line is not recommended by Red Hat.
WARNING: Some command line options listed here may not be available in future releases.
WARNING: Red Hat recommends the use of libvirt as the stable management interface.
usage: qemu [options] [disk_image]
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
For anyone coming here later, the real solution is simply using the "qemu-binary" argument in your JSON file to point to your system's qemu binary, for example
"qemu_binary": "qemu-kvm"
. This avoids having to copy or symlink anything.Documented here: https://packer.io/docs/builders/qemu.html#qemu_binary