Remote iTunes Sharing

I keep most of my media - music and photos - on a 250gb external WDC Passport drive. I usually bring it with me when I come in to the office, but I forgot it today. Whoops. So I set about figuring out how to access it remotely.

The Ingredients

iTunes needs two things to access shared music.

  1. A share present on the local network. Which is to say, on one of the networks the machine is directly connnected to.
  2. An entry for that share in Bonjour.

If you lack either of those, it doesn’t work. Fortunately, it’s not hard to trick iTunes into letting you access any share you want. It’s unfortunate, really. If you use Back To My Mac, any Bonjour services - iTunes included - get announced on your local end, but iTunes ignores it because it’s not on the local network.

The Commands

$ ssh -fNL *:36890:127.0.0.1:3689 USER@REMOTE-HOST
$ dns-sd -R "Remote iTunes" _daap._tcp local 36890 &

Breaking it Down

What we’re doing here is pretty straightforward. We use SSH to create a tunnel from the local host to the iTunes share on the remote side. That gives us #1 from our list above. Then we register it with Bonjour, making it visible to iTunes. It works with any host reachable via SSH.

Simple, straightforward, and works far better than the other approaches I’ve tried.

Future Improvements

If you’re a BTMM user, this is somewhat sub-optimal. You already have a secure tunnel to your remote system, and you’re now layering another on top of it. If there were a simple TCP proxy, you could tunnel the connection with much less overhead. I haven’t found a simple proxy which works yet, though, so this remains a future goal.

One Response to “Remote iTunes Sharing”

  1. Remotely access iTunes via ssh « Just Your Average Geek Says:

    [...] on the second computer enter 2 commands in terminal, which i learned from this site [...]

Leave a Reply