USB redirect problem - QEMU/KVM/libvirt/virt-manager
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
USB redirect problem - QEMU/KVM/libvirt/virt-manager
Hi!
Short background: I have a really old (but to me very useful) flatbed scanner which only works with Win XP. To use it, I've been using an XP installation in VMware workstation, with the host USB device (the scanner) connected to the VM and it's worked very well for a long time. Host OS is Linux Mint BTW.
However, I'm now trying achieve the same with QEMU/KVM instead. I'm using virt-manager. Here is the problem:
If I open the virtual machine configuration in virt-manager and press "Add Hardware", then "USB Host Device" and then the scanner, the scanner is detected in XP, but it doesn't work correctly. If I try to scan, it sort of works, but the scanner doesn't sound as normal and it takes forever, even at lowest resolution (like 10 minutes).
However, if I don't add the USB device (the scanner) by using the "Add Hardware" button, but instead go to the "Virtual Machine" menu and then click "Redirect USB device" and tick the box for the scanner, it works correctly. The problem with this approach is that I have to to this manually each time I start the VM.
I have googled for many hours now, without finding any solution, but it was suggested on some forum that these two methods of connecting a host USB device to the vm are totally different (VFIO and libusb..?). I get the feeling that the problem when I attach the scanner via "Add hardware" might be that it operates at USB 1.1 Low Speed, i.e. at 1,5 Mbit, but I'm not sure.
Last edited by trafikpolisen; 02-06-2022 at 09:54 AM.
Reason: spelling...
It's a HP ScanJet 4400c, about 20 years old or so. It does sort of work under Linux, but not good. When used under Linux, it physically overruns when it reaches the far end and it sounds like it's breaking. Also, I have a bit of custom setup in XP using AutoIt (scripting) to automatically scan, crop and save, so I get a png with exactly the same dimensions as the original A4 paper, which actually involves adding a bit of blank at the top, as the scanner doesn't 100 % cover the top few millimetres.
I have done a lot of trial and error at this point without any result. I did actually install a Linux VM as well, but I get the same weird behaviour there as well, so it's not a Windows problem. If I add the USB device as new hardware with virt-manager, it barely works (extremely slow), but if I add it using the "Redirect USB device" menu option, it works (except it overruns, as it's always done under Linux).
Last edited by trafikpolisen; 02-07-2022 at 04:16 AM.
I just figured out a clue.. If I configure the USB Controller for the VM in virt-manager as USB 3 instead of USB 2, then all of a sudden the scanner is working in my test Linux VM (at least as well as it does under Linux). This should reasonably not matter as the scanner is a USB 1.1 device, but something happens. This doesn't help in the XP VM as XP doesn't like the USB 3 controller.
After many hours and a lot of trial and error, I'm giving up and sticking with VMware. Something with using host USB devices in QEMU/KVM/libvirt VM's somehow doesn't feel as "transparent" as in VMware. Though I am a newbie when it comes to QEMU/KVM/libvirt...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.