Mount an iPhone inside a KVM guest by disabling usbmuxd

Today I wanted to mount an iPhone inside a KVM-based VM. My host is Ubuntu 15.04, the guest is Windows XP. Well, it didn’t quite work at first because the host kept stealing back the phone’s USB connection. The culprit was usbmuxd, a “USB multiplexing daemon” that handles communications with iOS devices and Linux. To temporarily overwrite its behavior I added an empty udev rules file:

$ sudo touch /etc/udev/rules.d/39-usbmuxd.rules

This rule file (which does nothing) takes precedence over the original rules in /lib/udev/rules.d, with the result that it would no longer trigger the usbmuxd daemon whenever an iPhone is detected on the USB host.

Reload udev with:

$ sudo udevadm control --reload-rules

And now, it’s time to run the TaiG Jailbreak.

4 thoughts on “Mount an iPhone inside a KVM guest by disabling usbmuxd

  1. Hi,
    thanks for the interesting and helpful post!
    I’m trying to passthrough my iphone to my OSX guest running on qemu. I’ve followed your instructions to bypass usbmuxd and added my device to my qemu launch script like that:

    -device usb-host,vendorid=0x05ac

    When I start qemu the iPhone initially gets disconnceted from host and then connected to the guest but just for a second, then it’s connected / disconnected and reconnected again for a few times (sounds) and finally is connected back to host as a camera only. It seems that there’s something else stealing the device.

    I get this error from qemu when that happens:

    (qemu) libusb: error [_get_usbfs_fd] libusb couldn’t open USB device /dev/bus/usb/001/006: No such device

    qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]

    can you help me please?

    • I’ve been fighting this problem for days. You can use “udevadm test /sys/bus/usb/devices/” to see all the /lib/udev/rules.d/* files that are considered for a given USB device, but even disabling all of them (e.g., 39-usbmuxd.rules, 50-udev-default.rules, 56-hpmud.rules, 60-libgphoto2-6.rules, 69-libmtp.rules, 70-uaccess.rules, and 95-cd-devices.rules) does not solve the problem, as the udev daemon will still take away a USB device from QEMU. I am now trying the USB passthrough route to isolate an entire USB controller away from the QEMU host and pass it on to a QEMU guest.

Leave a Reply

Your email address will not be published. Required fields are marked *