Share a Remote Music Library with iTunes from Linux

Posted on Dec 8, 2010

I usually listen to Pandora at work. I'd rather listen to my personal library, but Pandora makes for a good second place. There's no question that it beats trying to store / sync untold gigabytes worth of audio on my work computer. Still, sometimes Pandora just doesn't cut it: especially when I want to hear a certain song. So, I decided to use lunch to figure out how to get my music collection into iTunes at work.

What you'll need

For this to work, a few things are needed: A PC at home that can be SSHed into and has access to the audio that should be streamed, Firefly Media Server, Cygwin or Putty, RendezvousProxy and iTunes 10.1, not 10.0. I already had Cygwin, Putty and iTunes on the work PC, so it turned out to be rather convenient.

Installing Firefly Media Server

Start by SSHing into the remote PC to install Firefly.

sudo apt-get install mt-daapd

Note that it is not actually being configured yet. Though configuration could take place from the console immediately after installation, by waiting till later we can use a rather nice looking web interface instead. Next, start Cygwin or Putty to create a tunnel to the remote PC. Firefly and iTunes use port 3689 to share audio, so that is the one that should be used for tunneling.

Setup a tunnel using Putty (Preferred)

Open Putty and enter the address for the remote computer. On the tree at left, click on “SSH” under “Connections”. Enable the option “Don't start a shell or command at all.” After that, click on the plus sign beside SSH to reveal more options. Choose “Tunnels”. For the source port type “3689”. For the destination, use “localhost:3689”. Proceed by clicking the open button at bottom. Finally, type in your login credentials. Though Putty stays open, it will never bring up a terminal. Minimize Putty.

Setup a tunnel using Cygwin (Alternate)

From Cygwin, enter the following code, replacing username@homecomputeraddress with the relevant information.

ssh username@homecomputeraddress -N -f -L 3689:localhost:3689

This command can be broken down into a few basic components: -N: This tells ssh that it should not execute a remote command after connecting. -f: This causes ssh to go into the background, allowing us to enter other commands on the shell. -L: The heart of our connection: it specifies that a local address and port should be mapped to a remote address and port. It breaks down as localaddress:localport:remoteaddress:remoteport. Since localaddress was not specified, it will default to “localhost”. In this case, all requests on localhost:3689 (local) will be passed through to our remote PC at localhost:3689 (remote). (Quick aside: If you were paying attention, you probably noticed that the remote address is localhost. That is not a typo. The first half of the mapping is viewed from the local perspective. The second half of the mapping is viewed from the remote perspective. From the perspective of the remote computer, it is localhost.)

Configure Firefly

Now that the tunnel is established, configure Firefly by navigating to http://127.0.0.1:3689. Use admin/mt-daapd for the username/password.

Configure RendezvousProxy

Finally, the last step: Use RendezvousProxy to announce the new service to the local PC. Just add a new host with the following info.

SettingValue
IP Address127.0.0.1
Port3689
Host LabelA human readable label. 1
Service Type_daap._tcp

Conclusion

After restarting iTunes, the remote share should appear. In my case, it appeared immediately appeared, and worked fine.

Footnotes


  1. Even though it is marked optional, the share won't show up in iTunes if nothing is entered here. ↩︎