[Bug 1787267] Re: Can't type | ( pipe ) over vnc

 Christian Ehrhardt  1787267 at bugs.launchpad.net
Thu Aug 23 12:18:34 UTC 2018


I tested a matrix of:
- ubuntu/xubuntu/lubuntu
- vga qxl / vga virtio
- keymap de / en-us / none
- input host keymapping de / en-us
- xtightvncviewer / tigervnc-viewer / spicy

Silly helper to spawn all of these:
#!/bin/bash
runguest () {
    local prefix=$1
    local kbd=$2
    local idx=$3
    local lidx=$(printf "%02d" $3)
    local vga=$4

    local cmd="qemu-system-x86_64 -spice port=50${lidx},password=pw -vga
${vga} -vnc :${idx}"

    if [ "${prefix}" == "u" ]; then
        realprefix=""
    else
        realprefix="${prefix}"
    fi
    cmd="${cmd} -cdrom ${realprefix}ubuntu-18.04-desktop-amd64.iso"

    if [ -n "${kbd}" ]; then
        cmd="${cmd} -k ${kbd}"
    else
        kbd="none"
    fi

    cmd="${cmd} -name '${lidx}-${prefix}-${kbd}-${vga}'"

    ${cmd} &
}

runguest "u" "de"     1 "qxl"
runguest "l" "de"     2 "qxl"
runguest "x" "de"     3 "qxl"
runguest "u" "en-us"  4 "qxl"
runguest "l" "en-us"  5 "qxl"
runguest "x" "en-us"  6 "qxl"
runguest "u" ""       7 "qxl"
runguest "l" ""       8 "qxl"
runguest "x" ""       9 "qxl"
runguest "u" "de"    11 "virtio"
runguest "l" "de"    12 "virtio"
runguest "x" "de"    13 "virtio"
runguest "u" "en-us" 14 "virtio"
runguest "l" "en-us" 15 "virtio"
runguest "x" "en-us" 16 "virtio"
runguest "u" ""      17 "virtio"
runguest "l" ""      18 "virtio"
runguest "x" ""      19 "virtio"

Results are a quadruple of DEl-DEk/DEl-USk/USl-DEk/USl-USk in this order
With the first element defining the clients current keyboard alyout (a.k.a. what is on my system)
DEl = German layout, USl = EN-US Layout
The second is the actual key pressedwith
DEk = AltGr+<, USk Shitf+# (on my German keyboard equaling the keycode for a | on en-us).
X means the key gave some odd control char or something like that.

After a while it became clear that the UI had no effect, so I skipped
further U/X/Lubuntu differences

                    tight    tiger    spicy
1  U-DE-QXL         <|<>     <|<>     <|<|
2  L-DE-QXL         <|<>     <|<>     <|<|
3  X-DE-QXL         <|<>     <|<>     <|<|
4  U-US-QXL         <"<>     <"<>     <|<|
7  U-No-QXL         <"<>     <"<>     <|<|
11 U-DE-VIRTIO      <|<>     <|<>     <|<|
14 U-US-VIRTIO      <"<>     <"<>     <|<|
17 U-No-VIRTIO      <"<>     <"<>     <|<|

Insights:
- Spice ignores every config and behaves like a us querty keaboard.
- The VNC implementations has no influence
- The vga mode has no influence
- The Ubuntu Desktop type has no influence
- If US or no keycode is set then the none of the keys in vnc mode maps to a "|", instead it is a "
- With a en-us keyboard layout on the Client I can't reach a "|"

With the insights above the interesting tests after update from the PPA
will be:

                    tight    tiger    spicy
1  U-DE-QXL         <|<>     <|<>     <|<|
4  U-US-QXL         \"\|     \"\|     <|<|
7  U-No-QXL         \"\|     \"\|     <|<|

That would confirm that now qemu VNC with en-us keymaps (or not set) would have a keycode on US keyboard layouts to reach the | character.
Interestingly the very same change made it unreachable for non-US layout (client) to reach the | if no keymap or an en.us keymap is set.

But that is probably ok as -k is exactly meant to override the keymaps
(default en-us) for those cases (VNC + client non en-us).

Hrm, that seems sort of ok (better now than before testing for sure) -
I'm still feeling unsure how much potential regression that might be for
others.

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1787267

Title:
  Can't type | ( pipe ) over vnc

Status in qemu source package in Bionic:
  In Progress
Status in qemu source package in Cosmic:
  Fix Released

Bug description:
  [Impact]

  After upgrading from 16.04 to 18.04, users are unable to type a | or >
  in their virtual machines when accessing them via vnc.  This happened
  because upstream added a key to the keymap that can also produce these
  symbols and exists only on European keyboards, but it uses different
  modifier keys to produce these symbols so trying to type a | or a >
  results in a < instead.  Simply removing this new non-existent scan
  code from the keymap resolves the issue.

  [Test Case]

  Start a virtual machine and connect to it via vnc.  I am using
  "tightvnc" on Windows, and upstream indicated that some vnc clients
  send the raw scan code instead of keysyms, in which case this issue
  would not arise.

  [Regression Potential]

  There should be no regression potential for actual en-us keyboards
  since this key does not exist.  European keyboards may be unable to
  use this other key they have unless they set the correct keymap, but
  all of its symbols are duplicates from other keys on the keyboard,
  rendering it fully redundant.

  [Notes]

  Upstream has already added logic to pick the mapping the matches the
  current modifier keys to resolve this, so cosmic should be unaffected
  and so this patch only applies to bionic.

  [Original Description]

  I tried booting some Ubuntu images today on my Xen server where I use
  VNC to remotely access the VM, and am unable to type a | ( pipe ).  I
  opened the keyboard layout utility and when I press the \ key, it
  recognizes it, but when I hold shift and press the key, it claims that
  I am pressing some key between left shift and Z that does not actually
  exist on US keyboards, and that types a > instead.

  This did not used to happen, and probably started when I upgraded the
  server from 16.04 to 18.04 a while back and I just haven't been
  testing VMs since then.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/bionic/+source/qemu/+bug/1787267/+subscriptions



More information about the Ubuntu-sponsors mailing list