Posted by: David | May 8, 2011

Accessing itunes over the internet using SSH on Windows

I recently looked in to setting this up so that I could stream my Itunes content from my home PC to my work laptop. I dont really want clog up my work laptop with MP3’s and my current music collection is fairly large so having it on my work laptop has some serious space implications.

There seem to be plenty of articles out on the web for streaming itunes across the web if you have a Mac but not so much for windows. There are two ways I am going to explain how to do this with and without the use of an SSH tunnel. All the software required to do this is available free of charge for personal use.

Required Software

Java – You will need this to run the Rendezvous Proxy software, if you don’t already have it installed you can get it here.

Rendezvous Proxy – This software will allow you to see your itunes library from your home machine over the internet by proxying mdns requests. Credit has to be given to the developer of this application as it is fantastic. You will need to download the Java version to use this on windows.

Optional Software (For SSH Tunneling)

WinSSHD – This software is free for non commercial use, and it is a Windows SSH server this will need to be installed on your home machine (more later)

Tunnelier – This is the client that accompanys the WinSSHD software and would need to be installed on the machine you are using to access your itunes library. You dont have to use this SSH client you can use any SSH client you with (e.g. Putty) but you will have to work out how to set up SSH tunnels yourself

What is SSH and why use it

When setting this up for myself I found that if you used password protection for your itunes library you couldn’t connect to it with the rendezvous proxy, so I had to turn off the password protection. However if you do this without the ssh tunnelling you are potentially letting anyone access your itunes library :S. If you use SSH tunneling you are not broadcasting your itunes library to all and sundary and you are also adding a layer of authentication and therefore security before you can access the data.

So what is SSH, well you could do some reading up on wikipedia for some more detailed information, but in short it provides secure access to the command shell. Orginally a unix / linux thing but when something this good you can bet it is going to get ported to other platforms. Along side straight remote command prompt access SSH also allows for the tunnelling of other TCP protocols through its connection, in essence it is a bit like how you can get broadband (ADSL) and telephone over the same line in to your house. With SSH aswell as remote access to your command prompt you can also have RDP (Remote Desktop) and file transfer to name a few, but the possibilities are endless, generally if is uses a TCP protocol you can transmit is across SSH a bit like VPN.

Getting SSH Working in Windows

Now if you do a quick search on the Web about running a SSH server on Windows you will find numerous articles showing you how to port the Linux SSH server software to windows, which will vary from installing some software call cygwin through to compiling source code. All in all these methods are a bit of a pain and also dont really provide the outcome you might be looking for in a Windows SSH server. Generally this is because they work by emulating a linux environment in Windows and then running SSH from there. If you ever use a raw ssh session to this you cant run basic windows commands from the remote shell because it is an emulation of linux.

WinSSHD however provides native support for SSH, so when you get access it is actually a remote command prompt as opposed to an emulated linux shell. So to get SSH working simply download the WinSSHD software and follow the installation. You will need to set up some accounts but you can just use your existing windows login details.

Once installed you will need to set up public access to your computer via the internet to SSH, to do this you will need to configure your router firewall to forward port 22 to the ip address of your home machine with itunes and the newly installed.

I suggest at this point you install the tunnelier software on your remote machine and check you can connect.

Configuring the SSH tunnel

If you have decided to not use SSH then you can skip this step

Once you have SSH working next you need to set up a SSH tunnel, to do this with the Tunnelier applation go to the C2S Forwarding tab and click the add button and enter the following:

Status: Enabled
Listen Interface: 127.0.0.1
List. Port: 3689
Destination Host: localhost
Dest. Port: 3689

Save the chanes to your Tunnelier profile and Reconnect.

Configuring Rendezvous Proxy

If you are not using SSH you will need to add a rule on your home router to fordward port 3689 on to the ip address of the computer running Itunes (this is instead of port 22 for SSH)

Now you either have port 3689 open on your home router or the SSH tunnel working you will need to set up rendezvous proxy to broadcast the DAAP services (Itunes server) on to your local network where your work (remote) machine is so that the Itunes software can see it.

When you want to use Itunes on your remote connection you will need to have both the Tunnelier program open and the Rendezvour Proxy software running, once you have the Proxy software running, click the add host button and enter the following:

For SSH tunnelled connection

IP Address: localhost
Port: 3689
Host Label: homecomputer
Service Text: itunes from home
Service Type: _daap._tcp. (itunes host)

For Non SSH Connections

IP Address: IP address of your home internect connection or hostname
Port: 3689
Host Label: homecomputer
Service Text: itunes from home
Service Type: _daap._tcp. (itunes host)

*Note – If you are not sure what your Public IP address is for your home computer, try going whatsmyip.org from your home computer to find this out. You may also want to consider using a service like dyndns if you have a dynamic ip address and you find it keeps changing.

Accessing your Music

Once you have the software setup above you should be able to just open itunes and your home library should appear in the shared setion.

Troubleshooting

If you are not seeing your library on your remote computer I would suggest checking your Windows firewall or any Anti-Virus software to make sure it is not being blocked by these applications.

Advertisements

Responses

  1. Hi,

    I’ve done everything exactly like you said, and I’m able to connect SSH. When I open iTunes the library “homecomputer” shows up on the left pane, but when I click on it, it tries loading then it stops and I get this error from Tunnelier:

    “Server rejected our attempt to open a client-side client-2-server connection – reason: SSH_OPEN_CONNECT_FAILED, description: Unable to connect to target host.”

    Please help, as I do not know what the problem is. I am sure everything is configured correctly. It even has this message in the log directly before the error message:

    “Accepted client-side client-2-server connection from 127.0.0.1:58229 to localhost:3689”

    That port number 58229 is not a number that I have entered in anywhere, and each time I have tried this and received an error, that port number has been different.

    Again, please help if you could.

    -Patrick

    • Hi Patrick,

      Could you confirm the itunes sharing works when you are at home without the SSH tunnell or proxy software.

      The error sounds like the problem is on your computer with your itunes library installed, it could be a firewall issue can you make sure WinSSHD and Itunes are excluded from the windows firewall and AntiVirus firewall (if present)

      Thanks

      David

  2. Another way of doing this is to use iHomeServer for iTunes. I came across it recently and it’s solved quite a few problems for me including keeping iTunes running in the background, but also the latest update includes a web interface for iTunes so I can access my entire iTunes library from work. It supports both music and video (it actually can transcode videos if my bandwidth is too low).

    http://www.bizmodeller.com/iHomeServer/iHomeServer-Access-iTunes-From-The-Internet.aspx


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: