Virt-Manager – How to Fix Two Mouse Cursors Issue

linuxlinux-kvmmousevirt-managervirtual machine

I created a VM (host: Fedora 25, guest: LUbuntu 16.10) using virt-manager. When I start it and click on the window, I see two cursors: one host cursor and another guest cursor:

There are two mouse pointers

The movement of the guest cursor is restricted by the host cursor because it can't leave the screen boundaries. Also, sometimes the guest cursor doesn't appear and then I can't use mouse to interact with the guest (the keyboard still works). The offset of cursors isn't constant. I can move the guest cursor around the host cursor by moving the mouse fast in one direction and then slow in the opposite.

How can I make the host cursor disappear when I want to interact with the guest?

Best Answer

This is an issue with KVM, not just virt-manager.

It's possible to fix on the command-line for users not using virt-manager:

  1. Shut down your VM
  2. Enter the following on the host command-line:

    GUEST=your-vm-name
    virsh dumpxml "${GUEST}" > "/tmp/${GUEST}.xml"
    
  3. Open "/tmp/${GUEST}.xml" in any text editor (e.g. nano, vim).
  4. Within the <devices> tag, add this line (preferably near the other <input> tags):

    <input type='tablet' bus='usb'/>
    
  5. Enter the following on the command line to update the VM guest configuration:

    virsh define "/tmp/${GUEST}.xml"
    
Related Question