vm(apple): support USB passthrough on macOS 27 - #7789
Open
shanginn wants to merge 1 commit into
Open
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.