Description of problem: When virt-viewer is run from Gnome session on wayland, the key combinations Ctrl+Alt+Del and Alt-Shift are not sent to VM, but are interpreted by Gnome instead. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.Login to Gnome wayland session 2.Start the VM and connect to it. 3.Press Ctrl+Alt+Del Actual results: Gnome tries to restart the host machine Expected results: Ctrl+Alt+Del is sent to VM and processed there Additional info:
This sounds like the same issue I'm experiencing on Fedora 25 with Wayland. Except that mine is for Alt+Tab combinations being sent to the host machine (haven't tried the other key combinations). Makes it very frustrating to navigate windows when within the VM. Any hints where I can look in the code to fix this?
The design of wayland intentionally prevents applications from doing full keyboard grabbing as they would under X11, in order to provide a more secure architecture. Clearly this is bad for the apps like virt-viewer/vncviewer/etc which genuinely need this feature and aren't trying to exploit the desktop but there's no obvious short term fix that can be done here https://bugs.freedesktop.org/show_bug.cgi?id=97333 https://bugzilla.redhat.com/show_bug.cgi?id=1285770 https://lists.fedoraproject.org/archives/list/desktop@lists.fedoraproject.org/thread/BBPOOC4GVBJXHLKSSFLGERG6GYAU6M6U/ IOW, there's little choice but to revert to X11 for the forseeable future if this is important :-(
Thanks for the response. That makes sense, I figured it was something to do with wayland compatability. I have an idea for a workaround which I'm sure you'll probably tell me isn't feasible. What if we use USB redirection for the keyboard but provide some way to un-redirect with some key combination? I accidentally redirected my keyboard/mouse to workaround another mouse issue and was unable to escape out of the VM after that and had to restart. So while my input was trapped in the VM Alt+Tab actually worked. The downside is currently there is no ungrab VM option, which should probably be addressed anyway (I can open a separate issue).
I don't really want to mess around with redirecting host input devices in that way - as you found out, once you do that there's no possible key sequence to escape as its completely invisible to the host. We need to wait for development of APIs to let us do proper grabbing & shortcut intercept under wayland/gnome.
While I do understand that users should be able to expect the same behaviour in X11 and Wayland, I would like to make a feature suggestion. If work on this needs to be done, how difficult would it be to allow users to define keys they want to be interpreted by the host in stead of the guest. For example, I use Ctrl+Alt+Up and Ctrl+Alt+Down to switch between workspaces in Gnome. It would be great if you could configure keystrokes like this to not be passed to the guest. Keys defined (either per vm or for all vms) should then be automatically added to the "Send key combination" menu.
Closing since we now have improved keyboard grab facility under wayland