Solve “qemu-system-x86_64”: executable file not found in $PATH

I recently experienced the error Failed creating Qemu driver: exec: “qemu-system-x86_64”: executable file not found in $PATH while trying to create a Qcow2 image for KVM/QEMU using Packer on a CentOS 8 system. After some google searches trying to solve the issue I discovered the quickest solution is hard copying “qemu-kvm” to “qemu-system-x86_64” , in /usr/libexec

🧠 Don’t just learn KVM – master it with the best-selling eBook trusted by thousands.

Locate the path of qemu-kvm binary:

$ which qemu-kvm
/usr/libexec/qemu-kvm

Copy the /usr/libexec/qemu-kvm file to /usr/libexec/qemu-system-x86_64:

sudo su -
cp /usr/libexec/qemu-kvm /usr/libexec/qemu-system-x86_64

Once the file is copied add /usr/libexec to your PATH:

export PATH=$PATH:/usr/libexec

You can also persist this in bash profile.

$ vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/usr/libexec
export PATH

You can then rerun packer command to build your OS image with debug on:

export PACKER_LOG=1
packer build <options> <hcl-or-json-file>

I hope this guide was helpful in solving the said error message.

Also check:

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Greetings and salutations. In our article today, we will evaluate two virtualization technologies. Virtualization is a concept that has gained […]

One of the best things about running Windows 11 in a virtualized environment is that you can try applications and […]

KVM (Kernel-based Virtual Machine) of Linux is one of the most popular virtualization technologies of Linux. KVM is a Linux […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.