I'm trying to assign USB devices to VMs via the SDK, but nothing I do seems to work. Devices only appear in a guest OS if I manually create a permanent assignment via preferences, and I can't find an API for that feature. Documentation is scarce on this subject, and there are no examples given. Does anyone have experience with this?
Yes, but that only seems to affect what happens to new devices plugged in while a VM is running. Devices already plugged in when a VM starts do not appear in the VM unless I set a permanent assignment. However, that isn't a viable solution for me as I have VMs constantly coming and going.
Not yet, but I did manage to figure out the API for adding a USB device to a VM's device list. That didn't make the device actually appear in the guest OS, but hopefully it's a step.
Figured out a workaround. We manually configured a VM with permanent USB assignments and a boot-drive path that points to a symlink. To change what the VM does, we simply shut it down, change where the symlink points, and start it up again. Since the VM isn't being deleted, the USB assignments are retained.