iPhone iOS4 upgrade on Ubuntu 10.04

I upgraded an Apple iPhone 3GS today to iOS4. It took about 3 hours with a bit of time spent messing with USB.

The platform was Ubuntu 10.04 (Lucid Lynx) with VirtualBox 3.2.4 running Windows 7.

It actually might be a stretch to call the process an upgrade.

The first thing that happened after iTunes did a sync and started the process was the phone restarted and went into “recovery mode”. This is when a logo of iTunes and a USB cable appear.

Advertising iTunes, even when you are down? This made me nostalgic for the sad mac.

Which is more helpful? You be the judge.

So, it turns out that an iPhone in recovery mode must reconnect to the same iTunes that started the “upgrade”. That is because a new OS is not just an upgrade — the phone is wiped (although I have not yet done forensics to look for residue) and then restarted before the new OS is installed.

The problem with VirtualBox on Ubuntu at this critical point is that an iPhone in recovery mode may not appear to a guest. It appeared in the list of USB devices but was greyed out and Ubuntu was not able to mount it either.

Privileges necessary to mount a “recovery mode phone” are higher than a normally operating phone. This could be related to the /dev/bus/usb directories. The character special file (e.g. /dev/bus/usb/008/001) has 664 (crw-rw-r–) permissions and is owned by root:vboxusers. The fact that it works fine before the phone goes to recovery mode must have to do with how usbmuxd and libgpod operate.

To avoid this snafu you must verify correct permissions are set for VirtualBox. In a terminal edit /etc/group so your username is in vboxusers:

vboxusers:x:groupnumber:username1,username2

Here’s the graphical version to do the same thing:

Click on System –> Administration –> Users and Groups

Then click on the Manage Groups button

Scroll down to the vboxusers group. Select it and then click the Properties button.

Click the box next to the username to add to the group.

It also is recommended to add a USB filter in the settings for the guest OS. Set the Vendor ID to 05ac

With those settings in place the iPhone will be detected and iTunes will push the new iOS4 to it. Once it restarts it will ask you if you would like to recover your data.

My experience so far is that calls still drop often and battery life is poor. The upside is that email can be threaded and supposedly it is encrypted for real this time. More on that later.

18 thoughts on “iPhone iOS4 upgrade on Ubuntu 10.04”

  1. Very nice. Thanks. I am up to the point of installing iTunes into my guest Win7. Glad I found your post. I was wondering about all the USB connectivity stuff, since I’ve never used VirtualBox before.
    Any other words of wisdom I should know before ditching my Win7 dual boot?

  2. Thanks for the info. It helped me do an upgrade with Ubuntu 10.10 and VirtualBox 3.2.10. There was one other permission related issue I had to deal with. After the first phone reboot, a new usb device (/dev/bus/usb/X/X) was created without group ownership of vboxusers but instead ownership was (usbmux:audio). I had to add myself to the audio group and restart the VM.

  3. Casey you life saver!
    It was the audio group that was stopping me! All seems to be running smoothly now! (Touch wood!)

    Had already done what Davi had said, I only wish I’d found this tutorial earlier! Would have saved me a days fiddling!

    Thanks guys!

  4. The group fixes published here did not fix my problem. After a bit of research I ran VirtualBox 3.2.12 as root (sudo VirtualBox) on my Ubuntu 10.04 host. This required creating a new VM using existing XP SP3 disk image.

    Other than having to monitor the USB mount status and remount my iPod Touch several times in the VM I was able to get iOS 4.2 installed on my iPod Touch. Shut-down the XP VM and exited the root VirtualBox app.

    Re-started non-root VirtualBox app ran without problem and the Touch was immediately captured via the USB filter using just Apple Vendor ID (05AC). Restoring data via backup restore and iPod sync as I type.

    Also noticed that “sudo VBoxManage list usbhost” and “VBoxManage list usbhost” gave very different results.

    Obviously some other permissions problem but this got me past the immediate problem of a bricked iPod Touch.

  5. Hmm… gave it a shot on a macbook pro running Ubuntu with no avail. Added the filter and myself to vboxusers, ugh back to 4.2.1

    If anyone has any insight to Ubuntu + Macbook + iPhone downgrade drop one here please!

  6. Thanks guys especially OP and Casey. Worked to update to 4.2.1 in Ubuntu 10.10 amd64 bit. (Also needed to add current user to root group in addition to vboxusers and audio, logout and log back in, register virtual Windows XP computer with iTunes, but then went seamlessly) Using Virtual Box 3.2 from Oracle

  7. Using Ubuntu 10.04, With VBox 3.2.12 running windows 7, adding current user to vboxusers, audio, and root. then logging out, then back in worked great! Thanks!

  8. Some are saying your user has to be added to ‘audio’, ‘vboxusers’, and ‘root’ – is there a way to do that without involving ‘root’? Virtualbox 4.0 on Ubuntu 10.04

  9. Tnx! Worked! it saved me a lot of time. Ubuntu maverick and Vbox 4.0.4 with winXP host.

  10. Your advice solved my iPhone recovery problem on VirtualBox 4.04, Ubuntu 10.10 host, and Windows XP guest. Thank you!

  11. I had another slight issue – there was more than just the iPhone adapter “connected” (installed/whatever). It may be beneficial to remove all other USB adapters for the sake of getting the phone to sync.

    Under my username with standard Virtualbox (4.0.4) on Ubuntu 10.10, XP guest:
    – added my username to the vboxusers – this made Virtualbox crash on boot, EVERY time
    – removed my username from the vboxusers group
    – ran virtualbox as sudo (sudo virtualbox)
    – Virtualbox kept crashing on bootup
    – removed all USB adapters except for the iPhone one, and XP finally booted AND saw the device again -was finally able to recover/update/sync again

    Now, hindsight being what it is, I could have possibly left myself in the vboxusers group and removed the other USB adapters, but I will leave that for the next update. Took me 2 1/2 hours to figure out why all of a sudden V-box was killing the guest.

  12. Thanks. This process helped me through the iOS5 update on an iPad2.

    System:
    Ubuntu 11.04
    VirtualBox 4.0.4
    Windows XP Guest

  13. Thank you!
    The USB filter tip help me fix my iphone restore issue
    Be sure to set the remote to any.
    system:
    ubuntu 11.04
    virtualbox 4.1.8
    Windows 7 gues

  14. Sir, a hundred bulls shall be sacrified in your honour, may the force let you live long and prosper.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.