Syncing your iPod/iPhone in Linux via VirtualBox

Discussion in 'iPod touch' started by JIMIneitor, Jun 13, 2009.

  1. JIMIneitor

    JIMIneitor Banned

    Joined:
    Feb 21, 2009
    Messages:
    1,125
    Likes Received:
    5
    Device:
    4G iPod touch
    I dont know if this has been posted before, however, here's the guide to sync (not restore) your device via USB using Virtual Box

    Please Register or Log in to view images



    You can either follow the guide step by step, or use the little script I made.

    Code:
       1.
    
          Add the Virtualbox repository and key as detailed on this page. Select the repository matching your distribution and add to /etc/apt/sources.list file. For example, the Intrepid Ibex line is:
    
          deb http://download.virtualbox.org/virtualbox/debian intrepid non-free
    
    (You should change the "Intrepid" line with whichever Ubuntu Version you're using, and if you're not in Ubuntu, take a look at the VIrtualBox site) 
    
          Now add the key for this repository.
    
          wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add - 
    
          Now update your apt cache:
    
          sudo apt-get update
    
       2.
    
          Remove the package virtualbox-ose:
    
          sudo apt-get autoremove virtualbox-ose 
    
          Now install the latest Virtualbox, at the time of writing this is version 2.2.
    
          sudo apt-get install virtualbox-2.2 
    
       3.
    
          Add your username to the vboxusers group. Don't forget to substitute your username:
    
          sudo gpasswd -a YourUserName vboxusers 
    
    (Replace "YourUserName" with yours, obviously)
    
       4.     We new entry in the file '/etc/fstab' to correct USB permissions. To do this, first you need to know what the group id (GID) is for the group vboxusers. Run this command:
    
          sed '/vboxusers/!d;s/vboxusers:x:\(.*\):.*/\1/' /etc/group
    
          The output should be a number. Now edit /etc/fstab and add the following line, but make sure you set the devgid= number to the output of the previous command.
    
          none /proc/bus/usb usbfs devgid=123,devmode=664 0 0 
    
       5.
    
          You can now start up Virtualbox, located under System → Sun Virtualbox . Create a new machine; the wizard will guide you, the details are outside of the scope for this howto. Within the settings for the machine, ensure both "Enable USB Controller" and "Enable USB 2.0 (EHCI) Controller" are ticked. You can also add a filter to make the iPhone/iTouch automatically pass thru here, otherwise you will have to manually select and enable it when plugged in.
       6. Install Windows and iTunes in the VM. Windows XP and iTunes 8 is known to work. The Virtualbox guest addons are also recommended for performance and integration, but are not explicitly required. Again, the details of this are outside of scope, but are straightforward. 
    
    7. Boot the VM, plug in iPhone (and select it to be passed thru via the VM menu if you didn't add a filter before) and confirm iTunes detects it. All systems go for iLaunch!
    
    Note: I (JIMIneitor) tested this ny myself, and tested everything, evend restoring, and I can say that everything works excellent but restoring, you can sync, back-up, install apps, remove apps, everything, but you won't restore it using VirtualBox.
    
    Troubleshoot
    
       1.
    
          iTunes error 0xe8000035: Windows sees the iPhone correctly, and attempts to download pictures, but iTunes doesn't connect correctly. One cause of this is MAX_USBFS_BUFFER_SIZE being too small in /drivers/usb/core/devio.c. The author had this problem in Hardy Heron. Here is how to recompile "only" this module for Hardy (thanks to remainder comment 2008-09-21 04:22:26):
    
          cd /usr/src
          sudo apt-get build-dep linux-source-2.6.24
          sudo apt-get install linux-source-2.6.24 build-essential
          tar -jxvf /usr/src/linux-source-2.6.24.tar.bz2
          cd linux-source-2.6.24/drivers/usb/core
          sudo perl -pi.bak -e 's/16384/131072/' devio.c
          make -C /lib/modules/`uname -r`/build/ M=`pwd` modules
          strip --strip-debug usbcore.ko
          sudo install -m644 -b usbcore.ko /lib/modules/`uname -r`/kernel/drivers/usb/core
          sudo depmod -ae
          sudo update-initramfs -u
          sudo reboot
    
          You could instead modify /drivers/usb/core/devio.c and recompile the whole kernel if you wanted to. Note that this error can also occur for lots of other reasons, including bad cables, 3rd party docks etc. Ask Google about this error for lots of other possibilities.
       2. The VM seems to lock up at boot if an iPhone is plugged in at boot time. Try booting without the iPhone plugged in! 

    Here's the script I promised:
    virtualbox.sh

    Important note: Make sure to read the whole script in order to understand it, because theres an error i couldnt workout.
    And the script only works with ubuntu"
  2. gammaraptor

    gammaraptor New Member

    Joined:
    Mar 25, 2009
    Messages:
    347
    Likes Received:
    0
    Device:
    2G iPod touch
    I didn't have to do any of that to get it to work
  3. JIMIneitor

    JIMIneitor Banned

    Joined:
    Feb 21, 2009
    Messages:
    1,125
    Likes Received:
    5
    Device:
    4G iPod touch
    what did you do then?
  4. satimis

    satimis New Member

    Joined:
    Nov 18, 2009
    Messages:
    4
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Hi JIMIneitor,


    I just got a IPhone 3GS, jailbroken.

    I set up the settings, entering the server info of the 3G provider. Then my IPhone works without problem.

    Your steps need Windows licence. I cease running Windows almost 10 years. Therefore I don't have Windows OS. After searching around I found iTune 8 runs on wine without problem. I don't know whether iTune 9 works on wine. Any information?

    My discovery is banshee, rythmbox, etc. also work to connect IPhone. But if I can solve the problem running iTune 9 on wine I still prefer using iTune 9 to do the job.


    B.R.
    satimis
  5. JIMIneitor

    JIMIneitor Banned

    Joined:
    Feb 21, 2009
    Messages:
    1,125
    Likes Received:
    5
    Device:
    4G iPod touch
    you cant run itunes on linux, well, you can, but it wont work with idevices
    to use your idevice on linux you absolutely need either a working windows installation or a mac, the original post is how i made it to sync my ipod, and i only used windows for that, nothing else
  6. satimis

    satimis New Member

    Joined:
    Nov 18, 2009
    Messages:
    4
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Hi JIMIneitor,


    Thanks for your advice.

    I know following thread sometimes,

    PortableDevicesiPhone
    https://help.ubuntu.com/community/PortableDevices/iPhone

    It needs Windows running on the VirtualBox. My problem is I don't have Windows licence. I already ceased running Windows for more than 10 years.


    iTune 8 runs on "wine" without problem, upload/download files to/from IPhone. I'm aware that after having intense googling around. But iTune 9 is unable to run on "wine" doing the same job for the time being. It is broken. I trust the problem can be sorted out very soon.


    Also I found following thread;
    How to connect iPhone/iPod Touch (Using USB) in Karmic/Jaunty/Intrepid/Hardy
    http://www.ubuntugeek.com/how-to-connect-iphoneipod-touch-using-usbin-karmicjauntyintrepidhardy.html

    I'm now testing it. Unfortunately I don't have a spare PC for this testing. Therefore I install iFuse on a VM of the Virtual Machine which runs Debian5.0 on host and Ubuntu 9.04 on VM. The installation is completed, no problem encountered. However after connection via the USB cord IPhone can be detected by the host. Photos and Video on the IPhone can be detected and download to the host without problem. But IPhone can't be detected by the VM. Neither can I find the mountpoint of the IPhone on the host. I'm still struggling to sort out this problem. Where is the mountpoint. If without result I have to find a spare PC for this test.

    Have you got any idea? TIA

    B.R.
    satimis
  7. satimis

    satimis New Member

    Joined:
    Nov 18, 2009
    Messages:
    4
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Promble seemingly solved

    Hi folks,

    I install iFuse on an Ubunutu 8.04 desktop according to following articles;

    Ubuntu Linux Tutorials,Howtos,Tips & News | Intrepid,Jaunty,Karmic
    How to connect iPhone/iPod Touch (Using USB) in Karmic/Jaunty/Intrepid/Hardy|Ubuntu Geek

    Plugin the IPhone 3GS via USB cord.

    satimis@vz0:~$ sudo usbmuxd
    satimis@vz0:~$ sudo ifuse /media/iphone/

    Now it mounts the IPhone 3GS.


    satimis@vz0:~$ ls /media/iphone/
    Code:
    com.apple.itdbprep.postprocess.lock  Downloads       Podcasts
    com.apple.itunes.lock_sync           iTunes_Control  Purchases
    DCIM                                 Photos          Recordings
    
    satimis@vz0:~$ ls /media/iphone/DCIM/
    Code:
    100APPLE
    satimis@vz0:~$ ls /media/iphone/DCIM/100APPLE/
    Code:
    IMG_0002.JPG  IMG_0003.JPG  IMG_0005.MOV  IMG_0006.JPG
    
    satimis@vz0:~$ ls /media/iphone/Downloads/
    No output


    satimis@vz0:~$ ls /media/iphone/iTunes_Control/
    Code:
    iTunes  Music  Ringtones
    
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/iTunes/
    Code:
    IC-Info.sidv         iTunesLock         ShowLicense
    iTunesControl        iTunesPrefs        ShowMarketing
    iTunes Library.itlp  iTunesPrefs.plist  ShowRegistration
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/iTunes/iTunes\ Library.itlp/
    Code:
    DBTemp        Extras.itdb   Locations.itdb
    Dynamic.itdb  Library.itdb  Locations.itdb.cbk
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/iTunes/iTunes\ Library.itlp/DBTemp/
    Backup  ddd.itdbm
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/iTunes/iTunes\ Library.itlp/DBTemp/Backup/
    Code:
    iTunes_Control
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/iTunes/iTunes\ Library.itlp/DBTemp/Backup/iTunes_Control/
    Code:
    iTunes
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/iTunes/iTunes\ Library.itlp/DBTemp/Backup/iTunes_Control/iTunes/
    Code:
    iTunes Library.itlp
    
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/Music/
    Code:
    F00  F04  F08  F12  F16  F20  F24  F28  F32  F36  F40  F44  F48
    F01  F05  F09  F13  F17  F21  F25  F29  F33  F37  F41  F45  F49
    F02  F06  F10  F14  F18  F22  F26  F30  F34  F38  F42  F46
    F03  F07  F11  F15  F19  F23  F27  F31  F35  F39  F43  F47
    All of them are directories/folders

    satimis@vz0:~$ ls /media/iphone/iTunes_Control/Music/F00/
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/Music/F01/
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/Music/F02/
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/Music/F03/
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/Music/F48/
    satimis@vz0:~$ ls /media/iphone/iTunes_Control/Music/F49/
    I suppose all of them are empty directories


    satimis@vz0:~$ ls /media/iphone/Photos/
    satimis@vz0:~$ ls /media/iphone/Podcasts/
    satimis@vz0:~$ ls /media/iphone/Purchases/
    All of them without output


    satimis@vz0:~$ ls /media/iphone/Recordings/
    Code:
    Recordings.db

    satimis@vz0:~$ ls /media/iphone/iTunes_Control/Ringtones/
    No output


    No GUI. I think I can upload music/photo files on the IPhone.

    What shall I do next? To copy music files to the IPhone on Console? .mp3 file? Or other file format?

    Please advise. TIA

    B.R.
    satimis

Share This Page