Xmodmap on Ubuntu 9.04 host/Win XP guest, suddenly broken

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Jenda
Posts: 5
Joined: 15. Oct 2009, 20:00
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Xmodmap on Ubuntu 9.04 host/Win XP guest, suddenly broken

Post by Jenda »

Hi,

I am using a modified dvorak layout on Ubuntu 9.04, with the help of a .xmodmap file which took years (literally) to make and fine-tune. I use Ubuntu as my main and only OS. However, I recently got a job/deal for which I NEED to run Microsoft Office 2007, and it has proved most convenient to run it in XP in VirtualBox. It has been working perfectly for a few weeks now (and I got a lot of work done thanks to it, too ?)

Occasionally, however, the guest system has started to ignore some of the keys (most that differ from default dvorak, although some have stayed, e.g., the Super modifier), but started working later (either by re-loading the xmodmap file, rebooting either OS or saving&restoring the virtual machine state. Now, however, it has happened again and doesn't seem to want to get better no matter what I do.

I believe it has some connection with XP's own keyboard layout, as it is the keys that the default layout doesn't have that don't work, with the exception of modifiers (which, AFAIK, the windows keyboard setup doesn't change). I also think I might've updated to a newer virtualbox version somewhere in the process.

Any suggestions about how to fix this? Thanks in advance ?
Jenda
Posts: 5
Joined: 15. Oct 2009, 20:00
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Xmodmap on Ubuntu 9.04 host/Win XP guest, suddenly broken

Post by Jenda »

OK, this is what happened since I wrote that message:
1) I renamed .VirtualBox to BAK.VirtualBox, so VB had to create new config files. I reconnected the original .vdi and voila - keyboard worked!
2) Keyboard stopped working for no apparent reason.
3) I repeated 1), but that didn't help. Tried reinstalling vbox and still nothing.
4) Rebooted Ubuntu and voila, keyboard worked again!
5) Tried reloading .xmodmap file, altering it (changing the CapsLock key to be a Mode_switch), reloading... no problem, still works. I still have no idea what breaks it and a very vague one what fixes it.

FYI - the keys that always work are the alphabetical ones. The ones I know not to work are ?š??žýáí (on the number row), numbers and "-", right next to Enter on dvorak.

Grateful for any help ?
Jenda
Posts: 5
Joined: 15. Oct 2009, 20:00
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Xmodmap on Ubuntu 9.04 host/Win XP guest, suddenly broken

Post by Jenda »

Broken again, and this time, I haven't changed ANYTHING. I saved the machine state yesterday and booted it up this morning, and it was broken again. Rebooting Ubuntu doesn't help now, neither does rebooting the VM or resetting vbox settings.

Isn't there anyone who could at least explain to me how vbox handles custom keyboard layouts? How it is possible that it works? Perhaps then I might be able to find out myself why it breaks.
Jenda
Posts: 5
Joined: 15. Oct 2009, 20:00
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Xmodmap on Ubuntu 9.04 host/Win XP guest, suddenly broken

Post by Jenda »

A helpful person on IRC just suggested I try using the custom layout only in XP, an idea that hasn't occured to me before. After renaming my default xmodmap file and logging in and out of ubuntu, not only did my layout revert to default dvorak, but XP also became capable of using my custom layout (made with MS keyboard layout creator). When I then loaded the xmodmap file, Windows maintained its ablity to switch between layouts and use them (and ignore the host settings), which is just as good as if it used host settings and ignored guest settings.
I suppose this means staring vbox with no xmodmap file loaded solves the problem ad-hoc.
Jenda
Posts: 5
Joined: 15. Oct 2009, 20:00
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Xmodmap on Ubuntu 9.04 host/Win XP guest, suddenly broken

Post by Jenda »

I think I finally solved the issue. A hack, but works. It just so happens that when I unplug my wireless keyboard receiver, Ubuntu detects it as a EN_US keyboard and reverts to that. It also just happens that when Ubuntu is set to EN_US when vbox starts, everything works fine for the duration of the session. Therefore, whenever the issue emerges, I can:
  • save machine state
  • unplug wireless keyboard
  • plug wireless keyboard
  • resume machine state
  • load my xmodmap file
  • get back to work
I hope this thread will help someone in the future (although I doubt it ?)
Post Reply