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

No Devices Connect #3

Open
VladislavF opened this issue Dec 28, 2021 · 4 comments
Open

No Devices Connect #3

VladislavF opened this issue Dec 28, 2021 · 4 comments

Comments

@VladislavF
Copy link

VladislavF commented Dec 28, 2021

Hello,

I am not sure where else to ask, so I'm just opening an issue here.

Problem:
TL;DR upon following all instructions, no devices connect to my Windows 10 VM. I have tried with a USB kvm switch as well as a USB3.0 thumb drive with the same results.

Detail:
I am trying to switch a mouse and keyboard with a USB KVM switch. I realize this may be mildly more complicated than the intended purpose here, but since the switch is basically just a hub, I figured adding all the ports that show up in the monitor script should work.
Heck, even just a single device hot-plugging would be good, but I can't get that either.

It seems to be failing to remove the USB devices, but I imagine that maybe be because they never attach in the first place. Like I mentioned above, result is the same with just a single USB drive.

Windows sees the xhci controllers added by the command line, but has absolutely no reaction upon connecting or disconnecting USB devices from the ports I've added to the config. The QMP socket file shows up and the scripts don't seem to have any issues with it. I'm just confused since there doesn't seem to be any indication of any issues anywhere except for the disconnect failures. The devices in question always just end up connecting to the host.

OS:
I'm on Ubuntu 20.04 with KVM/QEMU 5.0.

Steps to reproduce:
Simply follow all instructions, and attempt to connect a USB device via hotplug.

Logs are attached. Thank you for your help!
udev.log
hotplugger.log
win10.xml.txt
config.yml.txt

@AnonymousAard
Copy link

Did you ever resolve this? I encountered the same error from your logs in the middle of many other errors so I am not sure exactly what fixed it but I now have no errors - although still no USB visible on Debian. More here: #4

@hansemro
Copy link

hansemro commented Aug 28, 2022

This is broken because the qmp commands did not return anything. In the current QEMU master branch @ https://github.com/qemu/qemu/blob/9a99f964b152f8095949bbddca7841744ad418da/hmp-commands-info.hx#L336-L359, we can see that only info usb is handled (by qemu/qemu@fc30920) whereas info usbhost does nothing.

Attempting to call info usbhost will now throw the following error:

$ printf "{'execute':'qmp_capabilities'}\n{'execute':'human-monitor-command', 'arguments':{'command-line':'info usbhost'}}" | sudo socat - unix-connect:/tmp/.qmp-sock 
{
    "QMP": {
        "version": {
            "qemu": {
                "micro": 0,
                "minor": 0,
                "major": 7
            },
            "package": ""
        },
        "capabilities": [
            "oob"
        ]
    }
}
{
    "return": {
    }
}
{
    "return": "Command \"info usbhost\" is not available.\r\n"
}

@hansemro
Copy link

I replaced call to info usbhost with pyusb/libusb1 device queries to get port number here: hansemro@8f3443a

@themaskedcrusader
Copy link

I hate to bump a year-old thread, but this isn't working. I applied the diff from @hansemro and now my hotplugger.py doesn't generate any output at all. I'm still getting the "info usbhost" is not available error.

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

4 participants