[Pkg-libvirt-maintainers] Bug#998468: libvirt0: qmeu KVM: USB Passthrough partially stopped working in Bullseye

Damian Philipp damian.philipp at gmx.net
Thu Nov 4 16:54:42 GMT 2021


Package: libvirt0
Version: 7.0.0-3
Severity: important
X-Debbugs-Cc: damian.philipp at gmx.net

Dear Maintainer,

I use a Debian Host to run KVM-based virtual machines, configured with virt-manager.
I run a VM with HASS.io (Home Assistant, a smart home software). Attached to the host is a USB Zigbee modem (Conbee II, in case it is important) which is passed through as individual device to the VM.
In Debian Buster, this setup was working reliably. After a dist-upgrade of the host to Debian Bullsee, this setup is now reliably broken.

virt-manager still shows the device as passed through to the VM. However, the VM does not appear to no longer have access to the USB device. Inside the VM, I run the zigbee2mqtt Plugin. The logs from the Plugin state:

[17:42:45] INFO: Handing over control to Zigbee2mqtt Core ...
> zigbee2mqtt at 1.22.0 start
> node index.js
CREATED DECONZ ADAPTER
Zigbee2MQTT:error 2021-11-04 17:42:52: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-11-04 17:42:52: Failed to start zigbee
Zigbee2MQTT:error 2021-11-04 17:42:52: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-11-04 17:42:52: Exiting...
Zigbee2MQTT:error 2021-11-04 17:42:52: Error: Error while opening serialport 'Error: Error: No such file or directory, cannot open /dev/ttyACM0'
    at SerialPort.<anonymous> (/app/node_modules/zigbee-herdsman/src/adapter/deconz/driver/driver.ts:182:28)
    at SerialPort._error (/app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:198:14)
    at /app/node_modules/zigbee-herdsman/node_modules/@serialport/stream/lib/index.js:242:12
[17:42:52] INFO: Handing over control to Zigbee2mqtt Core ...

In short, /dev/ttyACM0 is not available. I can confirm that this device node is indeed missing by logging into the console of the VM and poking around in its /dev directory.

More interesting than the log from the VM is probably the following log from the host. Whenever the VM tries to access the USB device, dmesg is spammed (~30 messages per second) with the following message:

[162164.169864] usb 1-5: usbfs: process 1788 (qemu-system-x86) did not claim interface 1 before use

The spam stops immediately when I shutdown the software inside the VM that tries to access the USB device.


In an attempt to narrow down the problem, I used another VM running an Ubuntu 21.04 Live ISO. I attached a USB Flash drive to the Ubuntu VM to verify wheter USB passthrough was completely broken - reading from the flash drive worked. I then attached the USB Zigbee Modem to the Ubuntu VM instead of the HASS.io VM. I saw the aforementioned dmesg message exactly once - likely occuring as the Ubuntu VM tried to enumerate the USB device, as it does not otherwise know what to do with the device.
Furthermore, I observed that virt-manager shows different information for both of the USB devices. For the flash drive, it shows "002:002 Sony Corp. Storage Media", whereas for the Zigbee modem it shows "USB 1cf1:0030" instead. lsusb does show a device information that matches the name and manufacturer of the Zigbee modem, though.

I do not really know where the problem originates. Given that it surfaced exactly when I dist-upgraded Debian, I'm pinning it on Debian (and libvirt, more specifically) for now.

Can you please tell me how to fix passthrough of my USB device or how to further narrow down the problem?

Damian

-- System Information:
Debian Release: 11.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-9-amd64 (SMP w/2 CPU threads)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libvirt0 depends on:
ii  libacl1          2.2.53-10
ii  libapparmor1     2.13.6-10
ii  libaudit1        1:3.0-2
ii  libc6            2.31-13+deb11u2
ii  libcap-ng0       0.7.9-2.2+b1
ii  libcurl3-gnutls  7.74.0-1.3+b1
ii  libgcc-s1        10.2.1-6
ii  libglib2.0-0     2.66.8-1
ii  libgnutls30      3.7.1-5
ii  libnl-3-200      3.4.0-1+b1
ii  libnuma1         2.0.12-1+b1
ii  libsasl2-2       2.1.27+dfsg-2.1
ii  libselinux1      3.1-3
ii  libssh2-1        1.9.0-2
ii  libxml2          2.9.10+dfsg-6.7
ii  libyajl2         2.1.0-3

Versions of packages libvirt0 recommends:
ii  lvm2  2.03.11-2.1

libvirt0 suggests no packages.

-- no debconf information



More information about the Pkg-libvirt-maintainers mailing list