Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Aug 2021 13:30:06 +0300
From:      Naina Patrascu <patrascu.naina14@gmail.com>
To:        freebsd-hackers@freebsd.org
Cc:        lucian_ioan.popescu@stud.acs.upb.ro,  Elena Mihailescu <elenamihailescu22@gmail.com>
Subject:   USB passthrough in bhyve, USB keyboard disconnected
Message-ID:  <CAKHb35txYzA2od7ivGc1ov6%2B3tdNw4qspnj0VY0Uq8mqBGB7VQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--000000000000c34b2a05c9461a16
Content-Type: text/plain; charset="UTF-8"

Hello,

We are working on the USB passthrough functionality for bhyve and we are
currently focusing on the passthrough of a USB keyboard.
We implemented the enumeration process and it seems to work properly, as we
can see the information about the USB keyboard inside the virtual machine
through the 'usbconfig' command:
(guest) $ usbconfig
(guest) ugen0.2: <Chicony HP Elite USB Keyboard> at usbus0, cfg=0 md=HOST
spd=LOW (1.5Mbps) pwr=ON (100mA)

But at some point during the boot of the guest virtual machine, the USB
keyboard is powered off: any LED from the keyboard is turned off and
pressing any key does not generate logs in the guest or in the host.

We tried multiple commands to display the information about the USB device:
usbconfig, devinfo. We compared the outputs from the host and guest and the
attachment to the guest looks correct.
To inspect the transfers, we used the command below, but nothing is
displayed on the guest:

usbdump -i usbusX -f Y -s 65536 -vvv

In the logs we see the steps of the enumeration successfully executed, and
then some timeout errors, as we cannot execute any transfer with the
keyboard, which seems disconnected.

Could you help us find out why this disconnection happens?
Could you give us a path for investigating this problem?

We used multiple work environments:
- the FreeBSD host started in QEMU kvm; nested virtualization enabled to
create guest machine
- FreeBSD host directly on a PC
The behavior of our feature is the same.

If you want to take a look, [1] is the repo containing our implementation;
here [2] you can find iso files from our sources, and here [3] is a
tutorial, describing the steps we use to create, run and destroy a virtual
machine.

Thank you!

[1]
https://github.com/FreeBSD-UPB/freebsd-src/tree/projects/bhyve_usb_passthrough
[2]
https://drive.google.com/drive/folders/17xUlbWSZ-wn6xT2ouv-M6miHV_LDeIEw?usp=sharing
[3]
https://github.com/FreeBSD-UPB/freebsd-src/wiki/Working-with-virtual-machines-in-bhyve-for-USB-passthrough

--000000000000c34b2a05c9461a16--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKHb35txYzA2od7ivGc1ov6%2B3tdNw4qspnj0VY0Uq8mqBGB7VQ>