0

Why is it that some kind of USB devices (e.g. web camera) are exclusively assigned* to a KVM virtual machine, while others (e.g. mouse, keyboard) can be shared between host/VM/other VMs?

*exclusively assigned:

  • it must be added explicitly (Add Hardware in Virtual Machine Manager) -- while the mouse/keyboard "just work"
  • while the guest is running, that device is not available on the host -- mouse/keyboard are shared seamlessly
  • the guest does not even start up, if that device (e.g. the webcam) is not plugged in -- I did not try this, but I suppose VM would start without keyboard/mouse
  • I think removing that device causes the guest to crash (I vaguely recall accidentally having done this once, and now I don't want to try it again), even if the device is not in use -- on the host, the webcam can be removed without compromising the stability of the system
2

Why is it that some kind of USB devices (e.g. web camera) are exclusively assigned* to a KVM virtual machine, while others (e.g. mouse, keyboard) can be shared between host/VM/other VMs?

All USB devices are exclusive: USB devices can only be attached to a single master, not a multiple master.

Anything that is "shared" uses a different infrastructure: Mouse input or keyboard input is simulated to the guest in some different way (which includes simulating an "additional" virtual USB device that has nothing to do with the real device; but simulation of non-USB devices also works), taking events from upper layers of the host OS.

In principle you could do the same thing with webcams: Have a simulated USB device that gets information somehow from the host OS directly. I think Parallels attaches the host USB webcam(s) in this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.