[vfio-users] Virtual USB Keyboard and Mouse for guest?

Jonathan Scruggs j.scruggs at gmail.com
Tue Sep 1 15:00:13 UTC 2015


I have thought of this. They way I thought of with my idea, was that both
the host and the guest would see the keyboard and mouse, it's just the
buffer that moves between the two. One computer would just stop receiving
the inputs as if no typing or mouse movement. This would be an
instantaneous switch then all in software.

I've been looking and there is something about keyboards use a buffer in
Linux, so it might be possible to direct the main buffer to either the host
or guest buffers for virtual devices.

Jon

On Tue, Sep 1, 2015, 3:36 PM Abdulla Bubshait <darkstego at gmail.com> wrote:

> I have come across this very issue. While you can elevate the Synergy
> privileges on the guest it still incorporated lag and other strange issues
> that made it less than ideal for gaming. The solution was moving the
> synergy server to the windows guest and the linux host becomes the synergy
> client.
>
> I guess you could pass through the keyboard and mouse as usb devices to
> the VM on start and have synergy to control the host while the VM is
> running. That should resolve most of the issues you come across.
>
> My personal solution was getting a usb controller and usb switch and
> passing the entire controller to the guest, which does the exact thing you
> are asking for except with hardware rather than software. And I still run
> synergy alongside this in the manner I described earlier (guest runs
> server, host runs client). The reason is attaching and detaching USB
> devices takes a relatively long time (3-5 seconds), that might not sound
> like a lot, but trust me, if you want to quickly between the two desktops
> it gets really annoying really fast. You will need a solution like synergy
> not just for things like clipboard sharing, but for fast switching of mouse
> and keyboard between the two devices.
>
> -Abdulla
>
> On Tue, Sep 1, 2015 at 4:07 AM Jonathan Scruggs <j.scruggs at gmail.com>
> wrote:
>
>> Hi,
>>
>> Nice to meet others as well. :)
>>
>> Well, at the moment, I have Synergy set up so that I need a key
>> combination to switch computers anyways. Synergy allows you to define your
>> own combination, and I would hope that my idea would allow for the defining
>> of custom combinations to minimize those types of gotchas. I was also
>> thinking that usb pass through of a keyboard and mouse would have less
>> latency than Synergy, but I only want to have one keyboard and mouse on my
>> desktop. Also, a usb KM switch would take up multiple usb ports instead of
>> just one or two. A wireless desktop set would have one usb receiver, so it
>> makes a slick system.
>>
>> Even if this isn't built into qemu/libvirt/virtmanager, it would still
>> work as an external program. Virt-manager usb pass through screen would
>> show the "virtual" keyboard and mouse to pass through to the guest. It's
>> just, I would have no idea how to do this.
>>
>> Hope someone can do something like this. :)
>>
>> Jon
>>
>> On 1 September 2015 at 03:05, Jonathan Panozzo <jonp at lime-technology.com>
>> wrote:
>>
>>> Your request “makes sense” but implementation wouldn’t be simple.  This
>>> also has nothing to do with VFIO, but rather, QEMU/KVM (I’ll let Alex W
>>> correct me on that if I’m wrong, but I’m 99% sure I’m right).
>>>
>>> Regarding Synergy, there is a way to give Synergy elevated privileges so
>>> that when UAC pops up in Windows, you can still use the mouse.  I do this
>>> now and it works pretty good.  Synergy has other issues though, especially
>>> with applications that normally restrict cursor movement to inside the app
>>> (think gaming).
>>>
>>> Does your idea sound good?  Sure!  But its most definitely something
>>> that would be a bit complicated to implement.  What “key combination” would
>>> be ok to restrict on the keyboard to sending a command to the host?  What
>>> if a guest needs that combination to execute another function?  Lots of
>>> potential “gotchas” that would need to be considered.
>>>
>>> PS:  always a pleasure to meet another Jonathan ;-)
>>>
>>> - Jonathan Panozzo
>>>
>>> > On Aug 31, 2015, at 1:18 PM, Jonathan Scruggs <j.scruggs at gmail.com>
>>> wrote:
>>> >
>>> > Hi all,
>>> >
>>> > This is an idea I had that would be really cool if possible. If it is,
>>> you may want to somehow build it into VirtManager or something.
>>> >
>>> > Currently, I have a Windows guest using Synergy, but somethings
>>> Windows has popups that disable Synergy and only a real mouse would work.
>>> Also, you can't update Synergy while using Synergy. My solution which is
>>> better than Synergy and solves these issues:
>>> >
>>> > Would it be possible to have the real mouse and keyboard that is
>>> plugged into the host to be (this is where I struggle for the right words)
>>> duplicated/virtualized/emulated so that they can be passed through to the
>>> guest as a USB device and used on the host system as well. There would be a
>>> program that listens for a certain key combination that would switch the
>>> control to either the VM or host. Then windows would think it has a real
>>> USB keyboard and mouse rather than Synergy. This is especially useful when
>>> there is a dedicated graphics card passed through.
>>> >
>>> > This seems like something that VirtManger can have built in, like
>>> select an option to do this and it would switch the inputs between the
>>> systems. The only thing is, is that the mouse and keyboard would still need
>>> to be visible to the guest/host just no movements/keystrokes being sent.
>>> Also, calling external programs, like those that can switch monitor inputs
>>> should be added to this.
>>> >
>>> > This will lose the clipboard sharing and other features of Synergy,
>>> but I don't use those anyways, and this would be a lot more stable and
>>> better for the guests.
>>> >
>>> > Does this make sense?
>>> >
>>> > Thanks,
>>> > Jon
>>> > _______________________________________________
>>> > vfio-users mailing list
>>> > vfio-users at redhat.com
>>> > https://www.redhat.com/mailman/listinfo/vfio-users
>>>
>>>
>> _______________________________________________
>> vfio-users mailing list
>> vfio-users at redhat.com
>> https://www.redhat.com/mailman/listinfo/vfio-users
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20150901/fcccdc33/attachment.htm>


More information about the vfio-users mailing list