# Weird keyboard with KVM/QEMU

## Guinpen

Hello,

When I run a virtual machine within kvm-63 (with or without --no-kvm) or within qemu-softmmu-0.9.1-r1, I get strange keyboard behavior in the guest system. The arrow keys will not work. The arrow keys on the numpad will. Numlock behaves as if it is off when the guest is started, even if it was on when the guest was started. Toggling it then works fine in the guest, except that if it was on when the guest was started, its behavior is inverted. The Enter key on the numpad does nothing in all cases, but the Enter key on the main keyboard works fine.

This happens in both Gentoo minimal and Debian 4, no matter if I use 32bit or 64bit guest.

emerge --info:

```
Portage 2.1.4.4 (default-linux/amd64/2007.0, gcc-4.2.3, glibc-2.7-r1, 2.6.24-gentoo-r3 x86_64)

=================================================================

System uname: 2.6.24-gentoo-r3 x86_64 Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz

Timestamp of tree: Sat, 15 Mar 2008 01:30:01 +0000

app-shells/bash:     3.2_p33

dev-java/java-config: 1.3.7, 2.1.5

dev-lang/python:     2.5.1-r5

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.26

virtual/os-headers:  2.6.24

ACCEPT_KEYWORDS="amd64 ~amd64"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=nocona -O2 -ggdb -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.0/env /usr/kde/4.0/share/config /usr/kde/4.0/shutdown /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"

CXXFLAGS="-march=nocona -O2 -ggdb -pipe"

DISTDIR="/distfiles"

EMERGE_DEFAULT_OPTS="--nospinner --with-bdeps y --alphabetical"

FEATURES="collision-protect distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LC_ALL="en_US.UTF-8"

LINGUAS="en"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/layman/sajinet"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X a52 aac accessibility acpi alisp alsa amd64 amr amrnb amrwb ao archive audiofile bash-completion bios boost branding bzip2 cairo captury cdda cdio chm cli context cracklib crypt css curl cyrillic dbus dhcp djbfft djvu doc dri dts dvd dvdr dvdread dynamic eap-tls emovix encode exif extra extrafilters fam fame ffmpeg fftw firefox fits flac fluidsynth fontconfig fpx games gd gdbm gif glitz gmp gnuplot gnutls graphics graphviz gs gtk hal hdri hpn htmlhandbook humanities hyperestraier iconv icu id3tag idea idn imagemagick imlib inotify ipv6 isdnlog ithreads java javascript jbig jce joystick jpeg jpeg2k jsapi kde kig-scripting kipi ktts ladspa lame latex lcms libedit libnotify libwww lm_sensors lzo mad matroska mbrola midi mjpeg mmap mmx mng mod modplug mp3 mp4 mpeg mudflap musepack music ncurses network network-cron networkmanager nls nptl nptlonly nsplugin nuv odbc offensive ogg omega openexr opengl openmp oscar pam pango paste64 pcre pdf pg-intdatetime plotutils png portaudio postgres ppds pppd pstricks pth publishers python qemu qt3 qt3support qt4 quicktime rdesktop readline reflection rle rtsp sasl science sdl sdl-image session slang smp sndfile sound soundtouch speex spell spl sql sse sse2 ssl startup-notification stream subversion svg symlink theora threads tiff toolbar truetype unicode usb utempter vamp vcd visualization vlc vlm vnc vorbis vorbis-psy wavpack wideband wifi wmf wxwindows x264 xcb xcomposite xetex xforms xml xmp xorg xprint xscreensaver xv xvid xvmc zip zlib zrtp" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="evdev joystick mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="nvidia nv"

Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
```

Note that qemu-softmmu was compiled with gcc-3.4.6-r2, while everything else was compiled with gcc-4.2.3.

Thanks in advance!

----------

## Guinpen

Bump..?

----------

