vm(apple): support USB passthrough on macOS 27 - #7789
Conversation
Use Accessory Access and the public Virtualization USB passthrough APIs to attach host USB devices to Apple Virtualization macOS guests. Preserve device intent across VM lifecycle transitions and serialize hot-plug operations around pause, snapshot, restart, and stop. Refs utmapp#3778
|
will this support USB Audio/Video Devices as well? |
sadly no. at least my external Web Camera uses USB isochronous endpoints for UVC video/audio. Apple’s macOS 27 Beta 4 Virtualization runtime explicitly rejects it with: and double sadly this feature was actually needed for the webcam passthrough (but I was waiting for the usb webcam to arrive to test it) |
I think all the cameras and most probably headsets as well use isochronous. This is very sad, i really hope they will add support for this in a future beta. |
Summary
Resolves #3778
Signing
USB passthrough requires a provisioning profile containing the
com.apple.developer.accessory-access.usbentitlement.The entitlement is intentionally excluded from
macOS-unsigned.entitlements, because macOS rejects an ad-hoc signature containing this restricted entitlement on normally protected systems.I dont have a developer account so I cant make a proper build of that. And it was tested with SIP disabled
Testing
Tested on a MacBook Pro (Mac14,6, Apple M2 Max) running macOS 27.0 beta 4 (26A5388g), using a macOS 10.15.7 Apple Virtualization guest and an ASolid USB_0114 mass-storage device (VID:PID 24a9:205a). Confirmed assigning the device to UTM, connecting it to the guest, and using USB sharing successfully.
Built an arm64 Release archive with Xcode 27 beta 4 (27A5228h) and the macOS 27 SDK. The beta toolchain required a command-line-only macOS 12.0 deployment-target override; this change does not modify UTM’s deployment target.
AI assistance
I have read the AI contribution guidelines and have followed them to the best of my ability.
This implementation was developed with assistance from GPT-5.6 sol. Although I'm not a swift developer I reviewed the resulting code. The tests were done tested manually, but not extensivly.