-
Notifications
You must be signed in to change notification settings - Fork 608
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
[POC] USB sharing with host #1317
base: master
Are you sure you want to change the base?
Conversation
Is this for Linux host, or does this work on macOS too? 👀 |
I don't know if it works on linux. I've tested it on Mac M1 |
The latter mode is preferable. We have been doing the same for |
Is adding USB pass through more likely to happen with the new |
Unlikely. |
I have tested a linux guest VM running with UTM (https://mac.getutm.app/) on M1, using qemu. UTM's UI has a button to select what USB devices you want to be passed through to the VM. It works as expected. I can select/unselect USB devices and they correctly show up or get removed from the guest VM while the VM is running. Any idea how is this implemented? |
@dan-corneanu I guess it's implemented like this [1][2] (apologies, upon reading your code @sheerun I saw that it's the same api) So, probably UTM starts with this bus connected so you can select which devices you want within the VM? qemu-xhci supports hotplugging through the [1] https://qemu-project.gitlab.io/qemu/system/devices/usb.html |
ad #1314
I managed to flash USB from lima, but I don't feel this is ready to ship. I don't have time to handle this anymore, but I hope it will help. It only works if instance is started with
sudo limactl start
(otherwise qemu is not working with admin privileges which it needs for device forwarding), and lima is started withsudo lima
(otherwise you getBad port '0'
error). USB attaching / unattaching when physical device is plugged / unplugged seems to be working and I feel it will continue when buses and ports are uses instead of productid / vendorid (see below).Main issues to solve:
sudo -E
can be prepended to qemu process (maybe with -u and -g flags set to current user).Mind issue is with second point and it would require either managing everithing without agent process or making agent process running as root, or having 2 agent processes, one running as root handling root vms and one in user mode handling user mode qms
Hope it helps!