Page 1 of 2
Capture Host HotKey as a Guest HotKey under Wayland (#19105)
Posted: 7. Nov 2019, 03:33
by danielsender
ModEdit; related ticket: #19105: Keyboard capture does not work properly under Wayland
I'm running VB 6.0.14 on an Ubuntu 18.04 system as the host, Centos 7 as the guest. I'm using Gnome Classic in the guest system and I would like to configure some properties on the top and bottom panels. In the host I can simply set alt->right_button and a menu will pop up with a few options, I would like to do the same thing in the guest, that is to use the "Properties" option to make those panels "autohide". However if I do alt->right_button I don't get the menu. I wonder if it is because that combination of keys is not catch by the guest or there is something else. Does anybody know how to do that? Thanks.
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 7. Nov 2019, 09:11
by socratis
danielsender wrote:I wonder if it is because that combination of keys is not catch by the guest or there is something else
The Host grabs it, doesn't it? If the Host's Gnome intercepts the keystrokes for itself, there's nothing that VirtualBox can do about it; Gnome has it.
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 7. Nov 2019, 19:41
by danielsender
That's what I was afraid of, so perhaps there is a file that I can edit to set those preferences.
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 7. Nov 2019, 19:52
by scottgus1
There is no Virtualbox list to control what key combinations are used by the host PC's OS. That question would be good for a forum or instruction website that handles the host OS.
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 7. Nov 2019, 22:55
by danielsender
My last question was more related to what is the file in which we have the preferences and edit that directly.
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 8. Nov 2019, 01:08
by socratis
Your last question was properly understood by 'scottgus1', who properly replied to you...
What you're looking for is a Gnome property on your Host, and Scott directed you to seek the answer to a forum/website that deals with Gnome issues. This is not a VirtualBox problem, and there's nothing in VirtualBox that can help you doing what you want.
PS. I changed the title of the thread from "Panel properties" to something more appropriate...
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 8. Nov 2019, 01:55
by danielsender
Yes, your new title is more appropriate - but in my opinion it is still a VB kind of issue, that is how to avoid a key combination to be picked up by the host.
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 8. Nov 2019, 02:13
by socratis
Your host has precedence over the HotKey. How on earth do you expect the applications running on the Host, that never get a chance to see the key that's grabbed by Gnome, to be responsible for that? Gnome won't let the HotKey go nowhere, it's actively looking for it and filtering it, no application gets to see it. VirtualBox doesn't even know that the HotKey got activated!
This is 100% a Gnome issue, I suggest you start thinking it like that...
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 8. Nov 2019, 02:22
by danielsender
I made an experiment, I temporarily switched from Gnome-classic on the host to Ubuntu, hoping that alt->right_click wouldn't be a hot key, but somehow it is. So there must be a file in Gnome where the preferences are stored. Thanks guys.
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 18. Nov 2019, 18:39
by WillW
I'm using VirtualBox in Fedora 30, with (among others) a Windows 10 Guest. When I hit the Cmd (or 'Windows') key, even if the guest has captured the keyboard, the host processes the keypress. This means I get the GNOME overview, rather than the Guest Start Menu. The same is true for Alt+Tab and other key combinations.
This issue has been reported before as a problem with Wayland and how keyboard capture works. There is this thread from 2017 "Support for wayland keyboard grabbing protocol" linking to a related Wayland issue (I'm too new to post links - sorry). That issue has since been resolved (in 2017), but VirtualBox is still not working correctly. Apparently GNOME boxes does work properly (i haven't tested it).
Is there a workaround to ensure full keyboard capture, or any news on VirtualBox fixing the issue?
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 18. Nov 2019, 19:27
by mpack
VirtualBox can't fix the issue since it isn't a VirtualBox problem. It can't pass keystrokes to the VM if the host intercepts them first.
Bear in mind that VirtualBox is a normal host application. The fact that it simulates hardware for the VM doesn't mean that it has any special powers when it comes to using hardware managed by the host OS.
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 19. Nov 2019, 08:40
by socratis
@'WillW'
I merged your thread with a similar one dealing with the same issue. Please read it from the beginning...
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 19. Nov 2019, 12:13
by WillW
Thank you for merging these threads, they are related to the same issue.
socratis wrote:Your host has precedence over the HotKey. How on earth do you expect the applications running on the Host, that never get a chance to see the key that's grabbed by Gnome, to be responsible for that? Gnome won't let the HotKey go nowhere, it's actively looking for it and filtering it, no application gets to see it. VirtualBox doesn't even know that the HotKey got activated!
On X11, Virtual Machine applications could grab any keypress before it got to Gnome. That is how VirtualBox has worked on Gnome for years - if you pressed Alt-Tab when the VM had focus, you'd change program in the VM. If you hit the host key and then Alt-Tab, VirtualBox would send the the keypress to Gnome instead and you'd change out of the VM. The way X11 works, this was possible.
This has changed with Wayland. The underlying reasons are good - Wayland has a strong security model that prevent applications seeing all keypresses (among other things). This is the cause of the issue that we're both seeing here. For a while this issue was a Wayland problem.
Wayland has now fixed this issue.
I still can't link to the relevant issue, but googling "Red Hat Bugzilla – Bug 1285770" will take you to Keys can't be grabbed under Wayland (needed by remote desktop viewers, virtual machine managers),
which describes the situation. The fix was a couple of Wayland extensions, one of which allows applications to request that the compositor not process any shortcut keys and past them direct to the application.
Gnome Boxes is using the extension to provide the keyboard behaviour we all want. Gnome Boxes doesn't have special privileges because it's a Gnome app, they're just taking advantage of the Wayland extension. My question was whether there were any plans for VirtualBox to do the same?
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 20. Nov 2019, 00:29
by socratis
Thanks for posting the information about the RedHat issue
(from 2015-11-26, wow), appreciated.
That lead me to the upstream
FreeDesktop ticket #97333: Missing feature for remote desktop and virtual machine software: keyboard grabbing, which was fixed by implementing (yet another?)
protocol extension.
WillW wrote:My question was whether there were any plans for VirtualBox to do the same?
I
(actually we commoners) wouldn't have the slightest idea, the developers never discuss their plans. For good reasons...
What I would do in your case, if you think that this
could be resolved by a VirtualBox update/fix, would be head to the
bug tracker and either search for an appropriate ticket
(couldn't find any), or open a new ticket.
I wouldn't keep my hopes high though, Wayland is not that high in the priorities AFAIK. For example if Wayland is detected, 3D acceleration is disabled...
Re: Capture Host HotKey as a Guest HotKey under Wayland
Posted: 22. Nov 2019, 13:10
by WillW
I've filed an issue (
https://www.virtualbox.org/ticket/19105), so we'll see what happens.