[vfio-users] Dynamic USB assignment between VMs

Daniel Browne jairuncaloth at gmail.com
Sat Jan 21 04:15:59 UTC 2017


A USB switch might work, but I would prefer to avoid doing something like
that. I've not had amazing luck passing through USB controllers on this
system in the past. I started working on a script to reassign using the
qemu hook. I'm stuck at the moment though. The script is being run but it
hangs, seemingly indefinitely, while trying to connect to the hypervisor.
I'm using python to write the script. Basically, the following line never
completes.

conn = libvirt.open('qemu:///system')

I thought maybe it could be permissions related. The script is being run as
root from what I can see. I can call the script with the same args as
libvirt as root and it will run. I also don't see any apparmor errors that
could be causing this.

Any ideas?

On Fri, Jan 20, 2017 at 1:49 PM, Brian Chow <brianchow at digitaldescent.net>
wrote:

> I ran into a similar problem, and the easiest way I found was to get a USB
> switch, plugged into dedicated USB ports on each vm. Then when I need to
> switch, I just hit a button on the switch and it switches which VM they are
> plugged into. They run about $25 on Amazon if I recall correctly.
>
> On Jan 20, 2017 10:30 AM, "Daniel Browne" <jairuncaloth at gmail.com> wrote:
>
> Hi folks,
>
> I'm working on setting up my main desktop as a headless hypervisor with
> desktop OSs running in VMs. Currently I have two guests up and running, Win
> 7 and Ubuntu. I'm passing through my keyboard and mouse to Windows in order
> to be able to take advantage of the official configuration tools and
> sharing them to the other VM with Synergy.
>
> The problem I'm currently running into is If I need to shut down the Win7
> VM, I have no method of input on my Ubuntu VM unless I connect one of my
> monitors to the server console by moving the cable to the integrated
> graphics port, and using virsh to reassign the devices.
>
> I'm looking for a way that will dynamically reassign my mouse and keyboard
> based on what VMs are running. The only thing I've found so far that I
> think will work is using libvirt hooks to run some scripts when I startup
> or shutdown a VM as described here https://libvirt.org/hooks.html.
> However, before I jump into writing scripts, I wanted to see if anyone else
> had run into this and see if there is a simpler method.
>
> Thanks,
> Daniel
>
> _______________________________________________
> 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/20170120/b563fa3f/attachment.htm>


More information about the vfio-users mailing list