Bug 7459

Summary: Implement the use of host USB devices on Linux for qemu machines
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Cristian Iorga <cristian.iorga>
Component: virtual machinesAssignee: Unassigned <unassigned>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: Medium CC: richard.purdie, sgw
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on: 4827    
Bug Blocks:    

Description Cristian Iorga 2015-03-16 11:01:54 UTC
Add for qemu machines the possibility to use a USB device that is connected to the host machine.
This could be used for more rapid development of Linux drivers or in order to prototype quicker an not-yet-available hardware and develop in advance the software stack for it.
Comment 1 Cristian Iorga 2015-03-16 11:02:43 UTC
Technical reference:
http://wiki.qemu.org/download/qemu-doc.html#usb_005fdevices
Comment 2 Cristian Iorga 2015-11-10 17:33:49 UTC
Implementation started.
Comment 3 Cristian Iorga 2016-01-21 17:30:43 UTC
Manually using an USB device inside a qemu VM:
1. Insert the USB device into a free port in the host computer
2. Using lsusb, find the vendor ID and device ID for the device
3. Run: sudo chown your_user /dev/bus/usb/bus/device (replace with the real numbers, as provided by lsusb also)
4. Run: runqemu qemux86-64 core-image-sato kvm qemuparams="-usbdevice host:vendor:device" (replace vendor and device with real numbers)
5. USB device should show up in qemu VM

Please be sure to provide the appropriate drivers in qemu VM so that the USB can be functional.
Comment 4 Cristian Iorga 2016-01-21 17:36:48 UTC
Work in progress implementation:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ciorga/YOCTO7459
Comment 5 Saul Wold 2016-02-10 17:16:36 UTC
Pushing to 2.2 due to change of resources
Comment 6 Robert Yang 2016-09-15 04:21:11 UTC
It should work, I will verify it later.
Comment 7 Robert Yang 2016-10-17 07:58:07 UTC
It doesn't work:

$ runqemu . qemuparams="-usbdevice host:8564:1000"

qemu-system-x86_64: -usbdevice host:8564:1000: could not add USB device 'host:8564:1000'

Need more work , and move it to 2.3
Comment 8 Richard Purdie 2019-02-07 15:58:59 UTC
At this point we aren't planning to do this. It may be something qemu can support and can likely be made to work if people have specific development needs but it isn't something generically useful we would use out the box.