Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs seem good but no USB on Debian guest? #4

Open
AnonymousAard opened this issue Jun 27, 2022 · 0 comments
Open

Logs seem good but no USB on Debian guest? #4

AnonymousAard opened this issue Jun 27, 2022 · 0 comments

Comments

@AnonymousAard
Copy link

AnonymousAard commented Jun 27, 2022

Versions

QEMU emulator version 5.0.0 (Debian 1:5.0-5ubuntu6~ppa00)
Host: Ubuntu 20.04
Guest: Debian 11

Description

USB not visible on 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 that is preventing the USB drive from appearing on debian.

Steps to Reproduce

I was receiving errors for xhci not being found before I read #3 and inserted the same lines is using before the qemu arguments from the readme:

  <qemu:commandline>
  ...
    <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:commandline>
</domain>

The readme does mention the XML is a work in progress but can you please confirm whether it is correct to add these lines and if anything else is required for a basic setup using virt-manager? Initially this resulted in the same device not found error I can see from the log VladislavF uploaded but some combination of purging everything related to qemu-kvm, libvirt, virtsh, virt-manager, and reinstalling from the default repo, backports (as qemu is v4.x on 20.04), and a third party repo lead me to many new errors but after many iterations now with none that are obvious to me and in fact from the logs to me at least it looks good. Unfortunately the issue remains, no USB visible on Debian although it seems like I am close!

I cannot say exactly what stopped me receiving that error but I can outline the general steps to setup after the latest purge so that hopefully you can easily spot what I am missing and it may also help someone else.

  • Add ppa:jacob/virtualisation for qemu v5 without the headache of compiling dependencies.

  • 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 changing or adding anything else virt manager.

My monitor output using a USB 2 and USB 3 keys 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.

  • 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
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.

Actual result:

  • 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 show the udev log without error after the reboot.

hotplugger.log
udev.log
libvirt_debian.log

Expected result:

USB visible on Debian guest.

Reproduces how often:

Always.

Can you please tell me how I can resolve this?

@AnonymousAard AnonymousAard changed the title Logs seem good but no USB on Debian host? Logs seem good but no USB on Debian guest? Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant