How to: Plex on Apple TV 3 using Ubuntu Headless and PlexConnect

[vc_tta_tabs active_section=”1″ pagination_style=”outline-square”][vc_tta_section title=”Summary” tab_id=”1483657727692-588765df-8139e50c-cffea4b0-d7dc”][vc_custom_heading text=”Problem / Outcome Summary”]
  • This article will enable you to watch media served from any Plex server in your house on from Plex on your Apple TV 3
  • If you don’t have a Plex Media Server, have a look at our Plex Media Server on Ubuntu Linux Headless guide here.
  • Please see the ‘Summary Overview’ tab below for a high level view of the objectives this ‘how to’ will achieve.

Why might I want to do this?

  • Because you already have an Apple TV and it doesn’t work with Plex out of the box
  • Because Apple TV is a premium product, with full working remote and low power consumption
  • Because it saves you having to get another device, when you already have a capable Apple TV.
  • Because you don’t own a Mac, and PlexConnect works great running entirely on Ubuntu Linux Headless or any other Linux computer.
[/vc_tta_section][vc_tta_section title=”Foreword” tab_id=”1483656936153-fec58c10-e606e50c-cffea4b0-d7dc”][vc_custom_heading text=”Foreword”]

To be clear, what does PlexConnect do?

Simply put, PlexConnect provides a ‘web system’, that runs on your Apple TV and ‘streams’ the media from your Plex device in a nice easy to use package.  This is not available by default with the Standard Apple TV 3, which is why plexconnect was created.

[/vc_tta_section][vc_tta_section title=”Pre-Requisites” tab_id=”1483656936239-1facad3b-9216e50c-cffea4b0-d7dc”][vc_custom_heading text=”Pre-Requisites”]

Software Dependencies

Hardware Dependencies

  • An Apple TV 2 or 3
  • An internet Modem / Router capable of performing NAT

Tools Required

  • SSH Access
  • A recent web browser

Other Dependencies

  • A working internet connection
[/vc_tta_section][vc_tta_section title=”Summary Steps” tab_id=”1483657008528-9fc62da7-5742e50c-cffea4b0-d7dc”][vc_custom_heading text=”High Level Summary Steps”]

The below lists the high level summary of steps we’re about to take during this howto.

  • Connect to Ubuntu Linux and download required software
  • Configure PlexConnect
  • Test your software
  • Start PlexConnect automatically at boot
  • Configure your Apple TV
[/vc_tta_section][vc_tta_section title=”Implementation” tab_id=”1483657023013-0e8f9bfb-cd0fe50c-cffea4b0-d7dc”][vc_custom_heading text=”Implementation”]

Connect to Ubuntu Linux and Download Required Software

  1. Log in to your Ubuntu box with SSH
  2. Ensure you are in your home directory e.g. /home/yourname
  3. sudo apt-get update (to update packages to latest versions
  4. sudo apt-get install unzip
  5. sudo apt-get install python-imaging (for fanart backgrounds that look nice)
  6. wget https://github.com/iBaa/PlexConnect/archive/master.zip (latest version of PlexConnect)

Configure PlexConnect

  1. While still in the root of your home directory,
  2. unzip master.zip
  3. sudo mv PlexConnect-master /usr/local/lib

Generate the required certificates.

Please note: Yes it’s perfectly good to do this entirely on Ubuntu rather than on a Mac as some people have tried to suggest, which is great if you don’t own a mac.

**Update 11Dec2016:  There is one comment below from Aylin about receiving an error when making a certificate request.  It was solved by changing the path of the key files.  Be mindful of which directory you are in and where your files are.  Happy to answer questions if you get stuck.**

  1. Again, while still in your home directory, perform the below
  2. openssl req -new -nodes -newkey rsa:2048 -out trailers.pem -keyout trailers.key -x509 -days 7300 -subj “/C=US/CN=trailers.apple.com”
  3. openssl x509 -in trailers.pem -outform der -out trailers.cer && cat trailers.key >> trailers.pem
  4. cp *.cer *.key *.pem /usr/local/lib/PlexConnect-master/assets/certificates/
  5. cd /usr/local/lib/PlexConnect-master
  6. sudo vi Settings.py Change, “ip_dnsmaster = 8.8.8.8″ and replace 8.8.8.8 with your internal routers IP address or similar if you have geo-unblocking or similar”

* Note the ‘prevent_atv_update = True’ line, which you can change should you wish to update your firmware on your ATV

Test your software

cd /usr/local/lib/PlexConnect-master

sudo ./PlexConnect.py

You’ll get similar to the following:
12:11:11 PlexConnect: ***
12:11:11 PlexConnect: PlexConnect
12:11:11 PlexConnect: Press CTRL-C to shut down.
12:11:11 PlexConnect: ***
12:11:11 Settings: add setting enable_plexgdm=True
12:11:11 Settings: add setting ip_pms=192.168.178.10
12:11:11 Settings: add setting port_pms=32400
12:11:11 Settings: add setting enable_dnsserver=True
12:11:11 Settings: add setting port_dnsserver=53
12:11:11 Settings: add setting ip_dnsmaster=192.168.1.1
12:11:11 Settings: add setting prevent_atv_update=True
12:11:11 Settings: add setting enable_plexconnect_autodetect=True
12:11:11 Settings: add setting ip_plexconnect=0.0.0.0
12:11:11 Settings: add setting hosttointercept=trailers.apple.com
12:11:11 Settings: add setting port_webserver=80
12:11:11 Settings: add setting enable_webserver_ssl=True
12:11:11 Settings: add setting port_ssl=443
12:11:11 Settings: add setting certfile=./assets/certificates/trailers.pem
12:11:11 Settings: add setting allow_gzip_atv=False
12:11:11 Settings: add setting allow_gzip_pmslocal=False
12:11:11 Settings: add setting allow_gzip_pmsremote=True
12:11:11 Settings: add setting loglevel=Normal
12:11:11 Settings: add setting logpath=.
12:11:11 PlexConnect: started: 12:11:11
12:11:11 PlexConnect: Version: 0.5-dev-020615
12:11:11 PlexConnect: Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2]
12:11:11 PlexConnect: Host OS: linux2
12:11:11 PlexConnect: PILBackgrounds: Is PIL installed? True
12:11:11 PlexConnect: IP_self: 192.168.1.20
12:11:11 DNSServer: started: 12:11:11
12:11:11 DNSServer: ***
12:11:11 DNSServer: DNSServer: Serving DNS on 192.168.43.20 port 53.
12:11:11 DNSServer: intercept: [‘trailers.apple.com’] => 192.168.43.20
12:11:11 DNSServer: restrain: [‘mesu.apple.com’, ‘appldnld.apple.com’, ‘appldnld.apple.com.edgesuite.net’] => 127.0.0.1
12:11:11 DNSServer: forward other to higher level DNS: 192.168.1.1
12:11:11 DNSServer: ***
12:11:11 WebServer: started: 12:11:11
12:11:11 WebServer: ***
12:11:11 WebServer: WebServer: Serving HTTP on 192.168.43.20 port 80.
12:11:11 WebServer: ***
12:11:11 WebServer: started: 12:11:11
12:11:11 WebServer: ***
12:11:11 WebServer: WebServer: Serving HTTPS on 192.168.43.20 port 443.
12:11:11 WebServer: ***

Press CTRL-C to shutdown afterwards if you wish to make it start automatically at boot.

[spacer color=”429d4a” icon=”fa-angle-double-down” style=”3″]

Start PlexConnect automatically at boot

  1. sudo ln -s /usr/local/lib/PlexConnect-master/PlexConnect_daemon.bash /etc/init.d/PlexConnect_daemon.bash
  2. sudo update-rc.d PlexConnect_daemon.bash defaults

PlexConnect should start automatically upon a reboot of your Ubuntu Linux system.

Configure your Apple TV

  1. Go to the settings menu on the Apple TV
  2. Select the General option
  3. Then scroll down and ‘highlight’ the ‘send data to apple’ and change to ‘No’
  4. While this remains highlighted, press the ‘Play’ button on the Apple Remote
  5. Enter http://your_plexconnect_ip_address/trailers.cer (so make it like 192.168.1.20/trailers.cer)

You also have to change the DNS on the Apple TV to point to your PlexConnect IP address.  You do this through Settings, General Network, WiFi, or Settings General, Network, Ethernet.

Go through the network settings as if you were setting them up from scratch and when it get’s to the configuration page, change the Configure DNS setting to Manual and enter in your IP address there.  At this point you should be all done and all should be working.  You may have to restart your Apple TV.

You access Plex by clicking on the trailers icon on the apple TV.

That’s it!

[/vc_tta_section][vc_tta_section title=”Final Word” tab_id=”1483657035357-36e2d8d1-b325e50c-cffea4b0-d7dc”][vc_custom_heading text=”Final Word”]

Note that running Plex on Apple TV actually forces the Plex Server to do CPU intensive Transcoding.  This is because the Apple TV has been designed by Apple to only play approved media formats which usually don’t cover those included in your Plex Server.  Plex therefore has to convert media from whatever format you have it in, into the Apple TV supported format.

As a guide, you need about 2000 on CPU Mark per 1080p transcode.  Check your CPU and how it stacks up here.

See our latest guide on how to set up Plex Media Server file permissions here.

Marshalleq

[/vc_tta_section][/vc_tta_tabs]

Popular Articles

Raspberry Pi 3

Raspberry Pi Disk Images – Definitive List

2
This page attempts to list all the Raspberry Pi disk images known to currently exist from around the web, providing direct links to download...
Port Scan Test

How to check port forwarding is working

1
Problem-Outcome Summary This guide applies to:Any router or firewall you may have such as:DLink, Asus, TP Link, Linksys, Synology, Apple, Belkin, Buffalo, Cisco,...
Raspberry Pi Audio Hardware

Raspberry Pi audio HAT’s (Hardware Attached on Top) – Definitive List

0
Summary Back in July 2014, Raspberry Pi announced the then new, Raspberry Pi 2 followed soon after by the announcement of HaTs (Hardware Attached on...
How to set Plex permissions on Linux / NAS devices

How to set Plex permissions on linux or NAS devices

9
Problem / Outcome SummaryThis how to guide will show you how to properly set up Linux file permissions for Plex Media Server Please...
How To Install Logitech Media Server on Ubuntu Linux

How to install Logitech Media Server on Ubuntu Linux

0
Problem / Outcome SummaryThis how to guide will enable you to install Logitech Media Server on Ubuntu Linux For how to install Logitech...
spot_img

Related Stories

12 COMMENTS

  1. Step 2 – Generate the required certificates:

    $ openssl req -new -nodes -newkey rsa:2048 -out trailers.pem -keyout trailers.key -x509 -days 7300 -subj “/C=US/CN=trailers.apple.com”

    Generating a 2048 bit RSA private key

    ………………………………+++

    ………………………….+++

    writing new private key to ‘trailers.key’

    —–

    Subject does not start with ‘/’.

    problems making Certificate Request

  2. Hi, I’m not sure if you’re saying it works for you without a prefixing / or if you’re saying you have an error you can’t fix?

  3. Hey Jonathan, so you’re getting the same error? Can you please post what you’re getting and I’ll walk you through it.

    Thanks.

  4. Tech-KnowHow, Thanks for being willing to help I installed Ubunutu Server for the first time last week and have been slowly implementing needed services. the error is:

    ***fabionserver:~$ openssl req -new -nodes -newkey rsa:2048 -out trailers.pem -keyout trailers.key -x509 -days 7300 -subj “/C=US/CN=trailers.apple.com”
    Generating a 2048 bit RSA private key
    ………………………………………………..+++
    ………………………………………………………+++
    writing new private key to ‘trailers.key’
    —–
    Subject does not start with ‘/’.
    problems making Certificate Request

    I don’t have the first clue what this means or how to fix it. I am trying to use the forums to determine what each command does, but I am quite stuck. Again thanks for any help!

  5. Hi Sorry, I’ve been away at a funeral etc.

    I believe it is to do with where the key files are stored, either in your local directory (otherwise known as folder – i.e. where you currently are on now the command line) or if they are in a different directory.

    So for example the line that reads “$ openssl req -new -nodes -newkey rsa:2048 -out trailers.pem -keyout trailers.key -x509 -days 7300 -subj “/C=US/CN=trailers.apple.com”

    Probably should read:

    $ openssl req -new -nodes -newkey rsa:2048 -out /home/fabion/trailers.pem -keyout /home/fabion/trailers.key -x509 -days 7300 -subj “/C=US/CN=trailers.apple.com”
    Though the comment above is not exactly specific either. Either way if this doesn’t work, let me know and I’ll bring up my test environment so I can finalise it for you.

    You would replace /home/fabion with the full path of your current location I assume.

    I might just do that anyway, but let me know. Will try do something tonight and post back.

  6. Hey, Thanks for your help and I’m sorry for your loss. I searched the location of the file and is appears to be located at ./trailers.key

    After modifying the command this is the output. Thanks for your help.

    jon@faubionserver:~$ openssl req -new -nodes -newkey rsa:2048 -out ./trailers.pem -keyout ./trailers.key -x509 -days 7300 -subj “/C=US/CN=trailers.apple.com”
    Generating a 2048 bit RSA private key
    …………………………………………………………………………………………………………………………..+++
    ……………………………………+++
    writing new private key to ‘./trailers.key’
    —–
    Subject does not start with ‘/’.
    problems making Certificate Request

  7. Hey, so I’ve just installed it on a fresh system and updated the guide with some specifics including my forgetting to add sudo in a few places. I performed the commands as below in my home directory, which you can see worked well. This is ubuntu Yakkety Server LTS.

    $ openssl req -new -nodes -newkey rsa:2048 -out trailers.pem -keyout trailers.key -x509 -days 7300 -subj “/C=US/CN=trailers.apple.com”
    Generating a 2048 bit RSA private key
    ………………………….+++
    ………………………………………………………………………………+++
    writing new private key to ‘trailers.key’
    —–
    $ openssl x509 -in trailers.pem -outform der -out trailers.cer && cat trailers.key >> trailers.pem
    $ ls
    trailers.cer
    trailers.key
    trailers.pem
    $ cp *.cer *.key *.pem /usr/local/lib/PlexConnect-master/assets/certificates/
    $ cd /usr/local/lib/PlexConnect-master/
    $ sudo ./PlexConnect.py
    12:13:00 PlexConnect: ***
    12:13:00 PlexConnect: PlexConnect
    12:13:00 PlexConnect: Press CTRL-C to shut down.
    12:13:00 PlexConnect: ***
    12:13:00 Settings: add setting enable_plexgdm=True
    12:13:00 Settings: add setting ip_pms=192.168.178.10
    12:13:00 Settings: add setting port_pms=32400
    12:13:00 Settings: add setting enable_dnsserver=True
    12:13:00 Settings: add setting port_dnsserver=53
    12:13:00 Settings: add setting ip_dnsmaster=8.8.8.8
    12:13:00 Settings: add setting prevent_atv_update=True
    12:13:00 Settings: add setting enable_plexconnect_autodetect=True
    12:13:00 Settings: add setting ip_plexconnect=0.0.0.0
    12:13:00 Settings: add setting hosttointercept=trailers.apple.com
    12:13:00 Settings: add setting port_webserver=80
    12:13:00 Settings: add setting enable_webserver_ssl=True
    12:13:00 Settings: add setting port_ssl=443
    12:13:00 Settings: add setting certfile=./assets/certificates/trailers.pem
    12:13:00 Settings: add setting allow_gzip_atv=False
    12:13:00 Settings: add setting allow_gzip_pmslocal=False
    12:13:00 Settings: add setting allow_gzip_pmsremote=True
    12:13:00 Settings: add setting loglevel=Normal
    12:13:00 Settings: add setting logpath=.
    12:13:00 PlexConnect: started: 12:13:00
    12:13:00 PlexConnect: Version: 0.5-dev-110616
    12:13:00 PlexConnect: Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
    [GCC 5.4.0 20160609]
    12:13:00 PlexConnect: Host OS: linux2
    12:13:00 PlexConnect: PILBackgrounds: Is PIL installed? True
    12:13:00 PlexConnect: IP_self: 192.168.43.20
    12:13:00 DNSServer: started: 12:13:00
    12:13:00 DNSServer: ***
    12:13:00 DNSServer: DNSServer: Serving DNS on 192.168.43.20 port 53.
    12:13:00 DNSServer: intercept: [‘trailers.apple.com’] => 192.168.43.20
    12:13:00 DNSServer: restrain: [‘mesu.apple.com’, ‘appldnld.apple.com’, ‘appldnld.apple.com.edgesuite.net’] => 127.0.0.1
    12:13:00 DNSServer: forward other to higher level DNS: 8.8.8.8
    12:13:00 DNSServer: ***
    12:13:00 WebServer: started: 12:13:00
    12:13:00 WebServer: ***
    12:13:00 WebServer: WebServer: Serving HTTP on 192.168.43.20 port 80.
    12:13:00 WebServer: ***
    12:13:00 WebServer: started: 12:13:00
    12:13:00 WebServer: ***
    12:13:00 WebServer: WebServer: Serving HTTPS on 192.168.43.20 port 443.
    12:13:00 WebServer: ***

Stay on op - Ge the daily news in your inbox