Running Ubuntu 11.04 x86 guest under VirtualBox 4.2.6 in a Win7 X64 host.
Bear with me... this is a strange one. Once booted into Ubuntu nothing inside the Ubuntu guest seems to recognize keyboard input: Login screen, Gnome Terminal, gedit, etc. I can't use Alt+Tab to switch between windows, can't switch between workspaces using the keyboard. Mouse works as expected. I can't enter virtual console (terminals) via Ctrl+Alt+F1 through to F7, etc. Nothing. The keyboard does work while inside GRUB, however.
Everything's been working fine for a long time (been using this guest under various versions of VirtualBox for well over a year, no problems - and upgraded to VB 4.2.6 at least a week ago.)
At some point today, VirtualBox crashed (yeah, this happens on occasion). I restarted the guest, and the keyboard input was no longer working. This is the first time this has happened.
The virtual keyboard on the logon screen does work, and once logged in, I can paste text from the VirtualBox host clipboard to enter commands in the Gnome Terminal bash shell.
sudo showkey in Gnome Terminal (by pasting in the command and my password) shows scan codes making their way into the guest when I press various keys:
$ sudo showkey [sudo] password for inactivist: kb mode was RAW [ if you are trying this under X, it might not work since the X server is also reading /dev/console ] press any key (program terminates 10s after last keypress)... keycode 30 press keycode 30 press keycode 30 press keycode 31 press ...
This is very strange. Nothing in the Ubuntu guest responds to keystrokes or input, yet the system sees scan codes when I press keys while
showkey is running.
I've searched for hours on Ubuntu forums and other resources, nothing I've found so far helps.
Here's what I did during the initial troubleshooting phase:
- Rebooted Windows 7, from a cold start. No change.
- Verified Slow Keys (accessibility option) is disabled using documented methods. No change.
- Tried different keyboards on the host system. No change.
- Re-installed the VirtualBox Guest Additions (as root) several times No change.
- Launched other guest Ubuntu OS instances in VirtualBox. Keyboard works fine in other guests. So I don't think this is a VirtualBox host plumbing problem.
- EDIT: And (per ObsessiveSSOℲ suggestion) uninstalled Ubuntu Guest Additions by running /opt/VBoxGuestAdditions-4.2.6/uninstall.sh as root and rebooting. No change.
I'm lost here. What else should I check to diagnose a keyboard problem like this in Ubuntu? I'm thinking it's a driver or configuration problem.
Are there specific logs or utilities that might help pinpoint this problem?
Edit1 - F-Lock key not the problem
Update: A bit more searching revealse these resources:
- Virtual terminal not working
Is the lame F-Lock key causing the problem? No, that's the first thing I checked, and plugging in an older USB keyboard that doesn't have the F-Lock key -- no change. But it mentions using
evtto monitor events, and additional resources...
- A mail archive discussing the F-Lock key virtual terminal key breakage...
sudo chvt 1, I am able to access a virtual terminal and the keyboard input works in the virtual terminal. Perhaps this is an X keyboard mapping problem...
Edit2 - xev shows now keyboard events
xev shows no keyboard input events. Strange.
Edit3 - Upgrade to 12.04 fixes keyboard input, slow keys may be triggered silently
'Upgrading' the VirtualBox guest instance to 12.04 (Precise) 'fixed' the problem. But this doesn't tell me why the problem existed in the first place, though now I know it's not a VirtualBox problem.
In addition, I found this freedesktop.org issue of recent vintage and this Redhat issue indicating that the slow keys feature may have been triggered somewhere silently with no log entry, and that changing the settings to disable slow keys may not actually disable it. The investigation continues...
Edit4 - verify low-level keyboard input
hd /dev/input/by-path/platform-i8042-serio-0-event-kbd as root shows incoming data when keys are pressed inside Gnome desktop. Source: superuser.com
Edit 5 - /lib/udev/findkeyboards shows no keyboards
Following the Ubuntu wiki's Hotkeys troubleshooting advice through step 5 -- per Fixing broken keys in
/lib/udev/findkeyboards (as normal user or root) shows no output (exits with no messages.)
Edit 6 - Giving up (for now)
I don't have time to figure this out, so I'm going to create a new VirtualBox guest with 12.04 and migrate to that version. I'll keep the old instance around to ease the transition.
If someone posts troubleshooting suggestions, I'll try them on my archived 11.04 Ubuntu install and I'll report the results here.
Thanks for the suggestions!