Using Linux and VMWare to update iPhone firmware

Posted by Will about about 1 year ago

So I was finally able to get update my IPhone to use the 2.2 firmware using VMWare The problem is seems is caused by the restart of the USB interface on the IPhone during the update process. This is done to put the IPhone into the recieve mode for the update but when it reconnects the USBHID module detects the camera and will grab control before vmware is able to. The solution then becomes making USBHID ignore the IPhone when it is put into its receive mode.

WARNING: There are still other things that can go wrong during the update, please make sure to sync your IPhone before doing any updates. If something does go wrong you can restore your phone from another computer running windows and then go back to the VM image to restore your backup.

Here are the things you’ll need:

  1. IPhone that needs an update of course
  2. Some flavor of Linux – I’m using Gentoo with a 2.6.23 kernel. Note: Your kernel must be configured to load USBHID as a module
  3. VMWare >= 6.5.1 – Any 6.X version will probably work it, but 6.5.1 doesn’t require focus to be on the VM inorder for it to capture the USB connection from the IPhone.
  4. Windows VMWare Image with ITunes – Using Windows XP SP3 with ITunes 8.0.2

The first step is to figure out the USB ID of your IPhone (Update: this should be done when your phone is in recovery mode), which can be done using ‘lsusb’

# lsusb
Bus 005 Device 001: ID 0000:0000
Bus 006 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 004: ID 046d:c404 Logitech, Inc. TrackMan Wheel
Bus 003 Device 003: ID 04fe:0006 PFU, Ltd
Bus 003 Device 001: ID 0000:0000
Bus 003 Device 002: ID 04fe:0008 PFU, Ltd
Bus 008 Device 001: ID 0000:0000
Bus 007 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 035: ID 05ac:1290 Apple Computer, Inc.

So from the above output we see the ID is 05ac:1290, so next we need to tell the USBHID module to ignore connections from this device. In Gentoo the best way to accomplish this is to create a /etc/modprobe.d/usbhid file that will contain options that will be passed to the module when it is loaded. The contents of the file should look like:

options usbhid quirks=0×05ac:0×1290:0×04

Remember to replace the USB ID for your IPhone in the line above, you’ll also have to write the ID in using 0x since they are hex numbers. The 0×0004 at the end is what tells the USBHID module to ignore the device with the USB ID given right before. In Gentoo after you have created this file run ‘update-modules’, this will generate a new /etc/modprobe.conf file with your updated options. If you used genkernel to compile your kernel or have a initrd it is probably a good idea to update it now. Genkernel users can just run ‘genkernel initrd’.

If you’re not using a USB mouse/keyboard, or have SSH access to the machine, you can just reload the USBHID module load the new options, otherwise a reboot is required. Next fire up your VMWare Windows image and launch ITunes. Besure to sync your IPhone before trying to update the firmware, this way if something does go wrong you can restore it later. Start the IPhone firmware update and watch the progress bar go.


Comments

Gravatar Image

Quin said...

Hi Will

I’ve just bought a new shiny iphone and a new dell XPS M1330 with Ubuntu 8.04. I’ve downloaded the latest vmware player and am running virtual Windows XP. The plan being to allow me to sync my iphone with XP (mostly to download my Audible books).

My problem is: (i) When I plug in the iphone, Ubuntu picks up the camera (I ignore this). I then click “devices” on the vm player and get XP to pick it up… which it does but then crashes within a few seconds (I get the blue screen of death and the vm player shuts down) (ii) I’m a new-ish Linux convert, and am struggling to make sense of the online chats re. iphones and vmware. My hunch is that my problem is possibly along the lines of what you describe above (?). Could you possible explain in simpler terms what you’re decribing above and if you think this might help me.

Thanks, Quin

Posted Sunday, May 10, 2009

Gravatar Image

Will said...

Quinn,

My initial thought is that you are experiencing a different problem from what I’m describing above. The problem above is only when trying to update the iPhone firmware or restoring it from a backup. The iPhone sends a different hardware ID when it is put into recovery mode during the update process causing the linux kernel to try and take control instead of leaving it to the Windows Virtual Machine.

The fact that your can see the iPhone tells me that is not related to what I was posting about. There have been issues in the past with outdated hardware drivers in XP causing blue screens while syncing, especially when other usb devices are conected.

My recommendation is to make sure all other usb devices are unplugged from the system and to make sure all the devices drivers are up to date. Then try and connect your iPhone.

Posted Thursday, May 21, 2009

Gravatar Image

Loke said...

Try Milli’s advice at http://ubuntuforums.org/archive/index.php/t-489841.html

Posted Friday, June 19, 2009

Gravatar Image

Dave Brewster said...

Has anyone gotten this to work with the 3.0 version of the software? I tried both this way and to just unload the snd_usb_audio and the usbhid modules but that doesn’t seem to work.

Also, which device should I be hiding, the recovery device or the “normal” device? I tried both and neither seemed to work.

Thanks,

Dave

Posted Tuesday, June 23, 2009

Gravatar Image

Dave Brewster said...

Ok, I got the other method to work. I had to remove the usbhid module completely and then the upgrade worked.

For some reason I couldn’t get the linux kernel to not load the iphone.

Posted Tuesday, June 23, 2009

Gravatar Image

Will said...

Dave,

If you are trying to update the firmware you will need to hide the recovery device. The usbhid does not access the normal iPhone device on my system, but there could be other modules/services trying to access it.

I tested this out under Ubuntu and had to do a few additional steps to make it work. These are related to the link posted by Loke, I added some additional rules for hald that ignore the iphone device and then I also needed to add snd_usb_audio to the blacklist as it kept trying to recognize the iPhone as a mic device.

Posted Monday, July 06, 2009

Gravatar Image

Phoenix said...

This is an old thread, but it put me on the right track to getting VMWare and my iPhone. Between this and http://en.gentoo-wiki.com/wiki/Syncing_an_iPhone_with_iTunes_in_a_VM, I was finally able to perform a firmware update properly.

If you are still having problems with the latest VMWare Server, the problem is that Recovery Mode disconnects and reconnects the device in rapid succession, which confuses VMWare because you can't click to reconnect the device fast enough. The solution to this is to add a line to your .vmx file (which is just a text file with all the settings for your machine) to tell VMWare to auto-connect the device:

usb.autoConnect.device0 = "0×05ac:0×1290"

(Obviously, substitute your own device ID as you did in usbhid.conf.)

Note that VMWare's interface will say that the device is disconnected, but your guest OS will see it as soon as you plug it in, so just ignore the menu item.

Posted Wednesday, November 11, 2009

Post a comment


(required, but not displayed)

(optional)

|