Add -usbdevice tablet to KVM when using vnc
authorApollon Oikonomopoulos <apoikos@gmail.com>
Wed, 24 Mar 2010 15:40:31 +0000 (17:40 +0200)
committerGuido Trotter <ultrotter@google.com>
Wed, 21 Apr 2010 14:48:53 +0000 (15:48 +0100)
When using VNC, it is recommended to use a tablet-style
input device instead of a mouse. This allows most VNC viewers
to send proper mouse coordinates to the virtual machine's desktop
resulting in perfectly aligned guest and host mouse pointers.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/hypervisor/hv_kvm.py

index 1fa6f1e..469f857 100644 (file)
@@ -497,6 +497,10 @@ class KVMHypervisor(hv_base.BaseHypervisor):
         vnc_arg = 'unix:%s/%s.vnc' % (vnc_bind_address, instance.name)
 
       kvm_cmd.extend(['-vnc', vnc_arg])
+
+      # Also add a tablet USB device to act as a mouse
+      # This solves various mouse alignment issues
+      kvm_cmd.extend(['-usbdevice', 'tablet'])
     else:
       kvm_cmd.extend(['-nographic'])