Host OS is Arch Linux with the following versions:-

qemu 2.1.0-2 libvirt 1.2.7-1 linux 3.15.8-1

Guest OS is Windows 7 64-bit.

This problem did not exist when I first created this VM and started using it, but rather appeared at some point. I can't unfortunately pin it down to a particular host or guest configuration change or software update.

When running the VM with the virt-manager viewer, key presses take slightly less than a second to register. Mouse actions are not delayed. The machine is not noticeably running slowly overall - the delay appears to be only in keyboard input.

Here's the definition of the machine:-

<domain type='kvm'>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>4</vcpu>
    <type arch='x86_64' machine='pc-i440fx-1.5'>hvm</type>
    <boot dev='hd'/>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Nehalem</model>
    <topology sockets='1' cores='2' threads='4'/>
    <feature policy='require' name='avx'/>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='dtes64'/>
    <feature policy='require' name='xsave'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='xtpr'/>
    <feature policy='require' name='pcid'/>
    <feature policy='require' name='est'/>
    <feature policy='require' name='monitor'/>
    <feature policy='require' name='tm'/>
    <feature policy='require' name='pclmuldq'/>
    <feature policy='require' name='acpi'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='osxsave'/>
    <feature policy='require' name='tm2'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='pdcm'/>
    <feature policy='require' name='ds'/>
    <feature policy='require' name='rdtscp'/>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='ds_cpl'/>
  <clock offset='utc'/>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writethrough'/>
      <source dev='/dev/volgrp1/qemu_windows7'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/mapper/volgrp2-qemu_windows7_data'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x7'/>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0' multifunction='on'/>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x1'/>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x2'/>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    <interface type='direct'>
      <mac address='52:54:00:f0:f8:5b'/>
      <source dev='eth0' mode='bridge'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <interface type='network'>
      <mac address='52:54:00:c4:a5:2a'/>
      <source network='isolated'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    <serial type='pty'>
      <target port='0'/>
    <console type='pty'>
      <target type='serial' port='0'/>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes' listen=''>
      <listen type='address' address=''/>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
      <model type='qxl' ram='65536' vram='65536' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

Does anyone have any suggestions as to what the issue could be? I can't find any useful Google links. I was hoping that it would be a bug that would vanish again, but it has persisted over several version of Qemu + kernel now.

  • 1
    Issues like this led me to get rid of Arch Linux. This is a situation where you want something that works, not the latest poorly-tested code. Aug 28 '14 at 12:18
  • agreed. Spice, QEMU, KVM, libvirt - all of these are essentially Red Hat projects. Try it on Fedora if you wannt the latest and greatest or on RHEL/CentOS.
    – dyasny
    Aug 29 '14 at 17:17

This is not a distro problem, but a bug in Windows:

http://keyliner.blogspot.se/2009/11/windows-7-slow-keyboard-response.html (second clause)

That is what helped me:

  1. Start, Run, regedit

  2. Find this key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters

  3. On the detail side, right-click the blank area and add a new "DWORD (32-bit)" value. Name the key PollStatusIterations.

    Set value to Hex = 1

    Caution, there are other registry keys with similar names.

  4. Close Regedit and reboot.

  5. If this value is already in the Registry, disable the key by renaming it to xxPollStatusIterations (right-click, Rename). Reboot and test.

  • 2
    I was sceptical, but that actually worked! Amazing. You are a genius. I can now use my Windows VM again.
    – JohnCC
    Sep 24 '14 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.