How do I get my mouse back from QEMU/KVM?

Keyboard methods

  1. If using the SDL frontend of QEMU:

    You can release focus using the Left Ctrl+ Left Alt. Notice you have to use the left keys!

  2. If using the GTK frontend of QEMU (default since QEMU 1.5):

    Press Ctrl+ Alt+ G

Focus free method

See my question I posted on this exact thing on ServerFault. The Q&A is titled: Any way to release focus on a KVM guest in virt-manager without having to click Ctrl_L + Alt_L?. This will allow you to no longer have to use the keyboard to release focus between the host and the guest.

There are 2 methods discussed in answers to the question. The first involves adding another mouse, the other makes use of Spice which allows for smooth focus transitions between the host and the guest.


Depending on which linux guest you have, install the qemu-guest-agent package, run systemctl enable qemu-guest-agent, stop your vm, and then according to this RH KB article, add the following to your vms xml config:

<channel type='unix'>
  <target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>

Then restart your vm. If you can mouse into the vm, mouse out, even copy/paste.


if someone has using qemu in osx, then he needs to press control+option+g to get the mouse pointer back to the host.

Tags:

X11

Mouse

Qemu

Kvm