Sync Your iPhone Wirelessly in Linux
Posted by Kevin Purdy at 2:00 AM on May 10, 2008

Apple may open up its iPhone and iPod touch devices to third-party apps next month, but the chances that Linux users will get invited to the party are slim at best. That hasn't stopped some intrepid hackers from coming up with a better music-syncing solution than the one Mac and Windows users have—a two-way wireless transfer, from almost any music organising app you like, no wait for iTunes or USB cable required. Linux users, let's take a look at how to set up your iPhone or iPod touch for any-time wireless access after the jump.
Note: I'm using Ubuntu Hardy Heron (8.04) to access an iPod Touch, but the software and steps should be much the same for other distributions and an iPhone.
Set up your iPhone/iPod touch
First things first, you'll need to jailbreak your Apple device. You can easily jailbreak any model using the Windows/Mac application ZiPhone. When your device is up and running again, head to Settings->General->Auto-Lock, and set to "Never" (to prevent the unit from disconnecting while performing longer file syncs; you can turn this on when not syncing to save battery life). ZiPhone automatically installs two third-party apps—BSD Subsystem and OpenSSH—that we'll need going foward; if you're using a non-ZiPhone-opened device, install those from the Installer.app link.
You've got two quick things to do on your newly-jailbroken iPod touch/iPhone. First, head to "Settings" from the main menu. Connect to the same Wi-Fi point as your computer, then hit the little blue arrow next to it. You'll see your IP address in the top line; note this somewhere, and hit the "static" button to have your device always connect at that address.
Head back to the "Settings" menu, choose "General," then set "Auto-Lock" to "Never." This prevents the device from locking itself after a period of inactivity and losing its Wi-Fi connection, which would disrupt large file syncs.
Prepare your Linux system
If you're running Ubuntu Hardy Heron (8.04), you only have to install the ipod-convenience package in Synaptic or through a terminal line, and make sure that libgpod3 was installed by default. If you're running Gutsy (7.10), you'll need to add the following line to your repositories. Open Synaptic, head to Settings->Repositories, then the "Third-Party Software" tab, hit "Add," and paste in this line: http://ppa.launchpad.net/ipod-touch/ubuntu gutsy main
Hit "Reload" when prompted, then install the ipod-convenience package. While ipod-convenience is installing, you'll be asked for your iPhone/iPod's IP address and mount point. Enter the IP address you collected into the first field, and accept the default mount point in the second. Once that's done, we'll make the connection to our device. Plug your iPhone or iPod touch into your computer with its USB cord. (You'll only need to do this once, to initiate your SSH access.) From a terminal, or from the Alt+F2 prompt, enter one of two commands:
iphone-mount for iPhones, or, for iPod touches: ipod-touch-mount Nothing will happen for a good 30-45 seconds or a little longer. When it's done connecting, it will prompt you for the password for "root@". Almost all firmwares use "alpine" as their password, but "dottie" should work in the others. You've now mounted your iPod touch or iPhone like any other filesystem, although you won't get very far digging through its files. Use iphone-umount or ipod-touch-umount to unmount it. Now your root password can be guessed by a quick Google of "Jailbreaking," but we'll tighten that soon. For now, let's connect and sync files from some Linux apps. Trade Music and Podcasts with Amarok
Setting up a connection between Amarok and your Apple wireless device is pretty straightforward. Make sure your device is unmounted, then head to Settings->Configure Amarok.
Click the "Media Devices" button in the left-hand pane, then click the "Add Device" button. Choose "Apple iPod Device" for the plugin, give your device a name in the next field, then provide the same mount point as you previously used. When you arrive back at the "Media Devices" window, hit the (admittedly tiny) "Configure" button to the right of the plugin you just created. Enter your mount and unmount commands (iphone-mount/iphone-unmount, for example) in the two fields, then hit "OK." Back at the main window, select the "Devices" tab, click "iPod" and choose your model (don't worry about iPod touch's "Read only" label), then hit "Connect," and you'll be asked for that "alpine" password—twice (which we'll be fixing soon!).
Now you can stream music from your device, along with sending songs and podcasts back and forth, but Amarok's just an example. Rhythmbox, Exaile, Songbird, and any other music player that can mount a standard iPod should be able to access your iPhone or iPod touch now, provided you've mounted it using the two magic commands. With SSH credentials, you can sneak inside your device to grab notes, store files or just see what a tiny OS X computer's guts look like.
There are, unfortunately, two niggling problems with Linux-to-iPhone/touch transfers. On my iPod touch, Amarok wiped out a lot of album art on its first connection, but every transfer since then has ferried album covers safely across the Wi-Fi waters.
The other small problem is that music transfers won't show up right away on your device—you can either put it to sleep with the top button and wake it up, or use the third-party Respring app to quickly refresh the "Springboard" main launcher page, which does the trick.
What about video and pictures?
That's where gtkpod comes in—sort of, anyways. Videos that you've converted to iPod/iPhone-friendly format using HandBrake or another tool can be moved to your device, but photos tend to be very hit-or-miss—as in, I got a picture up once, but not on a second go-round. As gtkpod's iPhone/iPod touch support improves, I'll update this post.Make syncing easier and safe
Now we'll stop your device from asking for passwords twice on connection, while making sure every tech-savvy prankster can't get into your iPhone. Changing the root password on the most recent firmware is the same as on the earliest iPhones. Luckily, Jason at Gizmodo has posted a short and sweet guide to changing your iPhone/iPod touch password. Hit that link and skip down to the "Copying files" section to see how it's done—but a stern warning: Do not use the "passwd" command, or you'll end up with an endlessly resetting device that has to be painfully restored. As for you, you're going to prove to your Apple device that you're trustworthy. Pulling from the fsckin w/linux blog's guide, here's the basic terminal steps, with the parts you'll substitute in bold. They look daunting, but they're easy to copy and paste:
Now log in again from SSH or your music app, and you should notice a pleasing lack of password prompt.
- ssh-keygen -t rsa
- ssh root@iphone.IP.address (Enter the password you changed above)
- mkdir ~/.ssh
- chmod go-w / ~
- cp /etc/ssh_config /etc/ssh_config.bak
- echo AuthorizedKeysFile .ssh/authorized_keys >> /etc/sshd_config
- exit
- (Back at computer prompt):
scp ~/.ssh/id_rsa.pub root@iiphone.IP.address:.ssh/authorized_keys
I just covered the basics of getting your iPhone/iPod touch talking wirelessly to your music, but there's far more that can and already has been done with a jailbroken Apple device and a wide-open Linux system. Got any tricks you've been dying to try out? Hacks of your own to show off? Calendar sync solutions, anybody? Let's hear about all of them in the comments.
Kevin Purdy, associate editor at Lifehacker, is already bossing his iPod touch around from another room. His weekly feature, Open Sourcery, appears weekly on Lifehacker AU.

Comments (AU Comments · US Comments)
Beau
Posted May 10, 2008 10:21 PM
Meh. Over the air syncing for OSX and I'll be happy :-)
David
Posted September 29, 2008 9:22 PM
Does this work with jailbroken iPhone 3G:s too? Firmware 2.1?
Jeff Rodgers
Posted October 1, 2008 1:43 AM
FileSync does this legally (no jailbreak needed). It's available now.
http://www.jeff-net.com/filesync.htm
or from the iTunes app store...
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291797160&mt=8
daybringer
Posted 2:28 AM 10/5/08
I always have thought the Mac drones would run overpriced Apple comptuers as well, I could be wrong.
daybringer
Kaiser-Machead
Posted 2:51 AM 10/5/08
@daybringer: I'm willing to bet that the majority of iPhone users are Windows users.
Kaiser-Machead
K5Doom
Posted 3:23 AM 10/5/08
They just use what's being sold at Bestbuy.
K5Doom
kuroshi
Posted 4:03 AM 10/5/08
Well, aside from these poor fools who refuse to try out an ipod touch and immediately condemn it to either "mac drones" or "uneducated m$ users", I do have an ipod touch, and I have already synced it with my xubuntu install (that I need to update). However, I seem to have a problem retreiving my wiped album art. Did anybody figure that out? I'm gonna switch to songbird here soon, but I'd like to have my album art back...
kuroshi
imrcly
Posted 4:29 AM 10/5/08
@kuroshi: have you tried embedding the album art into the tags themselves?
imrcly
ross.m
Posted 5:24 AM 10/5/08
The iPod Touch really is a brilliant device (once jailbroken). It doesn't matter if you're a Windows, OS X or Linux user - the thing is fantastic. I hope this guide encourages Linux users who won't give the Touch a second look to reconsider.
ross.m
Evangelion
Posted 5:15 AM 10/5/08
@Kaiser-Machead: I agree.
Evangelion
kuroshi
Posted 6:33 AM 10/5/08
@imrcly: no, I haven't. I just tried the thing on This ubuntu page, to no avail. I'll definitely try that.
kuroshi
razordu30
Posted 9:56 AM 10/5/08
Can someone please work on syncing the iPhone with MS Exchange? Like, a way that doesn't involve some wacky dance with Yahoo servers?
razordu30
imrcly
Posted 10:18 AM 10/5/08
@razordu30: Apple is working on it in the 2.0 firmware we are all dieing to get
imrcly
Thorb
Posted 7:22 AM 11/5/08
I own an iPod touch because I am on verizon and once the touch is jailbroken, it is completely open ended. No other device can be customized like the touch or iPhone. Plus I'm submitting this from work on my touch right now :)
Thorb
bigdave914
Posted 2:06 PM 11/5/08
Can we not promote the jailbreaking method mentioned? Its been proven to NOT be the best method and there are many other proven better methods to jailbreak an iPhone.
bigdave914
neergrm
Posted 4:24 PM 11/5/08
I could do with wifi itransfers to my Nokia N95 :-)
neergrm
codykniffen
Posted 12:05 AM 13/5/08
Not only is this tutorial and concept amazing, but so is your choice of music. The Black Keys are spectacular.
Bravo, my good man!
codykniffen
mercerm
Posted 11:28 PM 12/5/08
Will it ever be possible to access your entire itunes library from your iphone/itouch? I would love to access my entire library with coverflow and hook it up to my stereo as a mini jukebox.
mercerm
mercerm
Posted 11:17 PM 12/5/08
I am still waiting for the day I can access multiple itunes libraries from an iphone/itouch. I would love to be able to access my entire itunes library wirelessly in my house with all it's coverflow goodness. I could then hook it up to my stereo and use it as a mini jukebox.
mercerm
ShreyashiDawk
Posted 6:46 AM 11/5/08
@kuroshi I ran into similar problem. As result of that, I tried several things, and this have worked for me: 1) Edit files and embed the album art into the audio file itself... I have only mp3's because I suck... I use Easy Tag (I believe this one is in Universe) to do that. 2) Amarok sucks... It's ugly and hard to use... I didn't enjoy Rhythmbox too much either. So I use two applications: Audacious for listening to music on my xubuntu, and gtkPod to sync music. 3) Unfortunately, libgpod and gtkpod had trouble working with album arts on iPod Touch / iPhone when I started (this was about 3 months back, so they may very well have fixed this now), so I had to custom compile the SVN build... not much of a problem, read the README files like you're suppose to and its smooth sailing. Hope this helps (first time commenting on LH!).
ShreyashiDawk