mirror of
https://github.com/utmapp/UTM.git
synced 2026-10-12 02:24:01 +00:00
Apple Virtualization VMs could not share host USB devices. macOS 27 adds public APIs for this: AccessoryAccess.framework reports devices the user assigned to UTM in the system "Virtual Machine Accessories" menu bar item and VZUSBPassthroughDevice captures them, so the private API approach from the abandoned branch is no longer needed. Devices are reported once per process to UTMAppleUSBManager. A newly assigned device is connected to the only running VM, or to the VM whose window is in front when several are running, so the user does not have to select it twice. The USB menu of the Apple VM window lists assigned devices and can move a device from another VM after confirmation. A device the user disconnects from the menu stays assigned to UTM but is not connected again until asked, since the system reports it again right after it is detached. The VM label is set so the system menu names the VM. Connected devices are recorded with their UUID when the VM state is saved and added to the configuration before the state is restored, so the guest keeps the device across a suspend. A device that is missing at restore is skipped and the guest sees it unplugged; the restore itself still succeeds. Requires the com.apple.developer.accessory-access.usb entitlement. Assisted-by: Claude:claude-fable-5-1
31 lines
900 B
XML
31 lines
900 B
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>com.apple.developer.accessory-access.usb</key>
|
|
<true/>
|
|
<key>com.apple.security.app-sandbox</key>
|
|
<true/>
|
|
<key>com.apple.security.application-groups</key>
|
|
<array>
|
|
<string>$(TeamIdentifierPrefix)$(PRODUCT_BUNDLE_PREFIX:default=com.utmapp).UTM</string>
|
|
</array>
|
|
<key>com.apple.security.device.audio-input</key>
|
|
<true/>
|
|
<key>com.apple.security.device.usb</key>
|
|
<true/>
|
|
<key>com.apple.security.files.user-selected.read-write</key>
|
|
<true/>
|
|
<key>com.apple.security.network.client</key>
|
|
<true/>
|
|
<key>com.apple.security.network.server</key>
|
|
<true/>
|
|
<key>com.apple.security.virtualization</key>
|
|
<true/>
|
|
<key>com.apple.vm.device-access</key>
|
|
<true/>
|
|
<key>com.apple.vm.networking</key>
|
|
<true/>
|
|
</dict>
|
|
</plist>
|