GNOME Bugzilla – Bug 731112
Boxes cannot find /usr/bin/qemu-kvm (no such file or directory)
Last modified: 2016-03-31 13:22:07 UTC
I use GNOME Boxes 3.12.2 with Gentoo Linux as the host OS and Windows 7 as the guest OS. When trying to launch the virtual machine I get the following error: > Connection to 'Microsoft Windows 7' failed. If I run Boxes from a terminal in debug mode I get: $ G_MESSAGES_DEBUG=Boxes gnome-boxes (gnome-boxes:20548): Boxes-DEBUG: wizard-source.vala:250: Unable to open qemu+unix:///system: Failed to connect socket to '/var/run/libvirt/libvirt-sock-ro': No such file or directory (gnome-boxes:20548): Boxes-DEBUG: util-app.vala:276: check_module_kvm_loaded: yes (gnome-boxes:20548): Boxes-DEBUG: util-app.vala:256: check_cpu_vt_capability: yes (gnome-boxes:20548): Boxes-DEBUG: libvirt-machine.vala:111: new libvirt machine: win7 (gnome-boxes:20548): Boxes-DEBUG: machine.vala:61: State of 'Microsoft Windows 7' changed to BOXES_MACHINE_MACHINE_STATE_STOPPED (gnome-boxes:20548): Boxes-DEBUG: unattended-installer.vala:662: No media language, using en_US locale (gnome-boxes:20548): Boxes-DEBUG: unattended-installer.vala:662: No media language, using en_US locale (gnome-boxes:20548): Boxes-DEBUG: machine.vala:579: connect display failed: Unable to start domain: Cannot check QEMU binary /usr/bin/qemu-kvm: No such file or directory I don't have /usr/bin/qemu-kvm on my system: $ file /usr/bin/qemu-kvm /usr/bin/qemu-kvm: cannot open `/usr/bin/qemu-kvm' (No such file or directory) This is the list of the binaries that the app-emulation/qemu package from my distribution provides: $ equery files --filter=cmd app-emulation/qemu * Searching for qemu in app-emulation ... * Contents of app-emulation/qemu-2.0.0-r1: /usr/bin/qemu-i386 /usr/bin/qemu-img /usr/bin/qemu-io /usr/bin/qemu-nbd /usr/bin/qemu-system-i386 /usr/bin/qemu-system-x86_64 /usr/bin/qemu-x86_64 As you can see, there's no /usr/bin/qemu-kvm. This is the elog message I get from emerge when installing qemu: > Migration from qemu-kvm instances and loading qemu-kvm created > save states has been removed starting with the 1.6.2 release > It is recommended that you migrate any VMs that may be running > on qemu-kvm to a host with a newer qemu and regenerate > any saved states with a newer qemu. > qemu-kvm was the primary qemu provider in Gentoo through 1.2.x > The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer > installed. In order to use kvm acceleration, pass the flag > -enable-kvm when running your system target. This problem happened just after my weekly system update. 109 packages have been updated. I'm also not sure if this is a Boxes problem or a Gentoo one.
> > Migration from qemu-kvm instances and loading qemu-kvm created > > save states has been removed starting with the 1.6.2 release > > It is recommended that you migrate any VMs that may be running > > on qemu-kvm to a host with a newer qemu and regenerate > > any saved states with a newer qemu. > > qemu-kvm was the primary qemu provider in Gentoo through 1.2.x > > The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer > > installed. In order to use kvm acceleration, pass the flag > > -enable-kvm when running your system target. > > This problem happened just after my weekly system update. 109 packages have > been updated. I'm also not sure if this is a Boxes problem or a Gentoo one. Short answer, the bug is in your distro: <teuf> after the upgrade qemu-kvm is gone, and libvirt fails to start the machine <danpb> /usr/bin/qemu-kvm only ever existed in Fedora/RHEL <danpb> yeah, that's something Gentoo needs to deal with in their packaging if they rename the qemu binary <danpb> sounds perhaps like they installed the guest and then upgraded their qemu package which removed the qemu-kvm binary
To fix this locally, just do `virsh edit DOMAIN` for each domain and replace /usr/bin/qemu-kvm by /usr/bin/qemu-system-x86_64 in the editor launched, save and quit. You can get names of domains using `virsh list --all`.
You should also let the Gentoo qemu maintainers that by dropping these links they likely broke all kvm libvirt VMs which were created before the upgrade.
https://bugs.gentoo.org/show_bug.cgi?id=512172
I issued the "virsh edit win7" command and changed the following line: > <emulator>/usr/bin/qemu-kvm</emulator> to > <emulator>/usr/bin/qemu-system-x86_64</emulator> Now it works without the need for the symlink. Thank you for the suggestion.