Open fkorotkov opened 2 years ago
Doesn't seem to be possible at this point, see https://github.com/docker/for-mac/issues/5263.
Doing something similar to VirtualHere is an option, though, but most involves (1) delving into, most likely, IOUSBHost and IOKit frameworks and (2) installing the agent on each running VM that will forward the USB data packets to and from the host.
Thinking of adb
, there's an idb
alternative for iOS which can serve emulators and devices over the gRPC, but I'm not sure if Tart can directly help with doing that besides starting a VM and helping to get it's IP address.
Let's keep the issue open for visibility. not possible atm
label should do fine.
This can also be useful for things like passing through block devices directly, or in my case passing an optical drive straight through to a VM for isolation/testing purposes.
What about employing https://gitlab.freedesktop.org/spice/usbredir ?
It’d be preferable to use something like usb-ip (but for Mac, as mentioned above) because (unlike USB redirection/pass-through solutions) it would allow sharing one device with multiple guests, from what I understand.
@geerlingguy it is now possible to pass block devices to that VMs via --disk
flag. You need to run run tart under sudo
though:
sudo TART_HOME="$HOME/.tart" tart run sonoma-xcode --disk=/dev/disk4s1
In the example above /dev/disk4s1
is a USB drive that I have on my machine.
Looks like USB Support was added to the Virtualization Framework as beta
at WWDC last week.
https://developer.apple.com/documentation/virtualization/usb_devices?language=objc
@geerlingguy it is now possible to pass block devices to that VMs via
--disk
flag. You need to run run tart undersudo
though:sudo TART_HOME="$HOME/.tart" tart run sonoma-xcode --disk=/dev/disk4s1
In the example above
/dev/disk4s1
is a USB drive that I have on my machine.
Do I understand right that it's not possible (yet?) to use block device for storing macOS VM data?
Do I understand right that it's not possible (yet?) to use block device for storing macOS VM data?
By "storing macOS VM data" you mean the root filesystem (which is currently stored in TART_HOME
as a disk image), or just any other auxiliary data (which is possible using --disk
)?
I assume even though block devices are supported, passing through a connected iPhone for debugging isn't supported yet?
would be super useful to have iphone passthrough to VM
We need to investigate how to passthough an iPhone connected to the host. This will be useful for running on device integration tests.