How not to Make a Media Server…

This is a step-by-step guide to how I set up my media server.  There are more elegant ways to do this, and to be honest, if I had a choice I would do it differently.  My main motivation for doing it this way was that it cost me absolutely nothing.  I already had a spare computer, 2 Apple TVs and all my movies and TV shows on an external HD.

First of all, a brief overview of my setup:

The heart of this setup is an old laptop running Plex Server.  A utility called PlexConnect redirects the trailers section of the Apple TV to Plex.  I have all my movies and TV shows on a Mac formatted 2TB external HD, which I access from the laptop, which is running Linux Mint 13.  I’m using Linux Mint 13 simply because I happened to have an install CD for it, and it actually runs fairly well on the old laptop.

There was a fair bit that needed to be done to get this working:

  1. Set up Linux
  2. Make the laptop able to read and write my external Mac HD
  3. Install Plex Server, and configure the media Libraries
  4. Install PlexConnect
  5. Tweak the Apple TVs to look at the laptop instead of Apple’s servers for Trailers.

Step 1: Setting up Linux

Initially I was going to use a lightweight Linux distro called ArchLinux, but in the end I decided that as I already had Linux Mint 13 on the laptop and that it ran quite well, that I would save myself some time by not installing a new version.  With that task gone, all that needed to be done was to give the laptop a static IP address.  As my home network is a simple setup I just set a manual IP on the laptop, but to be more robust it would be better to assign a fixed address in DHCP on my ADSL router.

Step 2: Making the laptop access the Mac HD

The first step was to install the necessary software to allow Linux to read HFS+ volumes.  There are two ways of doing this, either with apt-get from the command line, or using Synaptic Package Manager.  I chose to use Synaptic Package Manager, because it helpfully installs any necessary dependencies.

If you want to use the command line, all you need to type is:
sudo apt-get install hfsprogs

One thing I discovered early on is that if the Mac volume has journaling enabled, then it will be mounted read-only in Linux.  To avoid this it is necessary to disable journaling from within Disk Utility on the Mac.  This is a simple procedure, just select the drive in Disk Utility then select “Disable Journaling” from the File menu (or press cmd + J).

After installing hfsprogs, the drive mounted in linux as soon as it was connected.  I happily started to setup folders for Plex Server, only to discover that the drive was read-only.  It turns out that I had ownership enabled on the drive under MacOS, so Linux was unable to access the data.  One quick
sudo chmod -R o+r /media/2TBDrive
later I had read/write access to my Mac drive in Linux.

Step 3: Installing Plex Server

Rather than detailing the exact install process of Plex Server, it’s probably best for me to simply link to the Installation Guide.  All the necessary steps have been laid out there, and are easy to follow.  Depending on the exact Linux Distribution you use, the install steps will be slightly different.  Linux Mint is based on Ubuntu, so I just followed the Ubuntu directions with no problems.

Step 4: Installing PlexConnect

This is where things started to get a bit hazy.  The installation of PlexConnect itself is pretty straight forward.  PlexConnect is downloaded and installed using git, a version control system.  I did need to install git first, but using Synaptic Package Manager it was a simple task.  Python version 2.7.x is also needed for PlexConnect to run, and this was already installed on the laptop.

Once git is installed, PlexConnect is installed by typing:
git clone https://github.com/iBaa/PlexConnect.git
in a terminal window.

Once PlexConnect is installed, it is necessary to generate security certificates.  I used the Mac Certificate Install Guide, with no issues.

PlexConnect can be started from a terminal window (which requires the terminal window to stay open) or as a daemon.  I wanted to have it start as a daemon automatically on startup, so I waded into the unfamiliar territory of init.d under Linux.  After much googling, I found that the best way to start it was simply to edit /etc/rc.local and add the following line:
/path/to/PlexConnect/PlexConnect_daemon.bash start

Having done that, I rebooted, and typed:
cd PlexConnect
sudo ./PlexConnect_daemon.bash status

in a terminal window to confirm that PlexConnect was running.

Step 5: Pointing the Apple TV to Plex

The last step is to change a couple of settings on the Apple TV to get it to point to the Plex server.  First of all it is necessary to change the DNS server address to the static IP given to the server in the first step.  This is done by going to Settings > General > Network > Wi-Fi > <Network Name> > Configure DNS and changing it to Manual.  Then change DNS to the address of the machine running Plex.

The next step to to add a profile for the security certificates created in step 4.  Under Settings > General scroll down to Send Data to Apple and press Play on the remote.  On the next screen select Add Profile, select OK, type the following into the URL field:
http://trailers.apple.com/trailers.cer
then select Submit

That’s it!  If everything is working, going to Trailers on the Apple TV menu will now take you to your Plex Server, and you can happily watch Movies and TV shows in any media format that Plex can handle.

I said at the start that this is not my ideal setup, but it works, and it was free, so I can’t really complain.  In the distant future when I have spare funds, and the motivation to do something about it I’d ideally like to have a NAS for storing my media files.  At the moment I’m happy enough with Plex and the Apple TV that I’d consider still using them.

Right now, the only feature that I wish I had was something like the XBMC Remote app for playing stuff.  The Apple Remote app will control the Apple TV, but it’s a bit clunkier than just selecting what I want to watch on the screen of the phone or iPad.  Still, beggars can’t be choosers, and what I have is a heap better than what I didn’t have yesterday.