Getting kodi to run nicely on Raspbian

This blog post is about getting Kodi up and running with Netflix on Raspbian. This is not a tutorial, more a collection of notes for myself in order to reproduce the setup.

Basic install

Get a recent version of Raspbian from the Raspberry Pi website. (Or my ftp mirror). Extract it to a fresh micro-SD card and get the system ready. Follow this guide, if you need help. Boot into the system and run a update and install some handy tools

Next, we are gonna harden the system. For that do the following

  • Set root password
  • Rename user pi to something else
  • Remove the NOPASSWD for user pi
  • Permit root-ssh login only via public key

Install Kodi

First add the following repository

Now install kodi

Autostart Kodi

Ok, kodi is installed, now we need to start kodi. For that we create a systemd service by putting the following to /etc/systemd/system/kodi.service

Install the Netflix Plugin

The Netflix Plugin is hosted on GitHub. Download the plugin and install the zip-file. Best option seems to be to put it on a USB-Stick and install it from there. This plugin needs parted or fdisk, you install them on your kodi and then let the plugin install the widevine library, necessary for the DRM. The DRM is by the way also the thing, that was in the way of getting Netflix work in the first place. And it's still a bit of a mess, since we are using here a extraction of the libwidevine from the chromecast.

Well, as long as it works, but it's not nice and probably creating causing one or two times headache until it finally works.

Allow Kodi to reboot and shutdown

This is now more a quick fix, based on the suggestion from here. The original clue was posted long time ago on the kodi forums, but those posts were only of limited help. So, create the following file

Finetuning

I encountered the problem, that if Kodi runs for too long (multiple days), the Netflix plugin stopped working. No errors given, it just won't play a movie again. A quick fix is to schedule a reboot every night using a cronjob

Further work

This is of course just the basic installation. You will need to configure Kodi to your needs (Skins, Addons, Timezone, connect your NAS, ...)

Also, I might create an ansible-playbook to setup this procedure. This looks like a fun project to do on a rainy Sunday.


For now, I'm off, watching some Netflix 🙂

Leave a Comment