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

USB Passthrough #149

Open
jgoldring opened this issue Jul 27, 2017 · 10 comments
Open

USB Passthrough #149

jgoldring opened this issue Jul 27, 2017 · 10 comments

Comments

@jgoldring
Copy link

Are there any plans to add a USB-passthrough feature? This would be hugely beneficial to people like myself who are using Docker toolbox to allow for USB passthrough into containers running on mac OS. I would rather use the newer Docker for Mac, but it is not doable without the ability to forward USB into containers.

If this would violate the verdict to not deviate from xhyve, is this question more appropriately asked in that repo?

@rn
Copy link
Member

rn commented Jul 27, 2017

@jgoldring we are currently not working on USB device passthrough, xhyve was derived from FreeBSDs bhyve and the code is still fairly similar. According to https://wiki.freebsd.org/bhyve USB device passthrough is in progress on bhyve but even if that was finished, we could only lift the USB device emulation as presented to the guest from it. Then we'd still need to figure out how to implement the macOS side of things. It must be possible on macOS as other VMMs support it, but it may require kernel support (I simply don't know). Some USB device classes might be easier to handle than others. Finally, even if (and that's a big if) HyperKit would support it, it would still needed to be exposed via the UI to select USB devices and whatnot.

Long story short, this is a significant amount of work even if bhyve would support it.

@grehan-freebsd
Copy link

The tentative plan for bhyve is to have a unix-domain socket server that sits at the back-end of the XHCI emulation. USB targets would then connect to this, using something like a serialized version of libusb. The connect/disconnect would be reflected to the guest as a device insert/extract.

@aSapien
Copy link

aSapien commented Feb 8, 2020

Hi, it looks like USB passthrough has been implemented in bhyve.

Has there been any progress/change in plans to port it to Hyperkit?

@justincormack
Copy link
Collaborator

That is PCI passthrough, not the USB passthrough design described above. It is not clear that PCI passthrough can be implemented on OSX, and for USB purposes it is not that useful as which devices you can passthrough depends on the PCI topology, eg you might only be able to attach all devices to the VM.

@aSapien
Copy link

aSapien commented Feb 8, 2020

you might only be able to attach all devices to the VM.

Does this mean that the whole USB controller can possibly be attached?

@justincormack
Copy link
Collaborator

If you implemented PCI passthrough, which may not be possible, then yes, it might also be the case that only the whole USB controller could be attached. I don't know the PCI topology in Macs.

@lukepighetti
Copy link

Can someone provide an update on the current status of USB passthrough in hyperkit? What are the key blockers?

@TheBigBear
Copy link

@djs55 David can you shed any light on this? Does (or did) the commit docker/for-mac#5263 (comment) on 19 Jan 2021 actually resolve this issue?

@TheBigBear
Copy link

@djs55 sorry, apologies, I re-read your comment. So I guess even though the current xhyve (and hyperkit) now do have usb passthrough this has not yet made it into docker on Macs. Right?

@jovylle
Copy link

jovylle commented Oct 30, 2023

how about now.

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

8 participants