Media server for Mac with wake on lan, streaming, automounting

Well, I finally have a decent system in place for storing and consuming media on my macs. My wife and I each have Mac laptops. We store all our Movies on a file server now running Ubuntu 10.10 configured with netatalk, advertising itself via avahi, and now the laptops automatically mount the shares when the server is turned on.

This last part was needed because I like to use iTunes to keep track of which TV episodes I've watched as well as use my iPhone to control volume and playback. She prefers to just use the Finder to navigate to the movie she wants to put on for the kids without opening iTunes.

It turns out the magic recipe is to use keys for authentication with ssh, then on the server add a line like this for each machine you want to automatically mount the network share:

/usr/bin/ssh user@machine.local osascript -e \'mount volume \"afp://username@hostname.local/ShareName\"\' \&\& open /Volumes/ShareName &

That is all on one line. As you are setting all this up, make sure you ssh into the laptop from an interactive root shell on the server to add the laptop to the list of known hosts for root. Also, run the osascript command on the laptop (unescape the quotes and ampersands) terminal to store the server credentials in the keychain for applescript.

Once I did all that, everything worked great. Now when I turn on my fileserver either via the button or wake on lan, after about 30 seconds, a finder window opens and shows my movies on the server.

The best part about this now is I can easily do everything necessary to watch something in bed on my 11" air without having to get up.

Comments

Popular posts from this blog

iChat IRC transport with OpenFire and Kraken

Save kerberos password in keychain for use with kinit on MacOS (was OS X) for use with network drives

Recording the iPhone screen and Mac screen at the same time in one video