19 Sep 2009

djwong: (Default)
Now that you have VMX working, you might notice that kvm/qemu's PS/2 mouse emulation sucks. The VM's mouse cursor totally does not follow the host's mouse cursor at all! That's a horrid mess; how would we clean that up? The ugly hack is to disable PS/2 mouse emulation and present a USB tablet instead:

$ kvm -usb -usbdevice tablet

Now, why is PS/2 mouse emulation messed up in the first place? It turns out that PS/2 mice do not report absolute coordinates; they only tell the OS about relative changes in position. "Two steps up" "Seventeen steps to the right" etc. This is fine with a physical mouse because the physical mouse moves in an arbitrarily defined rectangle that is separate from the screen. The mouse is not placed directly on the screen, so there is no need to know the absolute position of the physical mouse on the screen. In the case of a VM, however, we know the absolute position of the (host) mouse on the screen. Tablets provide a fixed size rectangle with absolute coordinates, and that's why they (should) work better.

Obvious caveat: The VM's graphical windowing system must know about USB and tablets. Allegedly X.org is not good at that, though Windows is.

Update: Recent Ubuntu X.org seems to work....

Profile

djwong: (Default)
Bogus J. Simpson

May 2016

S M T W T F S
1234567
891011121314
15161718192021
2223242526 2728
293031    

Style Credit

Expand Cut Tags

No cut tags
Page generated 1 Sep 2025 16:43
Powered by Dreamwidth Studios