The problem is when the Manjaro Xfce host does screen locks.
Only screen locks trigger this behavior. It is when I have to enter the password to unlock the screen.
I've tried to put my screen to sleep with "Blank after", "Put to sleep after" and "Switch off after".
If the "Automatically lock the session" is disabled then VirtualBox guests see the keyboard after screen awakening.
If it is enabled then guests loose the keyboard after screen awakening.
Other windows of Xfce Manjaro host do not loose keyboard focus in the same situation (if they have it). Let's say, if the Text Editor is open then I can continue to type a text into it after screen unlocking.
I use the latest Xfce Manjaro with the latest updates. It was tested on kernels 5.4, 5.9, 5.10.
Workaround
To restore keyboard connection on a VirtualBox guest you may
- Switch to another opened window of the Manjaro host and jump back to you guest windows.
- Click the Application (Start) button of the host desktop and jump back to the guest window.
- Minimize and reopen you VirtualBox guest window.
Ubuntu behavior
On Ubuntu, screen sleeping is automatically disabling if a VirtualBox guest window is active.
Ubuntu shows a warning that another applications locks screen sleeping.
I.e. your screen will never be locked, let's say in a public place.
I definitely prefer the Manjaro Xfce behavior.
This would be great to know how to fix this keyboard loosing on Xfce Manjaro.
BTW, MS-Windows hosts has none of these troubles of Ubuntu and Manjaro Xfce.
I'm using the Manjaro as VirtualBox host because it allows my laptops to behave as a tabled. It is because coolers are silent most of the time despite a quite big load.
Of course this is not the case if I run a pair of heavy IDEs in a pair of heavy VirtualBox guests.
Neither Ubuntu nor Windows can give me this beauty.
Other windows
orin the same situation
? Is this alright?