9

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.

0

2 Answers 2

9

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.

'-usbdevice' is deprecated since about 2018 year. Use '-device usb-tablet' instead. Example based on article. Tested with QEMU emulator version 8.0.50 (v8.0.0-918-g6972ef1440).

qemu/build/qemu-system-aarch64 \
-m 1024 \
-M raspi3b \
-kernel $TMP/boot/kernel8.img \
-dtb "$TMP/boot/bcm2710-rpi-3-b-plus.dtb" \
-drive file="$IMAGE_FILE",if=sd,format=raw \
-append "console=ttyAMA0 root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4" \
-device usb-net,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::5555-:22 \
-device usb-mouse -device usb-tablet -device usb-kbd
4
  • 3
    Can you add more details to this? In my version of qemu (in the question), I get the errorqemu-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'.
    – Michael A
    Commented Dec 4, 2019 at 19:15
  • I edited the question to emphasize that the -usbdevice tablet option doesn't appear on my system and therefore this answer doesn't solve the problem.
    – Michael A
    Commented Dec 5, 2019 at 14:11
  • 1
    @MichaelA, i've older version of qemu. have you tried eg. -device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0?
    – bandie
    Commented Dec 5, 2019 at 15:42
  • Thanks, bandie. I just tried those commands but the issue persists. Maybe TinyCore doesn't have tablet support? I wouldn't expect it to.
    – Michael A
    Commented Dec 5, 2019 at 18:56
8

Michael A, you have to add a usb-device first.

  • -device nec-usb-xhci,id=usb,bus=pci.0,addr=0x4 for usb 3.0 or
  • -device usb-ehci,id=usb,bus=pci.0,addr=0x4 for usb 2.

Then you can pass -device usb-tablet.

1
  • This works for me.
    – joan16v
    Commented Apr 18 at 15:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .