Page 1 of 1
Using the Same Keybord Layout of the Host in the Guest OS
Posted: 18. Jun 2012, 11:34
by mt22
I'm using Virtualbox 4.1.12 on Debian x64 and my host OS is Windows XP Professional 64-bit.
On Debian I'm using a custom keyboard layout that I set on system startup through setxkbmap.
I've already successfully installed the guest addictions.
I would like to use the same keyboard layout of the host in the guest OS.
How can I do?
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 18. Jun 2012, 13:17
by mpack
That is not really a VirtualBox question, it's a question of correctly configuring Windows. You need to select the correct keyboard layout inside the guest. See the guests Control Panel, Keyboard. Other guests should have similar configuration features.
I am not promising that the correct keyboard layout is available, also note that creating custom keyboard layouts for Windows is beyond the scope of these forums.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 18. Jun 2012, 13:52
by mt22
mpack wrote:You need to select the correct keyboard layout inside the guest. See the guests Control Panel, Keyboard. Other guests should have similar configuration features.
Are you saying that if I use a custom keyboard layout in the host is should appear somewhere in the guest configurations (Windows control panel in this case)? Or Do have I necessarily to recreate that layout on the guest?
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 18. Jun 2012, 14:29
by mpack
I'm saying that the guest has its own (virtual) keyboard, and it's own mapping from scancodes --> characters. The mapping used by the host is not relevant to the guest, any more than it would be relevant to a second physical PC. Usually however the correct mapping is dictated by the markings on the keytops, so host and guest will normally use similar though independant mappings.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 18. Jun 2012, 14:49
by mt22
Ok, thanks for your help. So at the end I understand I have to recreate my custom layout in the guest OS... if I'm wrong correct me.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 11:24
by mt22
Today I've installed a Linux guest (another Debian x64) and I noticed that the guest immediately recognized and used my custom keyboard layout... so why on Windows guests it does not happen??? ...I think this is a VirtualBox question and not an OS one, since I have different behaviors with different guests and that's strange.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 11:51
by mpack
Sorry, I don't know what you are seeing, but AFAIK, what I said above is accurate.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 14:23
by mt22
mpack, I wouldn't like to bother you, however I've also just tried the combination Debian x64 (host) and Fedora 17 (guest) and it worked as well... Fedora automatically detected my keyboard layout... I really don't get it, how can it be that it works fine for Linux guests and it doesn't for Windows?
Thanks for your patience.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 14:27
by michaln
Linux doesn't detect the keyboard layout. You tell it what it is. So when you first installed your Linux VM, which keyboard layout did you select?
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 14:41
by mt22
michaln thanks for help.
In my host OS (Debian) I use a custom version of the UK Layout (I remapped the modifiers... for example I've the CapsLock key remapped to Escape).
When I install a new Linux guest I only select the UK layout.... however all my customizations to modifier keys are automatically detected as well, in fact if I test them with the xev command and I press for example CapsLock it is actually Escape.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 15:12
by mpack
Is this special keyboard? If the keyboard scancodes were configurable in hardware then its possible that a guest would be affected by the configuration. But in that case the Windows guest would have seen the same scancodes.
Did you have Guest Additions installed in all the guests you are comparing?
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 15:30
by michaln
mpack wrote:Did you have Guest Additions installed in all the guests you are comparing?
Why would that make any difference? There's nothing the GAs do to keyboard input.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 15:36
by mt22
mpack wrote:Did you have Guest Additions installed in all the guests you are comparing?
Thanks!!! I reinstalled the guest addictions on Windows XP and I seems like It automatically uses my layout now! Probably Something has gone wrong the first time I installed them.
Re: Using the Same Keybord Layout of the Host in the Guest O
Posted: 19. Jun 2012, 16:06
by mt22
michaln wrote:mpack wrote:Did you have Guest Additions installed in all the guests you are comparing?
Why would that make any difference? There's nothing the GAs do to keyboard input.
I don't know what GA exactly do in... but reinstalling them worked for me.
Anyway all this discussion made me doubt... if I didn't misunderstand you are saying that VirtualBox has nothing to do with keyboard layouts at all... but now my modifiers key are correctly detected on all my guests.
So is my current situation really abnormal? Or better: According to you if I press a remapped key is it not possible that now I've the same behavior in both my host and guest os? Because if so, I don't know if that's a VirtualBox bug or if it is a problem somewhere in my computer.