huanix

chown -R huanix /

huanix header image 2

iTunes 8 running in Virtualbox 2.0 allows USB sync with iPhone and iPod Touch

November 22nd, 2008 · 23 Comments · Linux, iTunes, iphone, ubuntu

virtualbox-iphone-r8.sh

11/22/2008- STOP! DO NOT use this fix. The problem addressed by this script has been corrected in VirtualBox 2.0.6. You are welcome to try it if nothing else works for you- it won’t damage your installation and could possibly help.

This is a script that will modify the Ubuntu 8.10 (or other Debian) environment to allow you to sync your iPhone, iPod Touch, or iPod in a Windows XP VirtualBox VM.  Earlier versions of the script have high success rates. This fix solves two problems:

1. USB doesn’t work at all because there’s no mount point; edit /etc/fstab to fix it.
2. For the iPhone to sync, MAX_USBFS_BUFFER_SIZE needs to be modified in drivers/usb/core/devio.c

This version of the script will actually complete several steps:

  1. Check for the correct version of VirtualBox-2.0 and install it if the need arises.
  2. Correctly modify the /etc/fstab file to assign the usb mount point to the virtualbox group (thanks tauchris@gmail.com)
  3. Download the correct kernel source, patch it, and update the kernel.
  4. Re-initialize VirtualBox to recognize the new USB configuration.

I really believe this will simplify things for many folks. I think the greatest add on is the detection and installation of the correct Virtualbox version – it will add Virtualbox to your sources.list and add the key for you!

If the script works for you, please comment with your OS and details. If the script fails for you, PLEASE be very specific about what OS you are running and what did or didn’t happen. Comments without details don’t help anyone. If you see an exit code with a line number please include it.

You will need to re-run this script each time the Kernel is updated. The script now knows what to update and what to leave alone.

These instructions are based on my test environment. You do not have to follow them to the letter! Go ahead and try the script if you know what you’re doing!!!

1. You do not have to have VirtualBox pre-installed. The script will do that for you if it needs to.

2. Download the script to your Desktop and open a terminal window.

3. Set the script to executable, and run it as root.

  • chmod +x virtualbox-iphone-r8.sh
  • sudo [path to]/virtualbox-iphone-r8.sh

4. Run the script:virtualbox-iphone-r8.sh

5. Reboot.

  • The script downloads the kernel source, and will take approximately 400 mb and several minutes of processing to run properly.

6. In the settings tab for the virtual machine, check to be sure that USB and USB 2.0 are enabled.

7. When you run windows as a virtual machine, you will have to connect the device, then go to the “Devices” tab in VirtualBox and enable the device in “USB Devices”

These steps should set the stage for everything to work correctly on Ubuntu 8.10. If you have difficulties, please be VERY specific!

Note: At this time I am no longer working toward making this script available in Fedora and Suse. However, the kernel fix contained inside the script will work if you extract and implement it. -hb

Tags:

23 Comments so far ↓

  • Patrick Moore

    Still doesn’t work for me. It installs fine and the script runs great, but VirtualBox only recognizes the iPod Touch as a non-USB 2.0 device (‘This device could run faster’) and I still get the error 8000035.

    Hopefully VirtualBox will fix the problem soon.

  • huanix

    Hey Patrick – i actually think you’re VERY close. If you shut down the XP virtual machine and open the settings tab and go to “USB” there are two checkboxes – one for USB, and one for USB 2.0. Make sure they are BOTH checked and I think you’ll be fine!

  • Patrick Moore

    Unfortunately, the are both checked.

  • huanix

    I sent you an email about the kernel problem with 2.6.27-8 ; have you had an opportunity to look at that resolution? If we can find something that will work for sure I will hard-code it into the script. Basically, the 2.6.27-8 kernel was pulled back, but not removed, so it mucks up the kernel modification process.

  • Chris Reilly

    I have been using Ubuntu and WinXP via Virtual Box for about a month now. I am having trouble updating firmware on my iPhone from my Mac box, so I am trying to make it happen on my Ubuntu machine. Thank you very much for your handy script! For some reason I couldn’t get it to execute, but I did open it up in a tab in VIM and run all the commands in another tab in terminal, so I effectively executed it (I hope!)

    Now I’m running virtual box 2.06 and I see USB devices tab, and my Apple iPhone (Recovery Mode) shows up on the filter list. I enable it, then Windows XP SP3 and the latest iTunes- nothing. It doesn’t show up in the windows device manager nor show up under any of the USB hubs drawing power… so windows doesn’t see it at all.

    Any ideas or places to start? Thanks again for the help!

  • Chris Reilly

    well, I guess a little ./ would have saved me about 20 minutes of work!! But I learned a lot… doh!

  • Joe

    works for me, ran script then updated virtualbox to 2.0.6 and eveything is hunky dory, restoring/syncing/backups all working from within vitrualbox. had to fall back on native xp for quickpwn though :) thanks again!

  • Patrick Moore

    huanix,

    I borrowed a WD My Book from a friend and it was not recognized by Intrepid. It’s a USB device, so I figured there could be a connection (however slight) to the iPod Touch problem I am having.

    When I used the command “sudo modprobe -r ehci_hcd” the My Book showed up no problem, but of course only in USB 1.0 mode.

    So I am thinking that my USB 2.0 ehci_hcd is screwy somehow. Perhaps this has been the problem all along.

    Any ideas on how I would be able to ‘reset’ this?

  • Patrick Moore

    Okay, here’s an update (for anyone who cares).

    I went out and purchased a 4-slot USB card from Futureshop and plugged it into a PCI slot on my computer.

    Everything works perfectly now. Windows XP in Virtualbox detects my iPod Touch and Syncs great!

    My guess is that my version of echi_hcd doesn’t like my onboard USB controller. When I added a new one (the new card) that it DID like, everything was hunky dory.

    Thanks for all the help!

  • Rafael Vogel

    Hi, first of all, thanks for your effort to make iPhone “available” for us linux users!

    My config:
    Ubuntu 8.10
    Kernel 2.6.27-9-generic
    WindowsXP sp3
    iTunes 2.0.6
    iPhone 3G 2.2

    The script ran smoothly.

    I only experienced difficulties when itunes tried to upgrade the iPhone software from 2.02 to 2.2. It hangs and left iPhone in restore mode.

    After several tries, I went to a windows computer, installed iTunes, sync there, and upgraded iPhone software.

    Now, I’m synching in my virtualbox winXP, without problem (let’s wait for the next sw upgrade!)

    Thanks a lot!

  • Don Christensen

    I haven’t had a problem with syncing my iPod Touch at all, but be warned not to try to upgrade the SW. I tried and had the same issue as Rafael. Upgrade hung and left the iPod in a restore state. Only way to recover was to boot directly into Windows and do it there. Luckily I had just done a full sync before trying, it’s restoring now.

  • huanix

    I’ve upgraded my firmware for more than 12 restores on different iPhones without a problem over VirtualBox. All i had to do was be sure that I reconnected the device as it changed from live mode to DFU.

  • DeluXe

    Hey guys,

    i have a little question.
    Im running VirtualBox 2.0.6 on Ubuntu 8.04 with kernel version 2.6.24-22-generic.

    In VirtualBox i can see my iPhone, but i can’t select or activate it. The menu is always grey/disabled (not shure how it is called in english ;) ).

    Has anybody an idea what i could do to make it for my windows available? Or should i better upgrade to Ubuntu 8.10?

  • DeluXe

    Ok, i installed VirtualBox 2.1.0 and every thing is fine now. :)

  • jamie dalgetty

    i followed the instructions using the script and it worked perfectly on my up to date 8.10 64-bit install.

  • iky

    the scripts doesnt work completely……….the usb device tab in virtualbox seem to somehow recognize
    the ipod but windows doesnt as a drive……….??? what can i do..(the tab on the down of the virtualbox shows the icone for usb and recognizes the ipod but windows still doesnt ….)

  • iky

    i am running xp on a virtualbox 2.1.4..does it have somehow something to do with the ipod not recognized within xp…????

  • Alex

    I’m runninx WinXP on a virtualbox 2.1.4 on a 2.6.27-14-generic am64 version of Ubuntu.
    I ran your script.I checked the two usb box (without making any filter), but it still not working. It recognize a mass storage device but with a yellow/white bang (!)

    Do you have any idea os suggestions?

  • huanix

    The script is not necessary on VirtualBox installations greater than 2.1. My very first guess would be that you’re running the OSE version which does not provide usb support.

  • Trycer

    Hi,
    I’m running XP on VBox 2.1.4(not OSE) on Ubuntu Intrepid, 2.6.27-7 kernel
    When I plug my iPhone, xp recognize it as a camera, but iTunes doesn’t see it(actually I got the 0xE8000035 error)
    As I have a VBox installation greater than 2.1, do you think I would try this script ?

  • huanix

    The script is no longer fresh in my mind, but i don’t think it has anything harmful. with that said, i wouldn’t expect it to fix your issue.

  • Ejvind

    Hi. Thanks for the post. I’m quite new to Ubuntu, but I am rying to get freak’in iTunes to run i VBox so I can sync, my freak’in iPhone on my laptop. I can’t get the script to work, so I was wondering if there is a secret password, like open sesame, to make it work. I hope for a soon reply.

    Kind regards Ejvind (from Denmark)
    Runing Ubuntu 8.10 and Windows XP in Virtualbox 2.2

  • Ejvind

    Ps.. Im getting a lame ass excuse from iTunes, it says it dosn’t want to work because of e 00 something something 085, or something like that.

Leave a Comment