Page 1 of 1

VirtualBox messes up host keyboard

Posted: 5. Jun 2012, 21:05
by Mr Wolf
Hi to all!
I have VirtualBox 4.1.16 installed on Windows XP SP3.
Sometimes, not very often, however, it has just happened again, when I'm using a Virtual Machine, host keyboard is messed up: it is as win key+key shortcut is permanently activated.
That is: for example, I click d, and it is as win key+d is run.
This affects only host system, not guest, on which I can continue to write normally.
The main problem is I have to reboot the host system to get things back normal, closing VirtualBox doesn't solve the problem.

As far as I can remember, this has always happened with any VirtualBox version I had installed.

Is that a known problem? I don't know what it can cause it and cannot replicate it, it happens occasionally.

Thanks your help! :D

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 10:24
by mpack
It is caused when the host keyboard driver misses a keyboard event. It can happen any time the host is under stress (high workload, short of memory). It may be more likely to happen with USB keyboards.

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 12:10
by Mr Wolf
Thanks for your answer.
So, I guess there's nothing it can be done.

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 12:13
by mpack
You can try to reduce the workload. Ensure plenty of memory is available so the OS needs the swap file less. Make sure you have plenty of disk space. Perhaps use USB to PS/2 keyboard adapters, if your PC supports PS/2 keyboards. Don't have CPU or memory intensive apps running when you don't need them.

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 13:21
by Mr Wolf
Ok, if it's due to cpu usage, I'll follow your advice. However, I'm using a notebook.
Thanks! :D

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 13:31
by scottgus1
I have had this happen occasionally, too. (Windows 7 host, XP guests, USB keyboard) Seeing as your listed host OS is XP, Windows has an on-screen keyboard program that simulates keyboard presses when clicking on the "keys". I use it to clear the stuck keys when I get one. I just bring it up and click the stuck "key" once to set and once to clear. I even put a shortcut on the taskbar to get to the On-screen Keyboard quickly. The real keyboard key unsticks, and no need to reboot the host.

(Aside, I used to have this problem a lot when I had the right Ctrl key as the host key for Virtualbox. Now that I think of it, I haven't had stuck keys for months, ever since I changed the host key to the Pause/Break key.)

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 13:53
by michaln
scottgus1 wrote:I have had this happen occasionally, too. (Windows 7 host, XP guests, USB keyboard) Seeing as your listed host OS is XP, Windows has an on-screen keyboard program that simulates keyboard presses when clicking on the "keys". I use it to clear the stuck keys when I get one. I just bring it up and click the stuck "key" once to set and once to clear. I even put a shortcut on the taskbar to get to the On-screen Keyboard quickly. The real keyboard key unsticks, and no need to reboot the host.
Keys can be "unstuck" by pressing and releasing the actual "stuck" key. That may be a lot easier than some on-screen keyboard, unless it's really hard to tell which key is stuck.

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 13:57
by Mr Wolf
Thanks for your suggestion! I'll try this "virtual keyboard trick" next time.
One of the most annoying thing is that, when this problem occurs, if I click "l", it runs win key+l and it locks the computer!
Since my password just contains "l" (and no, I'm not gonna tell you what it is!), I have to look for ascii code for "l" and use it to unlock. :|

Since I have installed guest additions, I usually don't use right ctrl key.

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 17:44
by Martin
Normally in this case the "Windows" key should get unstuck if you press it again.

Re: VirtualBox messes up host keyboard

Posted: 6. Jun 2012, 18:07
by Mr Wolf
Yep, reading the previous post by michaln, I was just wondering if simply pressing the win key would solve the problem. I think I didn't try. :roll:

Re: VirtualBox messes up host keyboard

Posted: 8. Jun 2012, 16:44
by Mr Wolf
Ok... just had the same problem, and pressing win key works! :D I feel a bit stupid not to have tried it earlier. :oops:

Re: VirtualBox messes up host keyboard

Posted: 9. Jun 2012, 21:35
by scottgus1
Martin wrote:"Windows" key should get unstuck if you press it again.
I always thought my stuck key was the CTRL, because clicking it on the on-screen keyboard stopped the strange behavior I was getting. I'll remember the windows key, too, next time it happens...

Re: VirtualBox messes up host keyboard

Posted: 4. Apr 2013, 17:04
by lukasz_kolczynski
I had the same problem with Windows 7 as a host and Debian in VM - sometimes after leaving VM I had a strange keyboad behavior on the host machine. I found that if I press Windows-button twice - the problem disappears.

Re: VirtualBox messes up host keyboard

Posted: 23. May 2013, 19:36
by lcmarincek
I´m facing the same poblem. Windows 7 host and Ubuntu guest.
The above comments provide a workaround to solve the problem when it happens.
Has anybody found a solution for the root cause of the problem? How to avoid the stuck keys?