Closed tombombadilom closed 3 years ago
NB: Big scare while updating iphone ios from mac os x finder. The phone remained unusable and blocked in restore mode. After analysis it appears that the productid is different in restore mode. So to upgrade, backup and restore your iphone I strongly advise you to remove the mention of the productid in your startup script qemu.
-usb \
-device usb-ehci,id=ehci \
-device usb-host,bus=ehci.0,vendorid=0x05ac,guest-reset=false,id=iphone \
Thank you for posting your solution here. Linked it in the README
I find relevant to post also an issue i had while connecting an iphone with Ubuntu 22.04 as host.
Following the top tutorial, the iphone connects perfectly and is detected by the vm, but when issuing the update required by mac: "A software update is required to connect to iPhone", it was no longer able to connect the iphone to the VM. Also, QEMU was continuously throwing this errors:
...
qemu-system-x86_64: libusb_set_configuration: -6 [BUSY]
qemu-system-x86_64: libusb_set_configuration: -6 [BUSY]
qemu-system-x86_64: libusb_set_configuration: -6 [BUSY]
qemu-system-x86_64: libusb_set_configuration: -6 [BUSY]
qemu-system-x86_64: libusb_set_configuration: -6 [BUSY]
qemu-system-x86_64: libusb_set_configuration: -6 [BUSY]
qemu-system-x86_64: libusb_set_configuration: -6 [BUSY]
...
By a little of search, i can figure out that my host machine was somehow blocking the device. This is because the drivers from the host machine, claims the device before it is forwarded to the VM.
Making an lsusb -t
, i can figure out which drivers were claiming the device:
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
...
|__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 4, If 0, Class=Hub, Driver=hub/2p, 480M
|__ Port 1: Dev 21, If 1, Class=Vendor Specific Class, Driver=, 480M
|__ Port 1: Dev 21, If 2, Class=Vendor Specific Class, Driver=, 480M
|__ Port 1: Dev 21, If 0, Class=Imaging, Driver=usbfs, 480M
...
As you can see, in the iphone case, it detects several interfaces for a single device, each interface may load a different driver. Is important to unbind every driver from the device to make QEMU forward it properly.
In my personal case, when hot plugging my device to the VM, the If 0
gets claimed by usbfs
driver. Issuing the foillowing command for unbinding the device from the driver, makes the vm to automatically detect the iphone:
echo "1-4.1.1:4.0" | sudo tee /sys/bus/usb/drivers/usbfs/unbind
When I tried @rawlines command it gave me this output:
tee: /sys/bus/usb/drivers/usbfs/unbind: No such device
So, what I did to find the correct identifier for my connected iPhone was typing ls /sys/bus/usb/drivers/usbfs/
in the command line and my indentifier was 1-3:1.0
.
Is anyone having trouble redirecting the USB port to communicate with the iPhone on Sonoma? I tried everything but XCode and Finder don't find the iPhone.
No idea, personally, I'm stuck in Ventura and I didn't find a way to bypass the security disk to allow the Sonoma upgrade. Can I ask you, how did you do ? Can you share it with us ?
Is anyone having trouble redirecting the USB port to communicate with the iPhone on Sonoma? I tried everything but XCode and Finder don't find the iPhone.
I assume that you have read all the thread, to make it short. You have to connect the iPhone to a USB device, and if possible avoid plugging it on a hub. The reason is that, once you choose your USB plug, you have to make it passthrough QEMU to the VM. As a result, this plug won't be available for your host or any other VM. Once you have done that, you should be able to see it in your Sonoma.
No idea, personally, I'm stuck in Ventura and I didn't find a way to bypass the security disk to allow the Sonoma upgrade. Can I ask you, how did you do ? Can you share it with us ?
Hi @tombombadilom, I just did the Software Update from macOS.
I'm using this package to virtualize macOS: https://oneclick-macos-simple-kvm.notaperson535.is-a.dev/
Is anyone having trouble redirecting the USB port to communicate with the iPhone on Sonoma? I tried everything but XCode and Finder don't find the iPhone.
I assume that you have read all the thread, to make it short. You have to connect the iPhone to a USB device, and if possible avoid plugging it on a hub. The reason is that, once you choose your USB plug, you have to make it passthrough QEMU to the VM. As a result, this plug won't be available for your host or any other VM. Once you have done that, you should be able to see it in your Sonoma.
The problem is that Sonoma requires qemu-xhci. I downgraded to Ventura and reverted the configuration to usb-ehci, then I was able to communicate with the iPhone again.
How to add an iphone to use with xcode
Références: https://stackoverflow.com/questions/67279997/connect-iphone-via-usb-to-sosumi-qemu https://github.com/sickcodes/Docker-OSX/issues/133
Define usb port to be usb passthrough
it is easier to select a usb bus where your iphone is single but in case you can't follow the udev rules
plug your iphone to usb
Since qemu runs as a regular user, it cannot connect to hot-plug USB devices unless you change permssions on the host. Being in group plugdev might be sufficient for standard USD block devices. For others, such as an iphone, you need to manually change the /dev/bus/usb/xxx/yyy to group users or create /etc/udev/rules.d/97-iphone.rules.
https://www.linuxquestions.org/questions/blog/kingbeowulf-74138/qemu-usb-passthrough-with-specifics-for-iphone-37830/
0x05ac vendor ID in this case is for an Apple iPhone 5C. For iphones specifically, it can help to disable usbmuxd with an empty /etc/udev/rules.d/39-usbmuxd.rules Now, either reboot (ha! this ain't windows!) or run as root
then edit yout lanch-mac-os.sh and add
Warning if you intend to code with xcode or upgrade your iphone with your mac , remove the productid . see comment below.
Pairing an iOS device with Xcode
https://stackoverflow.com/questions/10087985/xcode-doesnt-see-my-ios-device-but-itunes-does
Do I need to be a Apple Developer Member to deploy apps on my iphone ?
https://developer.apple.com/forums/thread/81424
when you launch your mac os x you should get this :