2

Description

USB not visible on Debian guest. I cannot see anything obvious from the logs but because I do not have much virtualisation experience I assume I missed a step in the configuration, possibly something very small and obvious to someone with more experience.

Software

QEMU emulator version 5.0.0 (Debian 1:5.0-5ubuntu6~ppa00)

Host: Ubuntu 20.04

Guest: Debian 11

Hotplugger

Steps to Reproduce

  • Add ppa:jacob/virtualisation for qemu-kvm as Ubuntu's 20.04 repo has just 4.x and backports caused many errors.

  • sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager

  • If encountering the 'a storage path must be specified' bug workaround this by moving the installer ISO to the location you want to use for storage, start again selecting it there, and then you should be able to create a volume for storage.

  • Install Debian 11 without making any other changes to virt manager.

My monitor.py output connecting and disconnecting a USB 2 and USB 3 key in turn was:

DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-2
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb4/4-2
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb4/4-2/4-2:1.0
  • config.yaml:
virtual_machines:

  debian:
    socket: /tmp/my-vm-sock
    delay: 1
    hubs:
      - xhci0.0
      - xhci1.0
    ports:
      - /devices/pci0000:00/0000:00:14.0/usb3/3-2
      - /devices/pci0000:00/0000:00:14.0/usb4/4-2

Leave the USB key disconnected.

  • /etc/udev/rules.d/99-zzz-local.rules:
SUBSYSTEM=="usb", ACTION=="add", RUN+="/bin/bash -c 'python3 /home/anonymousaard/hotplugger/hotplugger.py >> /tmp/hotplugger.log' 2>&1"
SUBSYSTEM=="usb", ACTION=="remove", RUN+="/bin/bash -c 'python3 /home/anonymousaard/hotplugger/hotplugger.py >> /tmp/hotplugger.log' 2>&1"
  • Edit /etc/libvirt/qemu/debian.xml

I was receiving errors for xhci not being found before I combined the top 4 lines with those qemu arguments suggested from the hotplugger readme to form:

<qemu:arg value="-device"/>
<qemu:arg value="nec-usb-xhci,id=xhci0"/>
<qemu:arg value="-device"/>
<qemu:arg value="nec-usb-xhci,id=xhci1"/>
<qemu:arg value="-chardev"/>
<qemu:arg value="socket,id=mon1,server=on,wait=off,path=/tmp/my-vm-sock"/>
<qemu:arg value="-mon"/>
<qemu:arg value="chardev=mon1,mode=control,pretty=on"/>
</qemu:commandline>
</domain>
export EDITOR=nano
sudo virsh edit debian

debian.xml.txt

  • Edit qemu.conf as per the readme to workaround the apparmor issue.

  • Complete the troubleshooting steps deleting hotplugger/tmp, rebooting the system, rebooting udev, and viewing the udev's logfile.

  • Boot Debian and once logged connect the USB key to the port and after observe that the host sees it fine but there is no sign of it on Debian. Do this a second time to demonstrate the initial udev error is just from rebooting it.

Is there anything obvious in the setup I describe or the logs attached that would suggest what the issue is, and how I may resolve it?

hotplugger.log udev.log libvirt_debian.log

0

You must log in to answer this question.

Browse other questions tagged .