KVM USB problems

copymaster

Member
Nov 25, 2009
183
0
16
Hi guys,

i have in a cluster a kvm machine and need an USB Fritzcard (ISDN)
so i made a qm set <vmid> -hostusb 057c:1900

And rebootet the vm.
After that, the vm was able to use the device. But on the other day i had to do another reboot and now the device is not listed anymore???

Within /etc/qemu-server/<vmid>.conf theres still the line hostusb 057c:1900

Why doesn't it work?
 
Hi guys,

i have in a cluster a kvm machine and need an USB Fritzcard (ISDN)
so i made a qm set <vmid> -hostusb 057c:1900

And rebootet the vm.
After that, the vm was able to use the device. But on the other day i had to do another reboot and now the device is not listed anymore???

Within /etc/qemu-server/<vmid>.conf theres still the line hostusb 057c:1900

Why doesn't it work?

Does 'lsusb' still lists the device? I would try to reset the usb device manually (power cycle or unplug/replug).
 
Hello,

I'm in trouble for a similar issue with a test cluster.

Two different VMs (Windows XP i386 and Ubuntu x64) have two different USB devices attached to two different ports.

  • The VM #1, with WinXP, has an HP printer on Bus 001 Device 004
  • The VM #2, with Ubuntu, has a USB2Serial adapter on Bus 002 Device 001

Each configuration file contains the correct "hostusb vid:pid" line.

The problem is exactly the same on both the VMs:

- When I start the VM, the USB devices work;
- If I unplug/replug or power cycle the USB devices, they disappear from my VMs (but they're still present in lsusb);
- I have to stop the VM and start it again in order to let them work again;

Here's the log after a power cycle of the printer:

Code:
Feb 15 11:39:50 	kernel	 	usb 1-2: USB disconnect, address 2
Feb 15 11:40:08 	kernel	 	ohci_hcd 0000:00:0b.0: wakeup
Feb 15 11:40:09 	kernel	 	usb 1-2: new full speed USB device using ohci_hcd and address 4
Feb 15 11:40:09 	kernel	 	usb 1-2: configuration #1 chosen from 1 choice
Feb 15 11:40:09 	kernel	 	drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 4 if 1 alt 0 proto 2 vid 0x03F0 pid 0x4911
Feb 15 11:40:09 	kernel	 	scsi5 : SCSI emulation for USB Mass Storage devices
Feb 15 11:40:09 	kernel	 	usb-storage: device found at 4
Feb 15 11:40:09 	kernel	 	usb-storage: waiting for device to settle before scanning
Feb 15 11:40:14 	kernel	 	Vendor: HP Model: PSC 2355 Rev: 1.00
Feb 15 11:40:14 	kernel	 	Type: Direct-Access ANSI SCSI revision: 02
Feb 15 11:40:14 	kernel	 	sd 5:0:0:0: Attached scsi removable disk sde
Feb 15 11:40:14 	kernel	 	usb-storage: device scan complete

The system has just been updated. I'm using kernel 2.6.18.
I will try to install 2.6.32, may it help?

(My compliments for this product, anyway, it is getting extremely helpful and I really, really, thank you!)
 
try to reload the usb devices with qm monitor.

Thank you for you tip, slytay. Do you mean like this?

Code:
qm> usb_del 03f0:4911
qm> usb_add 03f0:4911

If this is correct, alas, it didn't work. I still had to stop the machine and start it again (again, reboot of guest OS doesn't work).

Plus, I've noticed that actually KVM still sees the device:

Code:
qm> info usbhost
  Device 1.1, speed 480 Mb/s
    Hub: USB device 1d6b:0002, EHCI Host Controller
  Device 2.1, speed 12 Mb/s
    Hub: USB device 1d6b:0001, OHCI Host Controller
  Device 2.15, speed 12 Mb/s
    Class 00: USB device 03f0:4911, PSC 2350 series

So it seems that KVM just doesn't make the guest OS aware that the USB device is back, or something like that (I'm sorry but I don't know the technical details about this process).
 
Last edited:
I have the same problem, I have done the sequence bellow but nothing happens.

qm> info usb
Device 0.1, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.2, Speed 12 Mb/s, Product QEMU USB Tablet
qm> info usbhost
Device 1.1, speed 480 Mb/s
Hub: USB device 0000:0000, EHCI Host Controller
Device 2.1, speed 12 Mb/s
Hub: USB device 0000:0000, OHCI Host Controller
Device 2.4, speed 1.5 Mb/s
Class 00: USB device 0665:5161, USB to Serial
qm> usb_add 0665:5161

qm> info usb
Device 0.1, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.2, Speed 12 Mb/s, Product QEMU USB Tablet

uname -a
Linux prox 2.6.24-7-pve #1 SMP PREEMPT Tue Jun 2 08:00:29 CEST 2009 x86_64 GNU/Linux
 
It was already on my post

qm> info usbhost
Device 1.1, speed 480 Mb/s
Hub: USB device 0000:0000, EHCI Host Controller
Device 2.1, speed 12 Mb/s
Hub: USB device 0000:0000, OHCI Host Controller
Device 2.4, speed 1.5 Mb/s
Class 00: USB device 0665:5161, USB to Serial

Or do you need the output after the add_usb comand ?
 
qm> info usbhost
Device 1.1, speed 480 Mb/s
Hub: USB device 0000:0000, EHCI Host Controller
Device 2.1, speed 12 Mb/s
Hub: USB device 0000:0000, OHCI Host Controller
Device 2.4, speed 1.5 Mb/s
Class 00: USB device 0665:5161, USB to Serial
qm>
qm> info usb
Device 0.1, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.2, Speed 12 Mb/s, Product QEMU USB Tablet
qm>

qm> usb_add 0665:5161

qm> info usbhost
Device 1.1, speed 480 Mb/s
Hub: USB device 0000:0000, EHCI Host Controller
Device 2.1, speed 12 Mb/s
Hub: USB device 0000:0000, OHCI Host Controller
Device 2.4, speed 1.5 Mb/s
Class 00: USB device 0665:5161, USB to Serial

qm> info usb
Device 0.1, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.2, Speed 12 Mb/s, Product QEMU USB Tablet


I have just noticed that both in my case and in the previous case we are trying to add a device with speed 1.5 Mb/s, and that doens't apper in the info usb command from the guest machine. Do you think that this can have anything to do with it ?
 
Last edited:
I have just noticed that both in my case and in the previous case we are trying to add a device with speed 1.5 Mb/s, and that doens't apper in the info usb command from the guest machine. Do you think that this can have anything to do with it ?

Hi vmsv,
if you mean my case with "the previous case", consider that my device is working at 12 Mb/s as per info usbhost output above.

Anyway I want to add something that I forgot to mention, and it could actually help: when doing the tests above, I've noticed that the output of info usbhost was absolutely identical both before and after issuing the usb_del+add commands, just like in your output (I mean: the USB device is always listed in QM monitor).
 
Anyone has any ideas? This is becoming a big problem for me. I really don't know what to do.