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

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

I recently encountered an error message while trying to download Google Chrome on Windows Server using Internet Explorer browser. In […]

What is Enpass and how can I install Enpass on Ubuntu/ Debian Linux System?. When dealing with a lot of […]

Websploit is an open-source framework for testing websites and networks. It is a simple to use written in Python. It […]

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.