huanix

chown -R huanix /

huanix header image 2

You CAN Upgrade and Restore Apple iPhone firmware in a VirtualBox machine!

November 23rd, 2008 · 28 Comments · Intrepid, iTunes, iphone

Restoring an iPhone inside VirtualBox

Restoring an iPhone inside VirtualBox

It was a little nerve racking for a minute, but I can confirm that it is possible to upgrade and restore iPhone firmware in a virtualbox environment. It is actually simple, the only thing I had to do was re-connect the iPhone to the VM twice during the Restore.

The screenshot shows Ubuntu 8.10 Interpid Ibex as a host, with Windows XP running in a Virtual Machine (VirtualBox) in the foreground. You can see iTunes 8 running, having just completed the firmware upgrade.

I used a custom ipsw that I got from the internet so I didn’t upgrade my baseband. I suggest you do this or something similar to maintain the OPTION to unlock your phone in the future. (I don’t expect to unlock my phone, but I want to keep the option!)

I got the modified 2.2 firmware image from tpb, you can search for it as “iPhone1,2_2.2_5G77_Custom_Restore.ipsw” – it is listed under mac applications (!?)

So, when you’re ready to try to upgrade your firmware, hover your mouse over the usb icon in the VirtualBox tray and make sure it stays connected. Check the connection by right clicking on the USB icon. When the Restore/Upgrade goes through stages it will disconnect the phone and you will need to re-connect it by re-activating the checkbox.

For the Record: I tested VirtualBox 2.0.6 myself and iPhone sync DOES work when you enter a correct /etc/fstab entry.

Tags: ·····

28 Comments so far ↓

  • Joey

    Wait…doesn’t the brand-spanking-new VirtualBox 2.0.6 fix iPhone USB support, meaning users won’t have to run the script?

  • huanix

    It was supposed to have been fixed, but you can see at http://www.virtualbox.org/ticket/491 that it has been re-opened. I’m still not sure. Need to test.

  • huanix

    I tested. VirtualBox 2.0.6 works. Be sure to add an /etc/fstab entry for usb.

  • epoch

    Hey man just stumbled across your blog and wanted to say thanks. Just picked up an iPhone today and I hope all your hard work pays off (I’ll be installing an XP image tomorrow and will report back)

  • chris

    Confirmed. I had to connect it to VBox again a couple of times — this is what I think was hanging me up before – I assumed that VBox would just simply grab the iPod again from Ubuntu.

  • S-Mies

    Thanks for the info, I just upgraded my touch to 2.2 with VBox 2.0.6 :)

  • Nathan

    You can use the filters in VirtualBox to automatically reconnect the iPhone to the VM.

  • huanix

    You’re right – thanks Nathan.

  • Christopher Kelly

    I wouldn’t have expected this to work, but after reading this I gave it a shot.

    With 2.0.6 and the fstab entry I was able to update my iPhone from 2.1 to 2.2 with iTunes and then and unlock and jailbreak with QuickPwn. The latter was slightly tricky–you have to keen an eye on the USB icon in the VirtualBox status bar and make sure the right device is selected. A new entry is created in there when the iPhone enters DFU mode.

  • tentotwo

    Phew, thanks for that, I was already starting to panic when my upgrade attempt timed out… Works fine now.

  • CXypher2

    I haven’t had any problems using 2.06 with my 3G until now:

    I forgot to manually reconnect while in recovery and now VBOX tells me it cannot attach usb device…
    –> check usbfs

    i tried setting it to DFU.. same story…

    I shut down my vbox and reboot.. now every usb entry is greyed out and i cant access anything anymore…

    HELP VBOX MASTER!!!

  • Cypher2

    GOT IT TO WORK!!
    sudo gedit /etc/ftstab:

    none /proc/bus/usb usbfs devgid=125,devmode=666 0 0

  • Matt Tretin

    This works. Follow the steps here:

    http://ubuntuforums.org/showthread.php?t=970628&highlight=iphone

    For firmware upgrades:

    Then be sure that you tell VBox to allow the iphone to ass through after it changes out of recovery mode!

    This was the key mentioned above to de-paper weight my phone.

    Thanks a bunch — you saved my neck!

  • lukeab

    ooh, Matt, don’t do it like before, it’s a nasty messy kernel hack to make the 2.0.4 work, just get virtualbox 2.0.6 and upgrade the vboxdrv kernel module, ensure you have the fstab entry and it works.. just trying to get 2.2 on there, like said above, there is a slight glitch in that the usb device disconnects and if you dont’ see that itunes will wait for a short while then time out and loose the connection. Havn’t set the filters in the device settings in virtual box to hook up the usb device automatically.
    One extra note,, worked under vbox 2.0.6 / Vista Business 64… which after i setup the correct podcast subscriptions for the iphone to just download independantly, may never have to boot again, pending itunes under wine! come on huanix, “you can do it, rip his ****ing head off!” Or something to that effect.

  • huanix

    Does it make me slow if i can’t completely follow the insane banter on my own blog? Despite the “huanix” nic, i have been speaking English for my entire life and i am still confused. Luke is right though; there’s no more need for the instructions on that Matt pointed to – it’s easier now:
    1. add the virtualbox repository
    2. sudo apt-get install virtualbox-2.0
    3. create an entry in /etc/fstab
    4. enable usb in virtualbox
    5. Give money to Bill Gates. (Trying to remove this step!)

  • EricC

    Im all confused.. Ive got 2.1.0 VB, It picked up iphone, itunes threw me an error, and now it wont recognize my iphone anymore. just stays grey even if i reboot uncheck usb.. nothing works.

  • LKRaider

    I got error 2003 when trying to upgrade my iPhone, and it got stuck on recovery mode.

    I had to use a computer with windows installed to restore it.

  • axkiller

    Works fine for recovery mode:
    You just need to :
    sudo gedit /etc/fstab:
    add this line:
    none /proc/bus/usb usbfs devgid=125,devmode=666 0 0

    run mount -a in a console
    restart virtual box

  • axkiller

    Then either click “Add filter from device” or press Alt + Insert. Now clear all fields except “Name” and “Vendor ID” then click OK. The reason for this is that the iPod will go through 3 different “Product IDs” during the restore/jailbreak routine and we need this filter to be a catch-all.

    Tutorial:
    http://www.squidoo.com/iPod-Jailbreak-via-VirtualBox

  • HowlinPreacherMan

    @axkiller–
    Worked great. Had to uncheck/check the box a couple of times, but that’s it.

    Upgrading to OS3 on my iPhone in a Vista guest system on LinuxMint (Ubuntu derivative) host.

  • Fatrix

    Worked. Thank you for the hints.
    My first try ended in an error while I went out with my dog.
    Then the iphone was in recovery mode and I am now restoring it, must already reconnect it to the virtualbox three times!
    CU

  • jimmy

    excellent work, right now my ipod its showing the progress bar of a restore, getting ready for OS 3.0

    hope it doesnt fail (its been like that for about 1 minute)

    thx!

  • jimmy

    didnt work

    got error (1601, or 1611)

  • jimmy

    WORKED!

    FUCKING WORKED!

    just made sure it kept connected and that the usb icon on VB dindt stop flashing and finally 3.0′ed!!

  • Phil

    It works great – thanks!!!. Being a long way from home and AT&T, you just saved me being phoneless for another 4 weeks (which is how long its been so far).
    I think axkiller really got it with the USB filter so that the device reconnects automatically without having to watch it. Fatrix and jimmy also helped by suggesting trying one more time. It seems that the first one or two times you might get an error 1601 or 1611. Then just enough of the initial restore seems to ‘take’ to let the real restore to kick in.
    BTW I’m using Ubuntu 9.04, VirtualBox 2.2.4 and guest Windows 2003 OS (with a hack of the iTunes install to let it install on that OS).
    THANKS!

  • Planchet

    It worked!!! Many thanks!
    Have been strugling with the firmware update for hours.

  • Ryn

    OH MY GOD. You are my favourite person in the world right now. The hovering my mouse over the usb thing is what worked. Thank you!!

  • Craig

    Trying to upgrade from V3 to the latest V3.x. The above instructions allow phone to reconnect ok but still fails with either error 13 or 1611. Phone is now a paper weight:( Does anyone have any ideas how to progress this?

    I’m using Ubuntu 9.04 with VirtualBox V3.08 and a WinXP guest with iTunes on it.

    Cheers,

    Craig

Leave a Comment