kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.11k stars 364 forks source link

Allow per guest and template VNC keymap settings #1090

Open BentHaase opened 7 years ago

BentHaase commented 7 years ago

Currently, you can only set the keyboard layout for a guest using virt-manager or virsh on the host.

Please allow setting the keyboard layout when editing a guest + when creating a template.

Wok Version: 2.3.1-0
Kimchi Version: 2.3.1-0
HV OS: Ubuntu 16.04.1
virsh 1.3.1
libvirt 1.3.1
danielhb commented 7 years ago

Although I don't see any problems in developing this feature, I'll mention here that this 'keymap' option in both virt-manager and virsh isn't supposed to be used in newer virtual machines.

This is a legacy option that was used when QEMU keyboard handling was relying on the keymap of the VNC client. This became a problema because QEMU supports 30 or so layouts and in current Gnome we have more that 500+. To solve this problem, the QEMU community developed an extension of the VNC protocol that eliminated the need of knowing the client layout, and QEMU started to send just the physical position of the keys. With that, all you have to do is to match the keyboard layout in the guest OS with your own.

noVNC, the VNC web client Kimchi uses, started to support this extension last year. So, for any new VMs in Kimchi, you can simply ignore altogether this keymap configuration. Adding this configuration in the VM can cause problems if the VNC client uses a different keymap (to change this option the VM would need to be rebooted) and, honestly, you gain nothing but inconvenience by using it. Forget about this option, just match the guest OS keymap with your own keymap and you're set. If you connect using a different layout, just change the guest OS layout too. No reboot needed.

All that said, as long as the option is defaulted to disabled in any newly created template, I see no harm in adding this configuration setting to support some legacy VM scenario that, for some reason, can't get rid of the QEMU keymap option.