How to install a VM for Sonarr/CouchPotato/Transmission/IPVanish using Oracle VirtualBox on Windows host

Pre-requisites:

- A functional Windows or Linux PC/Server to install VirtualBox on.

- In this how-to I will try to use less technical terms for anyone trying this setup. Don’t worry this is pretty straight-forward and looks more complex than it is.

Software/OS used in this how-to:

- Oracle VirtualBox - www.virtualbox.org

- Ubuntu 14.04.3 Server 64-bit - www.ubuntu.com

- Sonarr (formerly known as Nzbdrone) - https://sonarr.tv/

- CouchPotato - https://couchpota.to/

- An SSH client like Putty to connect to the Ubuntu Linux server once it’s installed. - http://www.putty.org/

Guides to setting up CouchPotato and Sonarr: (Made for Windows but just skip the Installation parts since we deal with this in the document.

Sonarr: http://www.cuttingcords.com/home/ultimate-server/setting-up-sonarr

CouchPotato: http://www.cuttingcords.com/home/ultimate-server/couchpotato

The Ultimate Guide if you want more information or setup other apps:

http://www.cuttingcords.com/home/ultimate-server/getting-started

Installing VirtualBox on Windows (Host)

1- Download the latest VirtualBox for Windows hosts from www.virtualbox.org.

2- Download the VirtualBox Oracle VM VirtualBox Extension Pack for the same version of VirtualBox host you downloaded. (the link is on the same page)

3- Launch the VirtualBox setup. (right-click and run as Adminstrator)

4- Press next till the end of the setup. (if you want to specify a different folder for the installation it’s up to you but won’t matter in the end. Change the folder only if you want to run from another disk.)

5- Launch VirtualBox Oracle VM VirtualBox Extension Pack executable you downloaded previously. (right-click and run as Administrator)

Now that you have installed VirtualBox let’s setup the Virtual Machine!

Setting up the Virtual Machine (Guest)

1- Launch VirtualBox by double-clicking the VirtualBox link on your desktop or launch it from the Start Menu in Oracle VM VirtualBox folder.

2- Click on the New button.

3- Enter a descriptive name for the VM.

4- From the Type drop-down menu choose Linux.

5- From the Version drop-down menu select Ubuntu 64-bit

6- Click Next.

7- Either use the bar to set the amount of RAM for the VM or enter it manually. I’ve set mine to 2048 MB and it runs smoothly. It doesn’t need much really for the applications you will be installing.

8- Select Create a virtual hard disk now and click Create.

9- Select VMDK (Virtual Machine Disk)

10- Click Next.

11- Select Dynamically allocated and check the Split into files of less than 2GB. (You may also select Fixed size but this is optional and won’t change anything in this setup.)

12- Now click on the folder icon on the left end of the text box and select a drive and folder you wish to create the virtual hard disk and assign it 8.00 GB. (You may allocate more space if you want to but you won’t need it in this setup.)

13- Click Create and wait. (It will take longer if you chose Fixed size in the screen before.)

The VM has been created but we still need to change its settings so that it boots from the Ubuntu 14.04.3 64-bit ISO.

Changing the settings of the VM.

1- Right click the VM you just created and select Settings.

2- Click on System and uncheck Floppy and use the down arrow until Floppy is last in Boot order.

3- Under the Processor tab select the number of processors you want to assign to this VM. (2 is enough for this setup but you may add more if you feel the need.)

4- Click on Storage and select Controller: IDE.

5- Click on the Optical media icon that says Empty next to it.

6- From the Attributes section click on the Optical media icon and select Choose Virtual Optical Disk File… and go to where you downloaded the ubuntu-14.04.3-server-amd64.iso file and click Open.

7- Click on Audio and uncheck Enable Audio. (We don’t need it since it will be a server.)

8- Click on Network and for the Attached to drop-down menu select Bridged Adapter and from the Name drop-down menu select the network interface you wish to use for this VM. (Normally there’s only 1.)

9- Click on USB and uncheck Enable USB controller.

10- Click Ok on the bottom-right and we are ready for the fun part.

Installing Ubuntu 14.04.3 on the VM

Video tutorial: https://www.youtube.com/watch?v=QUmMnpobyB8 (Credits to Basic IT Stuff)

1- Select the VM you just configured and click on Start.

2- Choose your language and press Enter.

3- Select Install Ubuntu Server and press Enter.

4- Again choose a language for the setup and press Enter.

5- Select your location and press Enter.

6- If you have QWERTY keyboard select <No>. (if you have another type of keyboard select <Yes> and follow the instructions.)

7- Select English (US) and press Enter.

8- Again select English (US) and press Enter.

9- Enter a hostname for the server and press Enter.

10- Enter a name for the 1st user of the server which will have root sudo privileges by default and press Enter.

11- Select a username for this account and press Enter.

12- Enter a password for this account and press Enter.

13- Enter the same password to confirm and press Enter.

14- Select <No> to encrypting you home directory and press Enter.

15- Press Enter to select the timezone suggested for this server. (by default it should already have selected the one you are in. If not select <No> and choose from the list.)

16- Partition the disk has you want but if you selected Manual create a / (root filesystem) with 6.7 GB and the rest for the swap partition. Or just select one of the 2 first options. (Guided – use entire disk or Guided – use entire disk and set up LVM.)

17- Select <Yes> to Write the changes to disks and press Enter. (This will take more time if you created a larger virtual disk.)

18- Select <Continue> to HTTP proxy information screen and press Enter. (Unless you are behind a proxy then you should input the information.)

19- Select No automatic updates and press Enter.

20- Check OpenSSH server and press Enter.

21- Select <Yes> on the Install the GRUB boot loader on a hard disk screen and press Enter.

22- Select <Continue> and press Enter.

The Linux VM will now reboot.

Connecting to the server using SSH and setting up a static IP for your Linux server.

1- At the login as: prompt enter the username and password you have chosen previously.

2- At the prompt type the following to get the IP of the server so you can use Putty.

ifconfig | grep -A1 'eth0' | grep 'inet addr'

3- Launch putty and in the Host Name (or IP address) box enter the IP address that the command above returned and click Open on the bottom.

4- Type sudo vi /etc/network/interfaces and press Enter.

5- Go to the iface eth0 inet dhcp line and press i to go in insert mode.

6- At the beginning of the line add a # to comment out that line and press Escape.

7- Press the Shift-4 ($ sign) to get to the end of line and press i again.

8- Press the right arrow 1 time on your keyboard and press enter to create a new line and paste this: (if your PC’s IP is the 192.168.1.x range)

iface eth0 inet static

address 192.168.2.10 (or choose an IP that is not in use on your network.)

netmask 255.255.255.0

network 192.168.2.0

broadcast 192.168.2.255

gateway 192.168.2.1 (this should be the IP address of your router)

dns-nameservers 192.168.2.1 (this should be the IP address of your router or other DNS servers you use if you need it.)

9- Press Escape to exit edit mode.

10- Type :wq to save and quit VI.

11- Type exit to close this session.

12- Now go back to VirtualBox console where you got the original IP from and type this:

sudo su -

ifdown eth0 && ifup eth0

13- Now repeat step 3 of this section to open a new session with the new IP you just set and let’s move on to installing the applications you will use on this server.

Installing Sonarr.

Source: https://github.com/Sonarr/Sonarr/wiki/Installation#linux

1- Install mono-devel

sudo apt-get install mono-devel

2- Add Sonarr’s repository to you software source

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC

echo "deb http://apt.sonarr.tv/ master main" | sudo tee /etc/apt/sources.list.d/sonarr.list

3- Update your software sources

sudo apt-get update

4- Install Sonarr

sudo apt-get install nzbdrone

5- Start Sonarr

sudo mono --debug /opt/NzbDrone/NzbDrone.exe

6- Launch your favorite browser and go to:

http://IP_OF_YOUR_SERVER:8989

7- That’s it! Sonarr is now installed.

Installing CouchPotato

Source: http://www.htpcguides.com/install-couchpotato-ubuntu/

1- Install the pre-requisites to CouchPotato

sudo apt-get install git-core libffi-dev libssl-dev zlib1g-dev libxslt1-dev libxml2-dev python python-pip python-dev build-essential –y

2- Install lxml and pyopenssl

sudo pip install lxml cryptography pyopenssl

3- Install CouchPotato from github

mkdir /opt/couchpotato

cd /opt

git clone git://github.com/RuudBurger/CouchPotatoServer.git /opt/couchpotato

4- Change ownership of directory and files to start with root.

sudo chown -R root:root /opt/couchpotato

5- Start CouchPotato

sudo python /opt/couchpotato/CouchPotato.py --daemon

6- Launch your favorite browser and go to:

http://IP_OF_YOUR_SERVER:5050

7- That’s it! CouchPotato in now installed.

Adding Windows shares to the Linux server for file transfers.

On the host server

1- Create a share on the host server or NAS to use for downloads and give it full access to the user that will be used by CIFS to connect to the share.

2- Create another share on the host server or NAS that is where all your movies and tv-shows are located and give it full access again to the same user as above.

On the guest server (VM)

1- Create the directories where the shares will be mounted.

for example:

mkdir /network

mkdir /network/downloads

mkdir /network/mediafiles

2- Add the shares to your /etc/fstab so they mount everytime the server boots.

sudo vi /etc/fstab

3- Create a new line at the end of the file and add these lines:

//WINDOWS_SHARE_IP_ADDRESS/DOWNLOADS_SHARE_NAME /network/downloads cifs username=WINDOWS_SHARE_USER,password=WINDOWS_SHARE_PASSWORD,iocharset=utf8 0 0

//WINDOWS_SHARE_IP_ADDRESS/MEDIA_SHARE_NAME /network/mediafiles cifs username=WINDOWS_SHARE_USER,password=WINDOWS_SHARE_PASSWORD,iocharset=utf8 0 0

** replace the values with the ones you will be using.

4- Test the mount points

sudo mount –a

df -h

You should now see 2 file systems starting with //WINDOWS_SHARE_IP_ADDRESS/SHARE_NAME

These shares will automatically reconnect when the Linux server boots.

Installing Transmission

Source: https://help.ubuntu.com/community/TransmissionHowTo

1- Add Transmission PPA repository

sudo add-apt-repository ppa:transmissionbt/ppa

2- Update software sources

sudo apt-get update

3- Install Transmission

sudo apt-get install transmission-cli transmission-common transmission-daemon

4- Make sure Transmission is not running.

sudo service transmission-daemon stop

5- Edit Transmission’s settings

sudo vi /var/lib/transmission-daemon/info/settings.json

6- Change username and password for Transmission

a. find rpc-password and rpc-username

b. delete the info between the “ “ from this:

"rpc-password": "{62b16db87b89a91dd49a5110a7cafc06d20eb4f2wtK6kqPj",

"rpc-username": "transmission",

to something like this:

"rpc-password": "YOUR_NEW_PASSWORD",

"rpc-username": "YOUR_TRANSMISSOIN_USERNAME",

7- In the same file look for rpc-whitelist and make sure your IP range is in there.

something like this:

"rpc-whitelist": "127.0.0.1,192.168.*.*",

8- In the same file change the download directory so that you don’t fill up the space on the Virtual hard disk:

"download-dir": “/network/downloads”,

9- Start Transmission

sudo service transmission-daemon start

10- Launch your favorite browser and go to:

http://IP_OF_YOUR_SERVER:9091

11- That’s it Tranmission is now installed!

Setting up the VPN connection using OpenVPN client and IPVanish VPN provider.

1- Install Open VPN

sudo apt-get install openvpn

2- Download the config files and certificate to all the IPVanish servers.

sudo su -

cd /etc/openvpn

wget http://www.ipvanish.com/software/configs/configs.zip; wget http://www.ipvanish.com/software/configs/ca.ipvanish.com.crt

3- Unzip the configs

unzip configs.zip

4- Make a copy of the file from the server you wish to use

for example:

cp -p ipvanish-US-Los-Angeles-lax-a13.ovpn OpenVPNConfigFile.conf

5- Create a file with your IPVanish credentials

vi yourserver.txt

and add your username and password (one per line)

similar to this:

your_IPVanish_user_name

your_IPVanish_password

6- Add this credentials file to your VPN profile.

vi OpenVPNConfigFile.ovpn

Find auth-user-pass and add yourserver.txt next to it like this:

auth-user-pass yourserver.txt

7- Make OpenVPN autostart

vi /etc/default/openvpn

Uncomment this line:

AUTOSTART="all"

8- Start OpenVPN

sudo service openvpn start

There we go that wasn`t so difficult wasn`t it?

I am not responsible for any problems/damages/death that may occur by using this how-to.