Bug 606514

Summary: < and > keys produce wrong keycode in virtual machine
Product: [Fedora] Fedora Reporter: Matti Lehti <malehti>
Component: gtk-vncAssignee: Daniel Berrangé <berrange>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: berrange, clalance, crobinso, itamar, jforbes, mclasen, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-14 21:16:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
showkey -a output in virtual machine
none
showkey -a output in Fedora 13
none
virsh dumpxml $GUESTNAME output
none
/var/log/libvirt/qemu/$GUESTNAME.log file none

Description Matti Lehti 2010-06-21 20:31:50 UTC
Created attachment 425736 [details]
showkey -a output in virtual machine

Description of problem:
In Fedora 13 desktop my keyboard works correctly, but inside any OS run as virtual machine in same box (DOS 7.1, Gentoo, Ubuntu, FreeBSD) pressing keys "<" and ">" produce z and X.

Version-Release number of selected component (if applicable):
libvirt-0.7.7-4.fc13 (x84_64)
libvirt-client-0.7.7-4.fc13
virt-manager-0.8.4 (x84_64)

How reproducible:
always

Steps to Reproduce:
1. Use any os in virtual machine
  
Actual results:
press key < (left side of z): z
press key > (left side of z with shift): X

Expected results:
press key < (left side of z): <
press key > (left side of z with shift): >


Additional info:
I tested with both finnish and US keyboard layouts in F13 and virtual machines: always same behavior.
Pressing the same key with alt-gr produces "|" as it should.
See attached .png files for showkey -a output.

Comment 1 Matti Lehti 2010-06-21 20:33:04 UTC
Created attachment 425738 [details]
showkey -a output in Fedora 13

Comment 2 Daniel Berrangé 2010-07-12 17:21:25 UTC
Please provide the following extra info

 - virsh dumpxml $GUESTNAME
 - The corresponding /var/log/libvirt/qemu/$GUESTNAME.log file from starting the guest

Comment 3 Matti Lehti 2010-07-13 18:54:35 UTC
Created attachment 431556 [details]
virsh dumpxml $GUESTNAME output

Added virsh dumpxml output as attachment.

Comment 4 Matti Lehti 2010-07-13 18:57:15 UTC
Created attachment 431559 [details]
/var/log/libvirt/qemu/$GUESTNAME.log file

Comment 5 Daniel Berrangé 2010-07-14 10:00:49 UTC
The graphics tag for the guest has an explicit keymap set:

    <graphics type='vnc' port='5900' autoport='yes' keymap='fi'/>

This breaks the automatic scancode mapping that is necessary to get a properly functional keyboard. Shutdown the guest, then use 'virsh edit $GUESTNAME' and remove the keymap='fi' attribute. Then it should be possible to get correct keymap behaviour simply by setting the keymap inside the guest OS.

NB this requires use of virt-manager or virt-viewer or vinagre.  Traditional vnc clients like TightVNC will never work properly with non-US layouts.

Comment 6 Matti Lehti 2010-07-14 21:07:03 UTC
After manually removing the keymap='fi' attribute keyboard works ok in guest OS.

I created the guests using Virtual Machine Manager 0.8.4, which seems to generate this attribute while host keyboard layout is not "us".

Comment 7 Cole Robinson 2010-07-14 21:16:21 UTC
Sounds like you are hitting 586201

*** This bug has been marked as a duplicate of bug 586201 ***