Using an iPod Touch on Linux

I recently exchanged my old iPod Nano (5th generation) for an equally old iPod Touch (4th Gen), and thought I'd write a blog on how to connect it to Linux.

Here's the short version: you can't.


At least you can connect to it (via the usual ifuse /imobiledevice libraries built in to Linux distros), but that doesn't help with copying / syncing music to the native music app. The version of the database used in this iPod is not writable by Linux apps (the libgpod library specifically), so you can't sync music.

So I explored various options:

iTunes under Wine / Playonlinux

This worked, but can't connect to the iPod over USB. I thought about trying iTunes Match, but the latest version of iTunes that would connect to the iTunes store under wine was 10.3, and the earliest version that included iTunes Match was 10.6.

iTunes on Windows via VirtualBox

This worked, but was not very reliable. This seems to an iTunes' problem with my music library, so maybe you could manage this way if you really want. I did manage to connect the iPod via USB, and even to get wifi sync to work (setting the virtual network adapter to 'bridge' mode), but iTunes would usually only copy the first track in every album and give up. Besides, it's not much fun working in a Virtual Machine, and I don't have a Windows licence any more.

Using another app

I did think about this, but didn't end up trying it. I'm sure there are legitimate third party apps that will allow me to copy music directly, either over a cable or via the cloud. Google Music certainly works, and Spotify does as well. I didn't try

PwnTunes


Finally I hit on the only decent solution - jailbreak the iPod. iOS 6.1.6 is still crackable, though you may need to borrow a Windows machine with iTunes on it. Download p0sixspwn and run it (as administrator), plug in your iPod and let it reboot until it is finished.

Start the Cydia app store, and search for 'PwnTunes'. Install this and when you plug the iPod into Linux again you will have some new directories available. If you drag and drop your music files into the 'My Music' folder on the iPod, the pwntunes app will automatically import them (in-place) to your iTunes library on the iPod when you next start the 'Music' app. After that you can listen to them as normal. It's not quite as nice as syncing with Banshee, but it works reliably, and is much cleaner than mucking about with virtual boxes.

Album Art

As we're no longer involving iTunes in updating the database, the metadata from iTunes won't help. Your files will need to include album art if you want to see it on the iPod. Alternatively, PwnTunes will use a cover.jpg file in the album's folder to set as the cover art for all the songs.
I used the beets command line application to update the metadata on all my mp3s, and download the cover art. It also had a go at de-duplicating my albums, and pointing out missing tracks.

Wireless Sync

This worked so well that I paid for PwnTunes (it does work fine in trial mode), and started to make the process easier. First I installed openssh on the iPod (via Cydia again), and jumped through all the hoops necessary to get access without a password. Then I installed 'sshfs', and mounted the iPod as a folder. Finally I used rsync to keep the iPod's 'My Music' folder in sync with my own 'Music' folder. This makes sure that any new albums I rip or download get copied across to the iPod, along with their cover art. Pwntunes does the rest.
Though pwntunes can automatically detect when you update via USB, and automatically sync the My Music folder with the iPod's database, it doesn't do this when you copy files wirelessly. You will need to go into 'Settings->PwnTunes', and set 'Needs Sync' to on. Next time you open the Music app, PwnTunes will update the library.

Conclusion

It feels as if I've jumped through a lot of hoops to get this far, but the end result is a lot more convenient. I can sync my iPod wirelessly with my music collection without using any music management software at all. 

Comments