understandable linux tips, tricks and tutorials

For quite some time, using your iPhone or iPod Touch on Linux was a challenge. There were two options – jailbreak it, and connect over wifi – this would let you upload and download music, but not much else. Alternatively, you could run a Windows in a VM and do it that way – not really using it with Linux at all really. However, a project libimobiledevice allowing Linux users to use their iPhones on their OS of choice has reached the 1.0.0 release. This doesn’t mean that you can do everything on Linux with the iPhone that you can do with iTunes, but it’s getting there, and the key things are there, namely:

  • File system access
  • Music Sync with Rhythmbox or GTKPod
  • One way PIM (contacts, calendars etc) sync – device -> computer
  • USB internet tethering
  • SSH tunneling (if device is jailbroken)
  • Installing, uninstalling and archiving apps
  • Manage Springboard

Installation

Installation should be relatively straightforward for the mainstream distros. You will need to install libimobiledevice, ifuse, libplist and usbmuxd. You will also need to make sure that the version of libgpod installed is >= 0.7.90. However, are packages in the official repositories for Mandriva, Fedora and Ubuntu Lucid. There is a PPA for Ubuntu Karmic. There is also a repository for OpenSuse 11.0, 11.1, 11.2 and Factory. Alternatively, if you can’t find packages for your distro, you’ll have to compile from source. You can find the packages from here.

In addition to the above core packages, there are a few other apps that you might want to install to get full access. However, I should warn you, installing them requires you to do some hardcore compiling. You’ll need to download the source from each project’s git repository. I’d suggest you try the USB/ethernet kernel module first, as this website has a very good step by step guide to downloading the source and compiling it. You should then be able to replicate this process for ideviceinstaller (used to install/uninstall/archive apps) and for sbmanager (used to manage icons on springboard). If you’re going to install these packages, then you’ll need to install the -dev or -devel packages for libimobiledevice, ifuse, libplist and usbmuxd. You’ll also need to make sure you have git installed to be able to download the source.

Syncing Music

Probably the first thing you need to do is to see if libimobiledevice sees your iPhone/iPod Touch. To do so, type ideviceinfo in a terminal, while your device is attached via USB, and you should get a very long list of output. Assuming all that worked, you’ll need to mount your iPhone. I tried to mount the device at /media/ipod, which is where you would expect to find it. However, I have run into a few issues with this. I can only mount to /media/ipod as root, which means applications like rhythmbox and gtkpod can’t read or write to the device, unless they are run as root – not a great idea. So to get around this, I’ve been mounting the device at ~/ipod. To do this, type:

matt2@linux-f215 ==>mkdir ~/ipod
matt2@linux-f215 ==>ifuse ~/ipod
matt2@linux-f215 ==>ls -l ~/ipod
total 0
drwxr-xr-x 2 matt2 users   68 2010-03-20 21:24 ApplicationArchives
-rw-r--r-- 1 matt2 users    0 2010-02-04 17:31 com.apple.itdbprep.postprocess.lock
-rw-r--r-- 1 matt2 users    0 2010-02-04 17:31 com.apple.itunes.lock_sync
drwxr-xr-x 4 matt2 users  136 2010-02-04 17:32 DCIM
drwxr-xr-x 2 matt2 users  102 2010-04-12 12:07 Downloads
drwxr-xr-x 7 matt2 users  238 2010-04-10 08:59 iTunes_Control
drwxr-xr-x 2 matt2 users   68 2009-12-18 21:33 Photos
drwxr-xr-x 3 matt2 users 1768 2010-04-12 12:07 Podcasts
drwxr-xr-x 2 matt2 users   68 2010-02-04 18:32 PublicStaging
drwxr-xr-x 4 matt2 users  272 2010-03-30 21:01 Purchases
drwxr-xr-x 2 matt2 users  102 2010-02-04 17:33 Recordings
drwxr-xr-x 2 matt2 users  102 2010-03-21 06:01 Safari

Assuming you can see the iPhone’s filesystem at ~/ipod, you should be able to fire up gtkpod, specify that your iPhone is located at ~/ipod, and then sync your music from there. Unfortunately, rhythmbox looks for the iPhone to be mounted at /media/ipod. I’m still looking for a workaround for this, but at the moment you can sync music via gtkpod.

Managing Springboard

To manage the icons on the Springboard launcher on your phone, you can do this with the sbmanager program (see above). This is a pretty straightforward application, and little explanation is necessary. Check the video below.

embedded by Embedded Video

YouTube link to HD version 

Backup Your Phone

You can backup your phone with a simple command:

matt2@linux-f215 ==>idevicebackup backup /directory/to/backup/to

This little program will simply pull down all of the content from your phone to the directory that you specify. You can then restore this with:

matt2@linux-f215 ==>idevicebackup restore /directory/to/backup/to

Pretty simple really

Internet Tethering

Again, this is pretty simple – once you’ve got the ipheth kernel module installed (see above). To load the module, use the insmod command as root. Once the module is loaded, you should have a new network device (in my case eth0). This operates just like any other network device and you should be able to access the internets using your phone as a 3G modem.

There are other more esoteric functions available with libimobiledevice, but these aren’t really very “desktoppy” so I’ll leave those for another day.

12 Comments
  1. Thank you, have been trying to connect my iPhone for weeks. Easy to follow and it worked!

  2. Can’t thank you enough, you’ve given me Led Zeppelin back :)

  3. I have followed your 3 steps listed in the box under “Syncing Music” and got the file/directory results shown. But it doesn’t stick and sometime when I issue the last two commands again I get message “There was an error accessing the mount point: Input/output error”. Even after successful execution of the commands I never could get “gtkpod” to see the iPone. The version I have doesn’t have “iPod Properties” for my 3GS phone. I’ve been working on this for many weeks and am really get fed up with the inability to use openSUSE/Linux to support my iPhone. Any suggestions would be greatly appreciated. Thank you!

  4. @David
    Yeah I have the same problem I have the 3.1.3 firmware installed…also the “changes” that are made to my ipod aren’t actually made at all as soon as I close gtkpod it’s back to the way it was before. I too would greatly appreciate any help Thanks

  5. On the “There was an error accessing the mount point: Input/output error” message – Try manually unmounting the directory you mounted your ipod/itouch on earlier. I was experiencing the same errror until I ran: sudo umount /media/itouch (or whatever mounpoint you may have used). Apparently that directory was not getting umounted from earlier in the day and causing problems when I tried accessing my itouch later.

  6. Thank you for your help. I got evry thing work, but tethering. When I “use the insmod command as root” I got this “Usage: insmod filename [args]“. What file name should I use ?

    IPhone 3 (GS). IOS 4.1

    Jeffrey


  7. Name (required):

    Thank you for your help. I got evry thing work, but tethering. When I “use the insmod command as root” I got this “Usage: insmod filename [args]“. What file name should I use ?
    IPhone 3 (GS). IOS 4.1
    Jeffrey

  8. I have managed to get an access to my ipod touch 4g using ifuse. Thanks for the tip on mounting as normal user.

    I have treid syncing it with gtkpod. Gtkpod shows the contents of my ipod but when i any files that i add on my ipod from gtkpod are not shown on removing the ipod.If you know how to get the syncing done please let me know.

  9. What I did so I could mount it in /media/ipod was

    chmod a+rwx /media/ipod

    then as user not root it mounted fine for me

    ifuse /media/ipod

  10. when you mount the ipod to /media/ipod, run “sudo chown username /media/ipod” to change the permissions of the directory. so that you can write to it.

  11. Great post! Wine sucks for iPod syncing, and I’ve been at a loss for syncing up to my music library on my Fedora system. This works great! for those trying this out, don’t forget the ifuse ~/iPod line to mount the iPod. It’s easy to skip over that line when browsing quickly :)

  12. Morning, this work on 11.04, i like ideia use linux on Iphone 3Gs, thank you returne,

    Regads Fernando.

Leave a Reply

Site last updated October 20, 2012 @ 12:53 pm; This content last updated September 13, 2012 @ 2:12 am