Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 512172

Summary: gnome-extra/gnome-boxes: cannot find /usr/bin/qemu-kvm (no such file or directory)
Product: Gentoo Linux Reporter: Francesco Turco <fturco>
Component: [OLD] GNOMEAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED NEEDINFO    
Severity: normal CC: cardoe, genzilla, qemu+disabled
Priority: Normal Keywords: NeedPatch
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugzilla.gnome.org/show_bug.cgi?id=731112
Whiteboard:
Package list:
Runtime testing required: ---

Description Francesco Turco 2014-06-02 15:48:34 UTC
I use GNOME Boxes 3.12.2 with 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 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.

If I manually create a symlink from /usr/bin/qemu-kvm to /usr/bin/qemu-system-x86_64 the problem disappears.

This happened just after my weekly system update, today. 109 packages have
been updated. I previously reported this problem to GNOME developers, but they said it's a problem with Gentoo. Please see the URL above for details.

------------

$ emerge -pv gnome-boxes qemu

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-emulation/qemu-2.0.0-r1  USE="aio alsa curl fdt gtk jpeg ncurses opengl png pulseaudio sdl seccomp spice threads usb usbredir uuid vhost-net -accessibility -bluetooth -caps -debug -filecaps -glusterfs -iscsi -python -rbd -sasl (-selinux) -smartcard -ssh -static -static-softmmu -static-user -systemtap -tci {-test} -tls -vde -virtfs -vnc -xattr -xen -xfs" PYTHON_TARGETS="python2_7 (-python2_6)" QEMU_SOFTMMU_TARGETS="i386 x86_64 -aarch64 -alpha -arm -cris -lm32 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -or32 -ppc -ppc64 -ppcemb -s390x -sh4 -sh4eb -sparc -sparc64 -unicore32 -xtensa -xtensaeb" QEMU_USER_TARGETS="i386 x86_64 -aarch64 -alpha -arm -armeb -cris -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -or32 -ppc -ppc64 -ppc64abi32 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -unicore32" 0 kB
[ebuild   R    ] gnome-extra/gnome-boxes-3.12.2  USE="usbredir -smartcard" 0 kB

Total: 2 packages (2 reinstalls), Size of downloads: 0 kB

------------------

$ emerge --info
Portage 2.2.10 (default/linux/amd64/13.0/desktop/gnome/systemd, gcc-4.8.2, glibc-2.19, 3.14.4-gentoo-first x86_64)
=================================================================
System uname: Linux-3.14.4-gentoo-first-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.2
KiB Mem:     8103704 total,   1219388 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Mon, 02 Jun 2014 09:15:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p47
dev-lang/python:          2.7.6-r1, 3.3.5, 3.4.0
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r2
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.14 (virtual/os-headers)
sys-libs/glibc:           2.19
Repositories: gentoo bitcoin x-portage
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/bitcoin /usr/local/portage"
USE="X a52 aac acpi alsa amd64 bash-completion berkdb bzip2 cairo cdda cdr cli colord crypt css cxx dbus dri dts dvd dvdr eds emboss encode evo exif fam firefox flac gdbm gif gnome gnome-keyring gnome-online-accounts gstreamer gtk iconv introspection ipv6 jpeg latex lcms ldap libnotify libsecret lm_sensors mad mmx modules mp3 mp4 mpeg multilib nautilus ncurses networkmanager nls nptl opengl pam pango pcre pdf png policykit ppds pulseaudio qt3support qt4 readline samba scanner sdl session smp socialweb sound sse sse2 sse3 sse4_1 ssl ssse3 startup-notification svg systemd tcpd tiff truetype udev udisks unicode upower usb x264 xcb xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="snapscan" USERLAND="GNU" VIDEO_CARDS="intel i915 vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

Reproducible: Always
Comment 1 Francesco Turco 2014-06-02 15:58:51 UTC
GNOME developer Zeeshan Ali said me to use the "virsh edit" command to change the following line:

> <emulator>/usr/bin/qemu-kvm</emulator>

into:

> <emulator>/usr/bin/qemu-system-x86_64</emulator>

Now I can successfully launch the VM without the need for the symlink. But I still wonder if there's some Gentoo problem that need to be fixed for avoiding users to resort to this kind of tricks.
Comment 2 Pacho Ramos gentoo-dev 2014-06-09 09:10:56 UTC
@gnome, is gnome-boxes only compatible with qemu-system-x86_64? In that case, we should patch the value to use that one I think
Comment 3 Pacho Ramos gentoo-dev 2014-06-09 09:17:32 UTC
Well, looks like we should show a warning telling people to fix their VMs with that command instead :/. But that should be probably done by kvm maintainers as will affect to the old VMs
Comment 4 Myckel Habets 2014-06-16 06:11:37 UTC
I have the same problem (but I start the VM from a shell script), no qemu-kvm. I have KVM build into the kernel (checked it yesterday while building a new kernel), but no qemu-kvm. I replaced it with qemu-system-i386 and that worked, but it is considerable slower (I also tried qemu-system-x86_64, but that one was even slower than the i386 one).
Comment 5 Myckel Habets 2014-06-16 06:18:37 UTC
(In reply to Myckel Habets from comment #4)
> I have the same problem (but I start the VM from a shell script), no
> qemu-kvm. I have KVM build into the kernel (checked it yesterday while
> building a new kernel), but no qemu-kvm. I replaced it with qemu-system-i386
> and that worked, but it is considerable slower (I also tried
> qemu-system-x86_64, but that one was even slower than the i386 one).

For the slowness, apparently you have the pass -enable-kvm to the command line. This made it fast again.
Comment 6 Pacho Ramos gentoo-dev 2014-06-26 10:48:27 UTC
grepping in sources I see no hard coded path to qemu-kvm, then, probably the message deserves qemu ebuild itself but I am not sure since I am not familiar with this at all :(

@cardoe, @qemu team, what do you think? Thanks a lot
Comment 7 Konstantin (elxa) 2014-07-22 04:21:18 UTC
I just ran into the same problem using virt-manager. I am new to kvm/qemu stuff and tried to start a "proof of concept vm" I created a few months ago. After adding the symlink

/usr/bin/qemu-kvm -> /usr/bin/qemu-system-x86_64

it worked. Then I tried to use "virsh edit" as the alternative solution suggested, but that required a domain name:

error: command 'edit' requires <domain> option

Afaik "virsh list" is supposed to tell me my domain name, but in my case the returned list was empty:

 Id    Name                           State
----------------------------------------------------

So I ended up deleting my vm and creating a new one, since it wasn't important for me.

( Just in case anyone else has the same problem. )
Comment 8 SpanKY gentoo-dev 2014-07-29 09:37:52 UTC
what config file ?  the qemu ebuild already warns about qemu-kvm going away, and specifically checks for /etc/libvirt/qemu/*.xml.