2

I'm having trouble getting a USB ethernet device working in a qemu-kvm/libvirt VM.

The problem is that even though the guest OS sees the USB device just fine it can't mount it. lsusb on the guest shows the device, but the guest dmesg logs show the following error:

usb 1-5 can't set config #1, error -32

Looking at the logs on the HOST, it appears some process on the host grabs back onto the device when libvirt forces a release of the device. Here are the dmesg logs from the host, when the card is first connected:

[    1.353053] usb 1-2: new high-speed USB device number 3 using ehci-pci
[    1.432153] systemd-udevd[297]: renamed network interface eth0 to enp8s0
[    1.468455] usb 1-2: config 1 has an invalid interface number: 4 but max is 2
[    1.468460] usb 1-2: config 1 has an invalid interface number: 5 but max is 2
[    1.468455] usb 1-2: config 1 has an invalid interface number: 4 but max is 2
[    1.468460] usb 1-2: config 1 has an invalid interface number: 5 but max is 2
[    1.468462] usb 1-2: config 1 has an invalid interface number: 5 but max is 2
[    1.468465] usb 1-2: config 1 has no interface number 1
[    1.468468] usb 1-2: config 1 has no interface number 2
[    1.469951] usb 1-2: New USB device found, idVendor=1410, idProduct=b008
[    1.469955] usb 1-2: New USB device strings: Mfr=4, Product=3, SerialNumber=5
[    1.469958] usb 1-2: Product: Novatel Wireless 4G
[    1.469960] usb 1-2: Manufacturer: Novatel Wireless Inc.
[    1.469963] usb 1-2: SerialNumber: 990000945171911
[    1.473271] hid-generic 0003:1410:B008.0001: hiddev0,hidraw0: USB HID v1.10 Device [Novatel Wireless Inc. Novatel Wireless 4G] on usb-0000:00:1d.7-2/input0

And when I attempt to mount the device in the VM (logs from host again):

[   92.555534] cdc_ether 1-2:1.4 enp0s29f7u2i4: unregister 'cdc_ether' usb-0000:00:1d.7-2, CDC Ethernet Device
[   92.673039] usb 1-2: reset high-speed USB device number 3 using ehci-pci
[   92.789881] cdc_ether 1-2:1.4 eth0: register 'cdc_ether' at usb-0000:00:1d.7-2, CDC Ethernet Device, 00:15:ff:51:71:90
[   92.814159] systemd-udevd[3480]: renamed network interface eth0 to enp0s29f7u2i4
[   93.321758] cdc_ether 1-2:1.4 enp0s29f7u2i4: unregister 'cdc_ether' usb-0000:00:1d.7-2, CDC Ethernet Device
[   93.442035] usb 1-2: reset high-speed USB device number 3 using ehci-pci
[   93.558723] cdc_ether 1-2:1.4 eth0: register 'cdc_ether' at usb-0000:00:1d.7-2, CDC Ethernet Device, 00:15:ff:51:71:90
[   93.582179] systemd-udevd[3480]: renamed network interface eth0 to enp0s29f7u2i4
[   93.673779] cdc_ether 1-2:1.4 enp0s29f7u2i4: unregister 'cdc_ether' usb-0000:00:1d.7-2, CDC Ethernet Device
[   93.791043] usb 1-2: reset high-speed USB device number 3 using ehci-pci
[   93.907742] cdc_ether 1-2:1.4 eth0: register 'cdc_ether' at usb-0000:00:1d.7-2, CDC Ethernet Device, 00:15:ff:51:71:90
[   93.927194] systemd-udevd[3480]: renamed network interface eth0 to enp0s29f7u2i4
[   94.007311] usb 1-2: usbfs: interface 4 claimed by cdc_ether while 'qemu-kvm' sets config #1

The host OS is CentOS 7 and the VM OS is Ubuntu 14.04. Both have the latest versions of the kernel available for their respective package managers.

Another USB ethernet card I tried worked, but that uses a different driver: 'rndis_host', and generally looks like it mounts cleaner:

[  875.825026] usb 1-2: new high-speed USB device number 5 using ehci-pci
[  875.940297] usb 1-2: New USB device found, idVendor=1410, idProduct=b009
[  875.940302] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  875.940305] usb 1-2: Product: MiFi 5792
[  875.940308] usb 1-2: Manufacturer: Novatel Wireless
[  875.940310] usb 1-2: SerialNumber: 0123456789ABCDEF
[  875.987211] rndis_host 1-2:1.0 eth0: register 'rndis_host' at usb-0000:00:1d.7-2, RNDIS device, 00:15:ff:21:57:30
[  875.987255] usbcore: registered new interface driver rndis_host
[  876.010204] systemd-udevd[4636]: renamed network interface eth0 to enp0s29f7u2

And when I attempt to mount the device in the VM (logs from host again):

[ 2017.809111] rndis_host 1-2:1.0 enp0s29f7u2: unregister 'rndis_host' usb-0000:00:1d.7-2, RNDIS device
[ 2018.095036] usb 1-2: reset high-speed USB device number 5 using ehci-pci
[ 2018.439031] usb 1-2: reset high-speed USB device number 5 using ehci-pci

I'm running latest versions of NetworkManager and usb_modeswitch on both host and guest. I've turned off the USB networks on the host in sysconfig, so when I connect the devices, the network interfaces aren't brought up on the host.

Any debugging tips to find the process that's attempting to latch back onto the device after libvirt releases it?

  • I believe this is something to with QEmu, not attaching to the device quickly enough or at the right time. I later found I can use passthrough networking in the libvirt VM, then the USB ethernet can be attached to the host without any need to mess with the USB setting on the VM. – watsonmw Nov 1 '14 at 20:24
  • What does lsusb -v -d 1410:b009 show? – user92060 Nov 19 '14 at 9:08

Your Answer

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

Browse other questions tagged or ask your own question.