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:
for iPhones, or, for iPod touches:
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
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 fscki
n 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:
- 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
- (Back at computer prompt):
scp ~/.ssh/id_rsa.pub [email protected]iphone.IP.address:.ssh/authorized_keys
Now log in again from SSH or your music app, and you should notice a pleasing lack of password prompt.
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.