You can capture USB traffic for single USB devices or on the root hub level, which captures the traffic of all USB devices attached to the root hub. Oracle VM VirtualBox stores the traffic in a format which is compatible with Wireshark. To capture the traffic of a specific USB device it must be attached to the VM with VBoxManage using the following command:
VBoxManage controlvmVM-name
usbattachdevice uuid
|address
--capturefilefilename
In order to enable capturing on the root hub use the following command while the VM is not running:
VBoxManage setextradataVM-name
\ VBoxInternal/Devices/usb-ehci/0/LUN#0/Config/CaptureFilenamefilename
The command above enables capturing on the root hub attached to
the EHCI controller. To enable it for the OHCI or XHCI controller
replace usb-ehci
with
usb-ohci
or usb-xhci
,
respectively.