LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 02-06-2022, 09:21 AM   #1
trafikpolisen
Member
 
Registered: Jun 2008
Posts: 121

Rep: Reputation: 3
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...
 
Old 02-07-2022, 03:34 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by trafikpolisen View Post
I have a really old (but to me very useful) flatbed scanner which only works with Win XP.
First of all, I doubt that. Which make/model is it? Maybe it can be made to work under Linux.
 
Old 02-07-2022, 04:09 AM   #3
trafikpolisen
Member
 
Registered: Jun 2008
Posts: 121

Original Poster
Rep: Reputation: 3
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.
 
Old 02-07-2022, 05:46 AM   #4
trafikpolisen
Member
 
Registered: Jun 2008
Posts: 121

Original Poster
Rep: Reputation: 3
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.
 
Old 02-07-2022, 12:49 PM   #5
trafikpolisen
Member
 
Registered: Jun 2008
Posts: 121

Original Poster
Rep: Reputation: 3
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...
 
Old 02-08-2022, 01:34 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by trafikpolisen View Post
It's a HP ScanJet 4400c, about 20 years old or so.
https://www.linuxquestions.org/quest...-lenny-734944/
https://www.hamrick.com/vuescan/hp_scanjet_4400c.html
https://community.linuxmint.com/hardware/view/6017
https://www.gimp-forum.net/Thread-Scanner-support
non-english results:
https://forum.linux-mint-czech.cz/viewtopic.php?t=5482
https://www.linux.org.ru/forum/linux-hardware/11275780

You could try vuescan, it claims to have a driver for your device, and is available for Linux (trial for free).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No success manually slackbuilding qemu,libvirt,virt-manager as a whole on Slackware64-14.2 knet Slackware 58 07-17-2021 08:32 PM
libvirt, virt-manager: change default shutdown mode to use QEMU Guest Agent atelszewski Linux - Virtualization and Cloud 0 11-21-2016 12:46 AM
LXer: Set up qemu-kvm-1.0+noroms as spice enabled qemu server vs qemu-kvm-spice on Ubuntu Precise LXer Syndicated Linux News 0 05-26-2012 07:41 AM
[Debian/Qemu/KVM] Why qemu --enable-kvm works but not kvm directly? gb2312 Linux - Virtualization and Cloud 2 03-21-2011 02:05 PM
LXer: Hacking libvirt/virsh/virt-manager/virt-install at Xen 4.0 Dom0 on top of Ubunt LXer Syndicated Linux News 0 05-06-2010 02:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 08:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration