Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I just installed VirtualBox (from Oracle) in Windows 7, and created a virtual machine with latest Ubuntu.

Here in Firefox I can use the left ctrl key, while the right one doesn't have any effect. However, I can't use the AltGr key (also known as Right Alt) to produce e.g. curly braces like {} (I pasted that via ctrl+v).

In a terminal window I can switch the "Input method" to "Multipress", and then I can use AltGr to type e.g. {}, which is how I produced those characters for this posting. However, with "Multipress" the ctrl keys seem to have no effect whatsoever. So in order to e.g. type ctrl+D I have to right click and switch the "Input method" to "System (IBus (Intelligent Input Bus))". Then AltGr does not work.

I tried specifying the compose key in the system settings keyboard layout.

With that, neither Ctrl nor AltGr worked.

Here's what xmodmap reports:

$ xmodmap -pke | grep -i control
keycode  37 = Control_L NoSymbol Control_L
keycode 105 = Control_R NoSymbol Control_R
$ xmodmap -pke | grep -i alt
keycode  64 = Alt_L Meta_L Alt_L Meta_L
keycode 204 = NoSymbol Alt_L NoSymbol Alt_L
$ _

How can I fix this?

Additional info: the keyboard is a standard PC keyboard, a Logitech K120, with Norwegian layout.

Also, I first tried asking this question over at the Superuser site but no response after 2 days...

share|improve this question

closed as off topic by Marco Ceppi Mar 6 '12 at 2:10

Questions on Ask Ubuntu are expected to relate to Ubuntu within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

I got the AltGr key working in Ubuntu. I just had to know that I should create a file called ".Xmodmap" and add this line: "keycode 113 = Mode_switch Multi_key". Which I found in a bug report about a similar issue, at… – Alf P. Steinbach Nov 12 '11 at 11:11

2 Answers 2

Right control is used in virtualbox for some commands such as change to full screen mode or change to seamless mode.

So that may be why its disabled within the virtual environment...

share|improve this answer
As I understand that thing about .Xmodmap is wholly an Ubuntu issue. Actually there's a long history of some elusive bug being closed as resolved then reopened and so on and on. But I also found that VirtualBox has had issues with AltGr key. – Alf P. Steinbach Nov 12 '11 at 11:35

AltGr is a shorthand for CtrlAlt on some western european keyboards. In windows, where there is still compatibility to older XT/AT-keyboards that did not have the key at all, they are still interchangeable (Both AltGrE and CtrlAltE yield €). VirtualBox being a windows only shop in its beginngings, has just picked its 'host' key very linux-unfriendly.

Remap the 'host' key in VirtualBox to e.g. 'right context menu' and your AltGr key should be back in operation.

share|improve this answer
Thanks, but if you look at the comment I placed on the question before anyone had answered, you'll see that it apparently was wholly an Ubuntu issue. An Ubuntu Heisen-bug. However, VirtualBox seems to have a corresponding set of bugs, and I'm not totally discounting the notion that VirtualBox may have been involved and/or caused me to misinterpret something. – Alf P. Steinbach Nov 15 '11 at 3:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.