Skip to content

VirtualBox detects US keyboard while all other application use local (german)

Problem:
VirtualBox detects US keyboard while all other application use local (german) keyboard layout

Keyboard Mapping in VirtualBox:
– VNC sends keysym (http://vncdotool.readthedocs.io/en/0.8.0/rfbproto.html#keyevent)
– Virtualbox starts keyboard detection when virtual machine is started to convert keysym (X11 codes, also send by VNC) to key codes
– Additional logging can be enabled by LOG_KB_SECONDARY=1 (https://forums.virtualbox.org/viewtopic.php?f=7&t=15077)

VirtualBox-5.2.12\src\VBox\Frontends\Common\VBoxKeyboard\keyboard.c

X11DRV_KEYBOARD_DetectLayout() detects keyboards defined in
– VirtualBox-5.2.12\src\VBox\Frontends\Common\VBoxKeyboard\keyboard-tables.h
– VirtualBox-5.2.12\src\VBox\Frontends\Common\VBoxKeyboard\keyboard-list.h
– VirtualBox-5.2.12\src\VBox\Frontends\Common\VBoxKeyboard\keyboard-layouts.h

VirtualBox uses deprecated function XKeycodeToKeysym() which relies on Display setting of Linux operating system
https://www.systutorials.com/docs/linux/man/3-XKeycodeToKeysym/

Keyboard configuration can be checked and modified with

https://wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg

View: setxkbmap -print -verbose 10

Leave a Reply