#701097 No keyboard with Spice when using some hand-crafted keyboard layout on the host

#701097#5
Date:
2013-02-21 13:34:46 UTC
From:
To:
When a VM is configured to use Spice, keyboard input from the virt-manager
viewer does not reach the VM (and neither do the Send Key menu items work). No
keys at all work, not even A-Z (which sometimes still work when the keyboard
layout is broken).

When a stand-alone Spice client is used to access the same VM, keyboard works.
Also, the viewer in virt-manager works fine with VNC.

I get this warning:

(virt-manager:16431): vnc-keymap-WARNING **: Unknown keycode mapping 'evdev'.

Note that VNC is mentioned here, even though I'm confident that my VM uses
Spice, and a stand-alone Spice client works with it.

Console output from "virt-manager --debug --no-fork" below:

2013-02-21 14:25:38,784 (cli:71): virt-manager startup
2013-02-21 14:25:38,784 (virt-manager:292): Launched as: /usr/share/virt-
manager/virt-manager.py --debug --no-fork
2013-02-21 14:25:38,785 (virt-manager:293): GTK version: (2, 24, 10)
2013-02-21 14:25:38,785 (virt-manager:294): virtManager import: <module
'virtManager' from '/usr/share/virt-manager/virtManager/__init__.pyc'>
/usr/share/virt-manager/virt-manager.py:306: DeprecationWarning: Importing
dbus.glib to use the GLib main loop with dbus-python is deprecated.
Instead, use this sequence:

    from dbus.mainloop.glib import DBusGMainLoop

    DBusGMainLoop(set_as_default=True)

  import dbus.glib
2013-02-21 14:25:38,850 (keyring:30): gnomekeyring bindings not installed, no
keyring support
2013-02-21 14:25:38,881 (engine:555): No inspection thread because libguestfs
is too old, not available, or libvirt is not thread safe.
2013-02-21 14:25:38,882 (systray:138): Showing systray: False
2013-02-21 14:25:38,883 (engine:346): About to connect to uris
['qemu+ssh://alex@kvm1.paradial.int/system', 'qemu:///system']
2013-02-21 14:25:38,904 (manager:171): Showing manager
2013-02-21 14:25:38,934 (engine:471): window counter incremented to 1
2013-02-21 14:25:38,936 (manager:171): Showing manager
2013-02-21 14:25:38,938 (connection:991): Scheduling background open thread for
qemu:///system
2013-02-21 14:25:38,939 (connection:1177): Background 'open connection' thread
is running
2013-02-21 14:25:38,964 (connection:1227): Background open thread complete,
scheduling notify
2013-02-21 14:25:38,995 (connection:1232): Notifying open result
2013-02-21 14:25:39,507 (connection:1239): qemu:///system capabilities:
<capabilities>

  <host>
    <uuid>44454c4c-3000-1038-8059-b4c04f345331</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>SandyBridge</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='4' threads='2'/>
      <feature name='osxsave'/>
      <feature name='pdcm'/>
      <feature name='xtpr'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='smx'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='monitor'/>
      <feature name='dtes64'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
      <feature name='vme'/>
    </cpu>
    <power_management>
      <suspend_mem/>
      <suspend_disk/>
      <suspend_hybrid/>
    </power_management>
    <migration_features>
      <live/>
      <uri_transports>
        <uri_transport>tcp</uri_transport>
      </uri_transports>
    </migration_features>
    <topology>
      <cells num='1'>
        <cell id='0'>
          <cpus num='8'>
            <cpu id='0'/>
            <cpu id='1'/>
            <cpu id='2'/>
            <cpu id='3'/>
            <cpu id='4'/>
            <cpu id='5'/>
            <cpu id='6'/>
            <cpu id='7'/>
          </cpus>
        </cell>
      </cells>
    </topology>
  </host>

  <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <emulator>/usr/bin/kvm</emulator>
      <machine>pc-1.1</machine>
      <machine canonical='pc-1.1'>pc</machine>
      <machine>pc-1.0</machine>
      <machine>pc-0.15</machine>
      <machine>pc-0.14</machine>
      <machine>pc-0.13</machine>
      <machine>pc-0.12</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/kvm</emulator>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <pae/>
      <nonpae/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/kvm</emulator>
      <machine>pc-1.1</machine>
      <machine canonical='pc-1.1'>pc</machine>
      <machine>pc-1.0</machine>
      <machine>pc-0.15</machine>
      <machine>pc-0.14</machine>
      <machine>pc-0.13</machine>
      <machine>pc-0.12</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/kvm</emulator>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

</capabilities>

2013-02-21 14:25:39,885 (connection:607): Connection managed save support: True
2013-02-21 14:25:39,945 (connection:189): Using libvirt API for netdev
enumeration
2013-02-21 14:25:39,948 (connection:229): Using libvirt API for mediadev
enumeration
2013-02-21 14:25:47,625 (details:535): Showing VM details: <vmmDomain object at
0x22183c0 (virtManager+domain+vmmDomain at 0x22a0820)>
2013-02-21 14:25:47,692 (engine:471): window counter incremented to 2
2013-02-21 14:25:47,698 (console:1075): Starting connect process for
proto=spice trans=None connhost=localhost connuser=None connport=None
gaddr=127.0.0.1 gport=5900 gsocket=None
2013-02-21 14:25:47,699 (console:490): spice uri: spice://localhost?port=5900

(virt-manager:16431): vnc-keymap-WARNING **: Unknown keycode mapping 'evdev'.
Please report to gtk-vnc-list@gnome.org
including the following information:

  - Operating system
  - GDK build
  - X11 Server
  - xprop -root
  - xdpyinfo

2013-02-21 14:25:47,858 (console:986): Viewer connected

#701097#10
Date:
2014-10-09 10:22:00 UTC
From:
To:
Hi Alexey,

Alexey Feldgendler wrote (21 Feb 2013 13:34:46 GMT) :

On current Debian sid, virt-manager works fine for me with Spice
channels, including keyboard. Can you still reproduce this bug on
Debian testing or sid?

Cheers,
--
intrigeri

#701097#17
Date:
2014-10-12 17:33:50 UTC
From:
To:
Hello!

Still reproducible in testing (virt-manager 1:1.0.1-2).

Alexey

#701097#24
Date:
2014-10-13 09:15:34 UTC
From:
To:
Hi,

Alexey Feldgendler wrote (12 Oct 2014 17:33:50 GMT) :

Thank you.

Is spice-vdagent running in the guest? If so, which version?

Is this bug affecting text consoles too, or only X?

Cheers,
--
intrigeri

#701097#29
Date:
2014-10-13 15:49:41 UTC
From:
To:
The guest is MS Windows 7. It's running vdagent.exe and vdservice.exe,
both have version 0.5.1.0 (at least that's what the EXE metadata
says).

I don't know how to test. I can switch from the graphical console to
Serial 1, and type there, and then I don't see any echo. I'm not sure
I should expect echo.

#701097#34
Date:
2014-10-13 16:21:42 UTC
From:
To:
Oh, I also have a VM with Ubunutu Quantal. It has exactly the same
problem. It didn't have spice-vdagent initially; installing version
0.10.1-1 from Ubuntu didn't make a difference.

Note that the stand-alone spicec client works fine with both VMs. Only
the built-in one has a problem.

Yes, the Linux text console on my Ubuntu VM is affected.

#701097#39
Date:
2014-10-23 16:58:07 UTC
From:
To:
Hi,

Alexey Feldgendler wrote (13 Oct 2014 16:21:42 GMT) :

Thanks for the additional information.

It seems that the code path that does the keyboard layout
auto-detection on the host, and displays the warning you're seeing, is
one of those:

http://sources.debian.net/src/gtk-vnc/0.5.3-1.3/src/vncdisplaykeymap.c/?hl=179#L179
http://sources.debian.net/src/spice-gtk/0.25-1/gtk/vncdisplaykeymap.c/?hl=211#L211

What keyboard layout are you using on the host system?
Did you do anything special to configure it?
What X input driver are you using on the host system?

Cheers,

#701097#44
Date:
2014-10-24 19:13:39 UTC
From:
To:
bug. I tried starting without it, and keyboard worked.

I run this command in my .xsession:

xkbcomp -I$HOME/.xkb $HOME/.xkb/keymap $DISPLAY

In ~/.xkb, I have a manually crafted keyboard configuration that
places some special characters exactly where I want them.

How does the layout detection work?

#701097#49
Date:
2014-11-19 09:48:49 UTC
From:
To:
Hi,

Alexey Feldgendler wrote (24 Oct 2014 19:13:39 GMT) :

OK, thanks. Retitling accordingly.

I do something similar here (using xmodmap, though), and it works for
me. So, to see this bug fixed, it would be good to pinpoint what exact
part of your setup breaks the detection logic.

I'm no C programmer, so I'm afraid I can't help on that one.

Cheers,

#701097#56
Date:
2014-11-19 12:50:55 UTC
From:
To:
Here are my XKB config files, so that full reproduction should be
possible. Hope this helps!

=== .xkb/keymap ===

xkb_keymap
{
        xkb_keycodes
        {
                include "evdev"
        };

        xkb_types
        {
                include "default"
        };

        xkb_compatibility
        {
                include "complete"
                include "ledscroll(group_lock)"
        };

        xkb_symbols
        {
                include "pc(pc105)"
                include "terminate"
                include "capslock(grouplock)"
                include "level3(ralt_switch)"
                include "inet(evdev)"
                include "nbsp(level3n)"
                include "x-no"
                include "x-ru:2"
                replace "x-mods"
        };

        xkb_geometry
        {
                include "pc(pc104)"
        };
};

=== .xkb/symbols/x-no ===

partial alphanumeric_keys
xkb_symbols {
    include "us(basic)"

    key <AE01> { [         1,     exclam,    exclamdown,      onesuperior ] };
    key <AE02> { [         2,         at,             2,      twosuperior ] };
    key <AE03> { [         3, numbersign,       section,    threesuperior ] };
    key <AE04> { [         4,     dollar,      currency,         sterling ] };
    key <AE05> { [         5,    percent,      EuroSign,              yen ] };
    key <AE06> { [         6,asciicircum,             6,       onequarter ] };
    key <AE07> { [         7,  ampersand,             7,          onehalf ] };
    key <AE08> { [         8,   asterisk,      multiply,    threequarters ] };
    key <AE09> { [         9,  parenleft, leftdoublequotemark,
leftsinglequotemark ] };
    key <AE10> { [         0, parenright, rightdoublequotemark,
rightsinglequotemark ] };
    key <AE11> { [     minus, underscore,         U2014,            U2013 ] };

    key <AD03> { [         e,          E,            ae,               AE ] };
    key <AD04> { [         r,          R,    registered,       registered ] };
    key <AD05> { [         t,          T,         U2122,            U2122 ] };
    key <AD09> { [         o,          O,        oslash,         Ooblique ] };
    key <AD10> { [         p,          P,     paragraph,           degree ] };
    key <AD11> { [ bracketleft,  braceleft,  guillemotleft,         U201E ] };
    key <AD12> { [bracketright, braceright, guillemotright,         U201C ] };

    key <AC01> { [         a,          A,         aring,            Aring ] };

    key <AB03> { [         c,          C,     copyright,             cent ] };
    key <AB09> { [    period,    greater,         U2026,            U2026 ] };
    key <AB10> { [     slash,   question,  questiondown,     questiondown ] };

    key <BKSL> { [ backslash,        bar,       notsign,        brokenbar ] };
};

=== .xkb/symbols/x-ru ===

partial alphanumeric_keys
xkb_symbols {
    include "ru(winkeys)"

    key <AE09> { [         9,  parenleft, guillemotleft,            U201E ] };
    key <AE10> { [         0, parenright,guillemotright,            U201C ] };
    key <AE11> { [     minus, underscore,         U2014,            U2013 ] };

    key <AB10> { [    period,      comma,         U2026,            U2026 ] };
};

=== .xkb/symbols/x-mods ===

partial xkb_symbols {
    key <MENU> { type[Group1]="FOUR_LEVEL", [ Menu, Menu, Multi_key,
Multi_key ] };
    key <I149> { [ XF86Launch1 ] };
    key <FK22> { [ XF86KbdLightOnOff ] };
};