Sickbeard & SABnzbd on VM

Now that I have virtualized my FreeNAS installation I no longer need to run “Jails” on FreeNAS and can use a normal Ubuntu installation to run my downloading services like Sickbeard and SABnzbd. In this blog I explain the basic installation running the two services on the same virtual machine running Ubuntu.

[Installing SABnzbd]

First step is to add the repo to Ubuntu. The repo below is for the “no beta” release of SABnzbd. If you do want the Beta, RC or Alfa release, change the ppa with ppa:jcfp/ppa.

sudo add-apt-repository ppa:jcfp/nobetas

We are going to install two addon’s that will speed up the processes on CPU-Limited devices such as us and use multiple cores for running Par2. The first one is; SAByenc that will help us increase the download speed. The second is Multicore Par2 that is utilizing multiple cores for running the Par process. We first have to add the repository that holds the addon’s

sudo add-apt-repository ppa:jcfp/sab-addons

Now we have to update the repositories perform an upgrade while we are add it;

sudo apt-get update && sudo apt-get dist-upgrade

The last step in the installation is the actual installation of the three components. It will install the missing dependancies (Python and Java etc) autimaticly and with me, it did require an 40,3 MB of extra disk space.

sudo apt-get install sabnzbdplus python-sabyenc par2-tbb

Now to see if the installation is running sucessfull, I will start it on the commandline so you can finish up the configuration in the GUI.

albert@media:~$ sabnzbdplus -s 10.0.0.50

If everything works you should see the “Wizard” at the IP you specified (behind -s) on port 8080. So in my case I could see the wizard on http://10.0.0.50:8080. Though before we setup the rest, we need to do one more thing in the installation section; Autostart. To auto-start the services we have to modify one file and set the “USER” that should run the process on startup. We have to edit /etc/default/sabnzbdplus and use our Ubuntu username behind the USER=. I am using nano to edit the file.
sudo nano /etc/default/sabnzbdplus
If you are done editing you can save using the key combination CTRL+O, press enter to safe it on its default location thus overwriting the file and press CTRL+X to exit nano.

sudo service sabnzbdplus start

I am going to run “SickBeard” on the same Ubuntu installation thus I want to change the port to 8081 so Sickbeard can run on 8080. You can modify the file to match your settings in /home/albert/.sabnzbd/sabnzbd.ini though its easier to modify it during the wizard.

[Installing SickBeard]

Sickbeard is a git repository and can easily be cloned and started in Ubuntu. If you do not have “git” installed its easily obtained using sudo apt-get install git-core. Below is my output from the clone;

albert@media:~$ git clone git://github.com/midgetspy/Sick-Beard.git .sickbeard
Cloning into '.sickbeard'...
remote: Counting objects: 25240, done.
remote: Total 25240 (delta 0), reused 0 (delta 0), pack-reused 25239
Receiving objects: 100% (25240/25240), 11.52 MiB | 3.89 MiB/s, done.
Resolving deltas: 100% (16835/16835), done.
Checking connectivity... done.
albert@media:~$

This will download the content to .sickbeard where the dot will keep the folder hidden. That’s it! The only thing left is to start it using python. Below again my console output from the launch

albert@media:~$ python .sickbeard/SickBeard.py
Starting up Sick Beard master
19:46:08 INFO::MAIN :: Checking database structure...
19:46:08 INFO::MAIN :: Checking database structure...
19:46:08 INFO::MAIN :: No duplicate show, check passed
19:46:08 INFO::MAIN :: No duplicate episode, check passed
19:46:08 INFO::MAIN :: No orphan episodes, check passed
19:46:08 INFO::MAIN :: Starting Sick Beard on http://0.0.0.0:8081/
19:46:08 INFO::MAIN :: Loading initial show list
19:46:08 INFO::CHECKVERSION :: Checking if git needs an update
19:46:09 INFO::CHECKVERSION :: No update needed
19:46:09 INFO::CHECKVERSION :: Check scene exceptions update
19:46:09 INFO::CHECKVERSION :: Updating scene exceptions
19:46:09 INFO::CHECKVERSION :: Clear name cache
19:46:09 INFO::CHECKVERSION :: Performing a vacuum on database: cache.db

If you visit your IP with :8081 (you can see the port in the output above) you see the Sickbeard page. You can configure it using the GUI. One final item remains; sickbeard does not start by itself after a reboot and if you kill the terminal, it will also stop the script. You could install “screen” to run it in a different session that stays active though I prefer to start Sickbeard with the init.d script provided.

We start by coping the script to the init.d folder.

albert@media:~$ sudo cp .sickbeard/init.ubuntu /etc/init.d/sickbeard

We than have to create and modify a file; /etc/default/sickbeard. I again like to use nano for that sudo nano /etc/default/sickbeard and we have to copy the following content to it. Remember to change “albert” with your own username used in Ubuntu.

# COPY THIS FILE TO /etc/default/sickbeard
SB_HOME=/home/albert/.sickbeard/
SB_DATA=/home/albert/.sickbeard/
SB_USER=albert

After this we have to update the boot sequence to include sickbeard in the startup.

sudo update-rc.d sickbeard defaults

I did got an error while I start the script using sudo service sickbeard start and after some troubleshooting I found out that my user “albert” did not own one file in the /run directory. So I ran the following command to own the file (again, make sure you are using your own username).

sudo chown -R albert /run/sickbeard

[Setup Folders and NFS Mount]

The downloads should be saved on my FreeNAS and the series from Sickbeard should be stored in the /series folders for automatic proccessing. Thus we are going to mount the FreeNAS using NFS.
To make sure I am using the right export name I always use showmount -e though by default this is not installed. This command is part of the “nfscommon” that we are going to install. We also need to create a folder to point the mount to. Below is my console output from these steps; (please note, I already installed nfscommon but included in the console output just in case)

albert@media:~$ sudo apt-get install nfs-common
password for albert:
Reading package lists... Done
Building dependency tree
Reading state information... Done
nfs-common is already the newest version (1:1.2.8-9ubuntu12.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
albert@media:~$ sudo showmount -e freenas
Export list for freenas:
/mnt/RaidZ/Media (everyone)
albert@media:~$ sudo mount freenas:/mnt/RaidZ/Media /mnt/freenas/
albert@media:~$ ls /mnt/freenas/ -l
total 202
drwxrwxr-x 87 1001 1001 88 Aug 14 19:09 Documentaries
drwxrwxr-x 10 1001 1001 11 Aug 23 19:31 Downloads
drwxrwxr-x 14 1001 1001 14 Aug 14 19:05 Kids
drwxrwxr-x  2 1001 1001  3 Oct  6  2016 Margrethe
drwxrwxr-x 55 1001 1001 55 Aug 14 20:05 Movies
drwxrwxr-x 15 1001 1001 15 Aug 14 18:05 Series
drwxrwxr-x  5 1001 1001  5 Aug 29  2016 Trips
albert@media:~$

Though after a reboot the mount is gone again so we have to add it to /etc/fstab. Below is my full string that is pointing to my export on the freenas server.

freenas:/mnt/RaidZ/Media /mnt/freenas nfs rsize=8192,wsize=8192,noexec,nosuid

[And now?]

Well, you are done with the installation so you can setup Sickbeard to your series and point to SABnzbd to download using certain categories. I already did a blog on setting this up (“Configuring directories for Sickbeard” ). From a high level point of view;

  1. Add SABnzbd with the API key to Sickbeard
  2. Add search providers and set the order of these
  3. Set the category “tv” in SABnzbd to store its successful downloads in the right folder
  4. Set the “post Processing” in Sickbeard to your format
  5. Add your existing shows by importing them (using the root folder)

Add a Comment

Your email address will not be published. Required fields are marked *