VirtualBox messes up host keyboard

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Mr Wolf
Posts: 50
Joined: 23. Aug 2010, 15:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Kali Linux, BackTrack, Windows XP

VirtualBox messes up host keyboard

Post 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
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox messes up host keyboard

Post 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.
Mr Wolf
Posts: 50
Joined: 23. Aug 2010, 15:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Kali Linux, BackTrack, Windows XP

Re: VirtualBox messes up host keyboard

Post by Mr Wolf »

Thanks for your answer.
So, I guess there's nothing it can be done.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VirtualBox messes up host keyboard

Post 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.
Mr Wolf
Posts: 50
Joined: 23. Aug 2010, 15:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Kali Linux, BackTrack, Windows XP

Re: VirtualBox messes up host keyboard

Post by Mr Wolf »

Ok, if it's due to cpu usage, I'll follow your advice. However, I'm using a notebook.
Thanks! :D
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: VirtualBox messes up host keyboard

Post 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.)
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: VirtualBox messes up host keyboard

Post 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.
Mr Wolf
Posts: 50
Joined: 23. Aug 2010, 15:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Kali Linux, BackTrack, Windows XP

Re: VirtualBox messes up host keyboard

Post 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.
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: VirtualBox messes up host keyboard

Post by Martin »

Normally in this case the "Windows" key should get unstuck if you press it again.
Mr Wolf
Posts: 50
Joined: 23. Aug 2010, 15:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Kali Linux, BackTrack, Windows XP

Re: VirtualBox messes up host keyboard

Post 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:
Mr Wolf
Posts: 50
Joined: 23. Aug 2010, 15:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Kali Linux, BackTrack, Windows XP

Re: VirtualBox messes up host keyboard

Post 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:
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: VirtualBox messes up host keyboard

Post 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...
lukasz_kolczynski
Posts: 1
Joined: 4. Apr 2013, 17:00

Re: VirtualBox messes up host keyboard

Post 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.
lcmarincek
Posts: 1
Joined: 23. May 2013, 19:28

Re: VirtualBox messes up host keyboard

Post 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?
Post Reply