Ubuntu / Linux news and application reviews.

Like WebUpd8 reader StoneCut said in a comment on it's previous tip, he wrote yet another post for iPhone owners which use Linux. So here it is:

In our previous tutorial we showed how you to access the iPhone OS 3.x filesystem and read/write to its music database using iFuse and by compiling our own libgpod4. Then we had to create a file on the iPhone, manually mount the phone each time and so on. Maybe a bit complicated for an average user.

However, there is now a lot easier way using GVFS which will automount your iPhone for syncing with Rhythmbox, for example. And you don't need to compile anything anymore. It works for Ubuntu Karmic and Lucid (only Karmic tested). The required PPA does not carry any packages for Jaunty, sorry.

Important


If you followed our previous tutorial, you will need to remove anything related to it. Here are the most important steps:
sudo apt-get remove gvfs-backends ifuse libiphone-dev libplist0 libplist-dev libiphone0 libiphone0-dev limobiledevice0 libgpod4 libusbmux0 libusbmux-dev gtkpod gtkpod-common


You also need to remove the Jona Beck PPA repository from your Software Sources (deb http://ppa.launchpad.net/jonabeck/ppa/ubuntu karmic main) ! After that, update all source lists one more time:
sudo apt-get update && sudo apt-get upgrade


Now, just to be sure: Reboot.


Setup GVFS support for iPhone


For this to work, your iPhone does NOT need to be jailbroken, unless you want to mount the root file system using ifuse for some reason.

1. First off, we need to add this PPA:
sudo add-apt-repository ppa:pmcenery/ppa


2. And update your sources and packages:
sudo apt-get update && sudo apt-get dist-upgrade


3. Now let's install the relevant packages:
sudo apt-get install gvfs gvfs-backends gvfs-bin gvfs-fuse libgvfscommon0 ifuse libgpod-dev libgpod-common libimobiledevice-utils libimobiledevice0 libimobiledevice-dev python-imobiledevice libplist++1 libplist-utils python-plist libusb-1.0-0 libusb-1.0-0-dev libusbmuxd1 usbmuxd


-> Optional (I personally prefer GTKpod)
sudo apt-get install gtkpod


4. Now we need to add ourself to the group "fuse" so we can mount the device as regular user (without sudo):
sudo adduser $USER fuse


Additionally, we need to edit a file to allow regular users to mount this device:
sudo gedit /etc/fuse.conf


Find the line that says "#user_allow_other" and remove "#" in front of it so it says: "user_allow_other".

That's it. You can now just plug in your iPhone and use it with Rhythmbox, Nautilus or whatever. You won't need to do anything else. Your iPhone will appear twice on your desktop: Once as the PTP camera device you probably know already and once again with a mobile phone icon from where you can access the file system. Congratulations !

There's one last catch if you installed the optional GTKpod. For GTKpod you will still need to manually mount the device to /mnt/ipod using ifuse.

So let's set things up for that, too:
sudo mkdir /mnt/ipodsudo chmod 777 /mnt/ipod


Ok, now if you want to use your iPhone with GTKpod you will need to mount and umount it manually everytime.

To mount (the just launch GTKpod and let it read the device):
ifuse /mnt/ipod


Make sure you unmount inside GTKpod when you're done and then issue this command:
fusermount -u /mnt/ipod


If your iPhone is jailbroken, then you can also mount the root file system using iFuse but this is not recommended if you just want to sync music. Here's how to do it anyway:
ifuse /mnt/ipod --root




Extra Tip:

If your device is jailbroken and has an SSH server installed you can also access your iPhone via SSH over USB:
sudo iproxy 2222 22


Now you can SSH into your iPhone via USB:
ssh -p 2222 root@localhost

That's all folks :)

[A big thank you to StoneCut for writing this article, all the credits go to him]