Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

USB passthrough on MacOS using new Hypervisor framework #5263

Closed
2 of 3 tasks
drozycki opened this issue Jan 17, 2021 · 2 comments
Closed
2 of 3 tasks

USB passthrough on MacOS using new Hypervisor framework #5263

drozycki opened this issue Jan 17, 2021 · 2 comments

Comments

@drozycki
Copy link

drozycki commented Jan 17, 2021

  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

MacOS now supports USB passthrough with their new Hypervisor framework.

Actual behavior

> docker run --device=/dev/cu.usbserial-220 ...
docker: Error response from daemon: error gathering device information while adding custom device "/dev/cu.usbserial-220": no such file or directory.

I have verified that the device is there.

Information

The FAQ currently says:

Unfortunately, it is not possible to pass through a USB device (or a serial port) to a container as it requires support at the hypervisor level.

USB support was last discussed in 2018, when it was closed as won't fix. The Hypervisor framework was not available then.

Related Apple Developer Reference

  • macOS Version: 11.1 (Build 20C69) on the 2020 M1 Mini
  • Docker for Mac: The December 2020 release of Docker Desktop for Apple Silicon. The about page says 0.0.0 lol

Diagnostic logs



Steps to reproduce the behavior

  1. ...
  2. ...
@stephen-turner stephen-turner added the area/m1 M1 preview builds label Jan 18, 2021
@djs55
Copy link
Contributor

djs55 commented Jan 19, 2021

Thanks for the report. The existence of the entitlement is quite interesting, however I can't find USB-specific APIs in either the hypervisor.framework docs or the virtualization.framework docs.

An implementation via the hypervisor.framework would have to be with hyperkit and would likely be a significant amount of work: probably a whole PCI USB interface device would have to be emulated and (somehow) individual devices mapped to host devices. I would assume it's not possible or desirable to pass an entire host PCI controller to the VM since the host needs USB devices too.

An implementation via the virtualization.framework would be ideal and much easier for us to consume but I don't think it currently exists.

As a feature request, perhaps a better place to discuss this would be on a docker/roadmap ticket -- feel free to open an issue there. I'll close this one as I don't think there's anything we can do about this in the short term.

@djs55 djs55 closed this as completed Jan 19, 2021
@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Feb 18, 2021
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants