Host mouse pointer not aligned with guest mouse pointer in Qemu VNC

mouseqemuvirtual machinevnc

When I run Tiny Core Linux in a Qemu virtual machine, the guest mouse pointer is severely misaligned with the host mouse pointer. In the screenshot below, the guest mouse pointer is the one in the image. The red dot marks the location of the host mouse pointer.

I create the Qemu disk image with this command:

qemu-img create disk.img 500M -f qcow2

and launch the virtual machine with this command:

qemu-system-x86_64 -m 1024 -boot d -enable-kvm -smp 3 -net nic -net user -hda disk.img -cdrom TinyCore-current.iso

That starts a VNC session running on ::1:5900, which I access with Remmina by specifying localhost:5900 as the server.

I'm using Remmina 1.3.3, Qemu 1.3.1, and Debian 10 ("Buster"). How do I correctly align these mouse pointers? The guest machine is difficult to use when they're misaligned.

EDIT: This issue also shows up in TigerVNC Viewer 64-bit v1.9.0, so it seems like it isn't a Remmina problem, but rather a Qemu problem.

host mouse pointer misaligned with guest mouse pointer

EDIT: To clarify, in my version of qemu , I get the error qemu-system-x86_64: -usbdevice tablet: '-usbdevice' is deprecated, please use '-device usb-...' instead, but when I use the -device usb-tablet option I get the error qemu-system-x86_64: -device usb-tablet: No 'usb-bus' bus found for device 'usb-tablet'. I've seen this suggestion on this site and elsewhere, but it doesn't seem like it's a proper, compatible solution to my problem.

Best Answer

it's because generic mouse hardwares only send movement events, ie. relative positioning device. so when qemu gets the absolute mouse position on its vnc interface, it can not do the same by the emulated mouse, it only sends the relative movement, because this is what generic hw mice do.

however you can emulate absolute positioning device by -usbdevice tablet option. if you're lucky the guest OS also supports it.

Related Question