F5F Stay Refreshed Software Operating Systems QEMU支持将USB设备动态传输到运行的Windows虚拟机。

QEMU支持将USB设备动态传输到运行的Windows虚拟机。

QEMU支持将USB设备动态传输到运行的Windows虚拟机。

F
Furroo
Junior Member
8
01-31-2016, 05:51 PM
#1
Your new job focuses on Linux, so a complete reset of your home PC seems logical. You have a spare GPU, which is great for running Windows guests when needed. Using USB/PCI passthrough lets you switch between Linux and Windows without a full KVM setup. Since your monitors support dual inputs, you can manage connections easily. Your QEMU skills are limited, but it’s possible to attach and detach devices via the command line. You could run a script on Linux, adjust monitor inputs to access Windows, then SSH back in to release the devices. Have others done something similar?
F
Furroo
01-31-2016, 05:51 PM #1

Your new job focuses on Linux, so a complete reset of your home PC seems logical. You have a spare GPU, which is great for running Windows guests when needed. Using USB/PCI passthrough lets you switch between Linux and Windows without a full KVM setup. Since your monitors support dual inputs, you can manage connections easily. Your QEMU skills are limited, but it’s possible to attach and detach devices via the command line. You could run a script on Linux, adjust monitor inputs to access Windows, then SSH back in to release the devices. Have others done something similar?

O
162
01-31-2016, 07:21 PM
#2
The optimal method involves using a PCIe passthrough for a USB controller. This ensures smooth hot swapping and proper USB functionality.
O
Oreos_In_Cream
01-31-2016, 07:21 PM #2

The optimal method involves using a PCIe passthrough for a USB controller. This ensures smooth hot swapping and proper USB functionality.

A
aguzz123123
Senior Member
599
02-01-2016, 11:36 PM
#3
USB devices can be managed via Virt-Manager's interface or other available tools, though each presents its own challenges. As noted earlier, you should identify the USB controllers on your motherboard and locate one within its dedicated IOMMU group—ideally. Then connect the necessary ports accordingly. Restricting the Linux Kernel driver might be required, but a KVM switch would likely suffice. This approach also allows seamless switching between virtual machines and the host, something a script cannot do.
A
aguzz123123
02-01-2016, 11:36 PM #3

USB devices can be managed via Virt-Manager's interface or other available tools, though each presents its own challenges. As noted earlier, you should identify the USB controllers on your motherboard and locate one within its dedicated IOMMU group—ideally. Then connect the necessary ports accordingly. Restricting the Linux Kernel driver might be required, but a KVM switch would likely suffice. This approach also allows seamless switching between virtual machines and the host, something a script cannot do.

L
llegal
Junior Member
42
02-02-2016, 06:54 PM
#4
Yes, you can apply changes via virsh and script the USB setup. Start with lsusb to generate the required XML files. Use <hostdev> to define the correct addresses for mouse.xml and keyboard.xml. The template shows proper XML structure. Attach the device with virsh attach-device and detach it afterward using virsh detach-device. You can retrieve the guest domain ID from libvirt or run a quick list. For automation, consider putting a script in putty’s keyauth or a shell script that runs the detach commands. qemu-monitor could also help if you prefer.
L
llegal
02-02-2016, 06:54 PM #4

Yes, you can apply changes via virsh and script the USB setup. Start with lsusb to generate the required XML files. Use <hostdev> to define the correct addresses for mouse.xml and keyboard.xml. The template shows proper XML structure. Attach the device with virsh attach-device and detach it afterward using virsh detach-device. You can retrieve the guest domain ID from libvirt or run a quick list. For automation, consider putting a script in putty’s keyauth or a shell script that runs the detach commands. qemu-monitor could also help if you prefer.