[ 
https://issues.apache.org/jira/browse/GUACAMOLE-609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16580177#comment-16580177
 ] 

Michael Jumper commented on GUACAMOLE-609:
------------------------------------------

The difference here is actually in whether the VNC client supports QEMU's 
extension to the VNC protocol which allows keys to be sent with scancodes 
rather than keycodes:

https://github.com/rfbproto/rfbproto/blob/e4984de15832285df6f3ecfcaa6815a7d32239dd/rfbproto.rst#qemu-extended-key-event-message

The library Guacamole currently uses for VNC support, libvncclient, does not 
have support for this message, so adding support would likely mean migrating 
away from that library. This may well be necessary for adding other VNC 
protocol extensions not supported by libvncclient.

The issue you're encountering is not actually due to Guacamole not having the 
correct layout (VNC does not depend on keyboard layout and the Guacamole client 
is independent of keyboard layout), but rather QEMU being configured to expect 
that the client has a particular layout. For VNC clients which do not support 
QEMU's scancode extension, QEMU must translate key events into scancodes based 
on its own internal keymap. If that keymap does not actually match the layout 
selected within the guest OS, or you change the layout after the fact, this 
translation will fail and you will see strange effects like you've described.

In this case, the sequence of events actually is:

# You press "A" on your local azerty keyboard. Guacamole reads this as an "A" 
keypress and sends it as such.
# The Guacamole server receives your "A" keypress and sends it to the VNC 
server (QEMU) as an "A" keypress.
# QEMU receives the "A" keypress from Guacamole and needs to translate it into 
a scancode. It looks at the settings for the virtual machine, which is set 
either explicitly or by default to assume that the keyboard layout is qwerty. 
It sends the scancode for an "A" on a qwerty keyboard.
# The guest OS is configured for azerty. When it receives the scancode from 
QEMU, that scancode actually represents "Q".

> Wrong keyboard layout with qemu vnc
> -----------------------------------
>
>                 Key: GUACAMOLE-609
>                 URL: https://issues.apache.org/jira/browse/GUACAMOLE-609
>             Project: Guacamole
>          Issue Type: Bug
>          Components: guacamole, VNC
>    Affects Versions: 0.9.14
>         Environment: Parrot VM inside KVM-QEMU
>            Reporter: faelis
>            Priority: Major
>
> When guacamole is connected to a VM running inside qemu using the built in 
> VNC, my physical azerty keyboard looks like acting as a qwerty keyboard.
> If the layout inside the VM is set to qwerty it works nearly correct.
> If the layout inside the VM is set to azerty it doesn't work (a=q,z=w, 
> etc...).
> If I use novnc instead of guacamole, the keyboard works fine.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to