Bug 1537525

Summary: cannot use keyboard in virtual machines
Product: Red Hat Enterprise Linux 7 Reporter: Vladimir Benes <vbenes>
Component: spice-gtkAssignee: Default Assignee for SPICE Bugs <rh-spice-bugs>
Status: CLOSED DUPLICATE QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: ofourdan, rbalakri, tpelka, vbenes
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-06 15:05:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vladimir Benes 2018-01-23 12:48:38 UTC
Description of problem:
I cannot use keyboard in virtual machines (in both Virt-manager and Boxes). I've tried F25, RHEL7.3 and Windows 10. All behave the same. Mouse works but keyboard does not.

Version-Release number of selected component (if applicable):
libwayland-client-1.14.0-2.el7.x86_64
kernel-3.10.0-831.el7.x86_64
qemu-kvm-1.5.3-153.el7.x86_64
gnome-boxes-3.22.4-4.el7.x86_64
virt-manager-1.4.3-3.el7.noarch


Additional info:
There are other issues in gnome-boxes like invisible cursor on app decorator, etc, not sure if these issues are related.

Comment 1 Olivier Fourdan 2018-02-06 13:39:01 UTC
Note, “wayland” (the component) is a small RPC library, this issue cannot be in “Wayland”.

So we need to first identify where this issue belongs.

What you describe looks a lot like bug 1534324 which is a bug in the way spice-gtk or gtk-vnc try to detect the scancodes. The original bug report for Fedora is bug 1479682.

This can be seen if for you get erros like:

   WARNING **: Unknown X11 keycode mapping '(unnamed)'.

When typing on the keyboard.

This issue happens when using X11 as the backend for those applications, whereas when used with the Wayland backend no such issue occurs.

The way gtk+ works, it will try the Wayland backend first, it that fails, it fallbacks automatically to the X11 backend. This can happen for example when running via “ssh -X” or when running as a different user (“sudo ...” or “su ...”)

Can you check iy you get the “Unknown X11 keycode mapping '(unnamed)'” warniong and if you're using the X11 backend instead of the Wayland native one?

Comment 2 Olivier Fourdan 2018-02-06 14:00:29 UTC
(Note: there is a funny test to check which backend a given window is using, run xeyes and hover the window, if the eyes follow your pointer while it moves over the window, then it's using X11, if the eyes remain completely static, then it's using Wayland)

Comment 3 Vladimir Benes 2018-02-06 14:14:41 UTC
I can see this:
(gnome-boxes:7272): vnc-keymap-WARNING **: Unsupported GDK Windowing platform.
Disabling extended keycode tables.
Please report to gtk-vnc-list
including the following information:

  - Operating system
  - GDK Windowing system build

(gnome-boxes:7272): GSpice-CRITICAL **: send_key: assertion 'scancode != 0' failed

(gnome-boxes:7272): GSpice-CRITICAL **: spice_gtk_session_request_auto_usbredir: assertion 's->auto_usbredir_reqs > 0' failed


First critical appears upon every single key hit the second one upon disconnecting from the box.

I can see those processes:
vbenes    5966  0.0  0.0 290928  2884 tty2     Ssl+ 15:03   0:00 /usr/libexec/gdm-wayland-session gnome-session
vbenes    6064  0.5  0.3 364108 72988 tty2     Sl+  15:03   0:02 /usr/bin/Xwayland :1 -rootless -terminate -core -listen 4 -listen 5 -displayfd 6


anyhting more to post here?

Comment 4 Vladimir Benes 2018-02-06 14:18:49 UTC
eyes are following me... 

but I checked Wayland session in gdm..

Comment 5 Vladimir Benes 2018-02-06 14:31:29 UTC
DESKTOP_SESSION=gnome-wayland
XDG_SESSION_TYPE=wayland
GDMSESSION=gnome-wayland
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
XDG_SESSION_DESKTOP=gnome-wayland

Comment 6 Olivier Fourdan 2018-02-06 14:59:03 UTC
Vladimir Benes from comment #3)
> I can see this:
> (gnome-boxes:7272): vnc-keymap-WARNING **: Unsupported GDK Windowing
> platform.

How do you start/run gnome-boxes? I don't see that warning here...

> Disabling extended keycode tables.
> Please report to gtk-vnc-list
> including the following information:
> 
>   - Operating system
>   - GDK Windowing system build
> 
> (gnome-boxes:7272): GSpice-CRITICAL **: send_key: assertion 'scancode != 0'
> failed

This is the same as bug 1534324, bug 1540056 and bug 1479682, that's why the keyboard doesn't work.

(In reply to Vladimir Benes from comment #4)
> eyes are following me... 
> 
> but I checked Wayland session in gdm..

Yes, you are running GNOME/Wayland but that doesn;t mean that all your applications are using Wayland.

Wayland is a entirely different protocol from X11, applications needs to be rewritten or ported to be able to use Wayland. For those not able to “talk” Wayland natively, we provide Xwayland, which is a Wayland client and an X11 server for those applications only talking X11.

So, running a Wayland sessio ndoes nto mean that all your applications are using Wayland...

(In reply to Vladimir Benes from comment #5)
> DESKTOP_SESSION=gnome-wayland
> XDG_SESSION_TYPE=wayland
> GDMSESSION=gnome-wayland
> GNOME_DESKTOP_SESSION_ID=this-is-deprecated
> XDG_SESSION_DESKTOP=gnome-wayland

Again, I have no doubt you selected “GNOME Wayland” session, does not mean that all your apps are able to run on Wayland.

Comment 7 Olivier Fourdan 2018-02-06 15:05:12 UTC

*** This bug has been marked as a duplicate of bug 1540056 ***

Comment 8 Vladimir Benes 2018-02-06 15:11:30 UTC
(In reply to Olivier Fourdan from comment #6)
> Vladimir Benes from comment #3)
> > I can see this:
> > (gnome-boxes:7272): vnc-keymap-WARNING **: Unsupported GDK Windowing
> > platform.
> 
> How do you start/run gnome-boxes? I don't see that warning here...
> 
gnome-boxes command in gnome-terminal

> > Disabling extended keycode tables.
> > Please report to gtk-vnc-list
> > including the following information:
> > 
> >   - Operating system
> >   - GDK Windowing system build
> > 
> > (gnome-boxes:7272): GSpice-CRITICAL **: send_key: assertion 'scancode != 0'
> > failed
> 
> This is the same as bug 1534324, bug 1540056 and bug 1479682, that's why the
> keyboard doesn't work.
> 
are we close to a solution in any of those?

Comment 9 Tomas Pelka 2018-02-06 16:01:25 UTC
(In reply to Vladimir Benes from comment #8)
> (In reply to Olivier Fourdan from comment #6)
> > Vladimir Benes from comment #3)
> > > I can see this:
> > > (gnome-boxes:7272): vnc-keymap-WARNING **: Unsupported GDK Windowing
> > > platform.
> > 
> > How do you start/run gnome-boxes? I don't see that warning here...
> > 
> gnome-boxes command in gnome-terminal
> 
> > > Disabling extended keycode tables.
> > > Please report to gtk-vnc-list
> > > including the following information:
> > > 
> > >   - Operating system
> > >   - GDK Windowing system build
> > > 
> > > (gnome-boxes:7272): GSpice-CRITICAL **: send_key: assertion 'scancode != 0'
> > > failed
> > 
> > This is the same as bug 1534324, bug 1540056 and bug 1479682, that's why the
> > keyboard doesn't work.
> > 
> are we close to a solution in any of those?

We are not, moved to 7.6.