Raspberri Pi Kodi remote install

Using ssh, VNC, and OpenVPN to install Kodi on my dad’s Raspberry Pi from 245 miles away.

This is not a how-to install Kodi, this is just me helping my dad and having some fun in the process playing with technology and leaving myself a reminder of how I did it.

Why?

My dad wanted a media player to play his recorded shows that were saved on his NAS, but he wanted to play them on his den tv. That’s easy enough to setup if you just live across town from each other, but we are a 5 hour drive apart. So I decided to take advantage of our site to site VPN. I setup a OpenVPN in our routers a few years back so I could have an off site backup of our kids photos without using the “cloud”.

Problem

I started this by trying the VNC server included with Raspbian, I was dissapointed to discover that when Kodi launched all I got was a black screen. Turns out Kodi doesn’t uses X11 at all so the video was not “redirected” across the VNC connection.

The solution

Using a different VNC server called dispmanx_vnc and NOT running the GUI at all.

I found inspiration on the VNC server setup from this OSMC Support Article.

Steps I took on Raspbian
# ssh into the RPi

# disable the GUI
sudo rasbpi-config

# install the compiler to build the code into an executable
sudo apt-get install build-essential libvncserver-dev libconfig++-dev unzip

# download and unpack the VNC source code
wget https://github.com/patrikolausson/dispmanx_vnc/archive/master.zip

# unzip the compressed file
unzip master.zip

# change to the source code folder
cd dispmanx_vnc-master/

# compile the source into a binary by running make
make

# DONE!

While I didn’t install a LAMP stack nor did I completely follow his steps, I did find great information from Leow Kah Man’s blog.

You can read how to:

  • Disable booting to desktop
  • Installing Kodi
  • Run Kodi on startup
# Run Kodi on startup
sudo crontab -e
@reboot kodi --standalone
Secret revealed!

Now while it was not necessary, I was actually using a Magewell HDMI to USB capture device and Team Viewer to view the HDMI output of the Raspberry Pi so I could confirm what was being sent from the RPi to the TV was the same I was seeing in the VNC client.


Michael Cone
Michael Cone
Lead Software Engineer

My continuing education interests include Cloud Computing, Piloting and programming best practices.

Related