Finally, it’s working. Mounting the iPhone in Linux over USB. No stupid (ADHOC) wireless connection is required. It also works on non-jailbrroken iPhones. Though, the developers still say that only “developers” should use it. Of course there is still a problem accessing the Media iTunes library on the iPhone – the key Apple uses on the latest iPhone firmwares has still not been discovered. But instead of using the iPod software on the iPhone, I now use the very promissing pwnplayer which is able to play music from the iPod library on you iPhone, as well as MP’3 you copied to a directory on the iPhone. MewSeek, an application for musioc downloading, works very well together with pwnplayer. JPG images from the iPhone Photo Camara can also be accessed.
The project you need to mount the iPhone in Linux is called iFuse. iFuse is a module for the FUSE(Filesystem in Userspace) system. The project contains libiphone, which is used to access USB and does the lower level translations. Unfortunately, I could not find howto’s on the projects main website. But with some googling, I found the answers.
edit: iFuse is now providing DEB and RPM packages on there website now: iFuse. See /usr/share/doc/ifuse/README of their ifuse package for usage instructions.
Install libiphone (as root)
git clone git://github.com/MattColyer/libiphone.git
./autgen.sh
./configure
make
make install
Install iFuse (as user)
git clone git://github.com/MattColyer/ifuse.gi
./autgen.sh
./configure –prefix=/
make
make install
Generate keys (as user)
/usr/local/bin/libiphone-initconf
(This will generate some keys required to connect with the iPhone over USB)
Mount the iPhone’s root filesystem including the Media partition (as user)
mkdir /mnt/iPhone (make sure you have write access to the mount mount)
mount.fuse.ifuse –afc2 none /mnt/iPhone/ -s
(The -s options seem to be related to threading/locking issues and is a workaround)
Or mount the iPhone’s Media partition only (as user)
mount.fuse.ifuse none /mnt/iPhone/ -s
Or mount as root
mount mount none -t fuse.ifuse /mnt/iPhone
Unmounting (as user)
fusermount -u /mnt/iPhone
Umounting (as root)
umount /mnt/iPhone
I have been testing this on Ubuntu Intrepid. It would be nice to see GNOME GVFS to automount the iPhone over USB. After some investigation of this matter I must conclude that UDEV, HAL, DBUS, GVFSD, GVFSD-backends are used to do the automounting in GNOME – which is quite complicated
– I could not find any scripting-hooks (or configuration options) in GVFSD to do some BASH magic and auto mount the iPhone in GNOME.
The performance, using Nautilus to copy data from/to the iPhone is:
Write (computer-to-iPhone): ~750 KB/s
Read (iPhone-to-computer): ~2.9 MB/s
Not bad – although writing is a bit slow compared to the avg-read time. The iPhone 2.0 seems to be connected over USB 2.0 (480 mbit/s):
T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 27 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 3
P: Vendor=05ac ProdID=1292 Rev= 0.01
S: Manufacturer=Apple Inc.
S: Product=iPhone
Alternatives:
Mounting using SSH/SFTP over ADHOC wifi connection
iTunnel using modified libiphone
Links:
A small script to mimic a bit the GNOME GVFS auto mounting function:
#!/bin/sh
mntp=/home/johan/mnt/iPone
if ! ( mount | grep $mntp ); then
mkdir -p $mntp
mount.fuse.ifuse -afc2 none $mntp -s
notify-send -u normal "iPhone Mounted" "The iPhone is now mounted."
nautilus $mntp
else
fusermount -u $mntp
rmdir $mntp
notify-send -u normal "iPhone Un-Mounted" "The iPhone is now un-mounted."
fi