Advertisement
Guest User

Torrent box setup

a guest
Feb 12th, 2016
7,247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.21 KB | None | 0 0
  1. How to install a VM for Sonarr/CouchPotato/Transmission/IPVanish using Oracle VirtualBox on Windows host
  2.  
  3. Pre-requisites:
  4. - A functional Windows or Linux PC/Server to install VirtualBox on.
  5. - 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.
  6.  
  7. Software/OS used in this how-to:
  8. - Oracle VirtualBox - www.virtualbox.org
  9. - Ubuntu 14.04.3 Server 64-bit - www.ubuntu.com
  10. - Sonarr (formerly known as Nzbdrone) - https://sonarr.tv/
  11. - CouchPotato - https://couchpota.to/
  12. - An SSH client like Putty to connect to the Ubuntu Linux server once it’s installed. - http://www.putty.org/
  13.  
  14. Guides to setting up CouchPotato and Sonarr: (Made for Windows but just skip the Installation parts since we deal with this in the document.
  15. Sonarr: http://www.cuttingcords.com/home/ultimate-server/setting-up-sonarr
  16. CouchPotato: http://www.cuttingcords.com/home/ultimate-server/couchpotato
  17. The Ultimate Guide if you want more information or setup other apps:
  18. http://www.cuttingcords.com/home/ultimate-server/getting-started
  19.  
  20.  
  21.  
  22. Installing VirtualBox on Windows (Host)
  23.  
  24. 1- Download the latest VirtualBox for Windows hosts from www.virtualbox.org.
  25.  
  26. 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)
  27.  
  28. 3- Launch the VirtualBox setup. (right-click and run as Adminstrator)
  29.  
  30. 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.)
  31.  
  32. 5- Launch VirtualBox Oracle VM VirtualBox Extension Pack executable you downloaded previously. (right-click and run as Administrator)
  33.  
  34. Now that you have installed VirtualBox let’s setup the Virtual Machine!
  35.  
  36.  
  37. Setting up the Virtual Machine (Guest)
  38.  
  39. 1- Launch VirtualBox by double-clicking the VirtualBox link on your desktop or launch it from the Start Menu in Oracle VM VirtualBox folder.
  40.  
  41. 2- Click on the New button.
  42.  
  43. 3- Enter a descriptive name for the VM.
  44.  
  45. 4- From the Type drop-down menu choose Linux.
  46.  
  47. 5- From the Version drop-down menu select Ubuntu 64-bit
  48.  
  49. 6- Click Next.
  50.  
  51. 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.
  52.  
  53. 8- Select Create a virtual hard disk now and click Create.
  54.  
  55. 9- Select VMDK (Virtual Machine Disk)
  56.  
  57. 10- Click Next.
  58.  
  59. 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.)
  60.  
  61. 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.)
  62.  
  63. 13- Click Create and wait. (It will take longer if you chose Fixed size in the screen before.)
  64.  
  65.  
  66. 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.
  67.  
  68.  
  69. Changing the settings of the VM.
  70.  
  71. 1- Right click the VM you just created and select Settings.
  72.  
  73. 2- Click on System and uncheck Floppy and use the down arrow until Floppy is last in Boot order.
  74.  
  75. 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.)
  76.  
  77. 4- Click on Storage and select Controller: IDE.
  78.  
  79. 5- Click on the Optical media icon that says Empty next to it.
  80.  
  81. 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.
  82.  
  83. 7- Click on Audio and uncheck Enable Audio. (We don’t need it since it will be a server.)
  84.  
  85. 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.)
  86.  
  87. 9- Click on USB and uncheck Enable USB controller.
  88.  
  89. 10- Click Ok on the bottom-right and we are ready for the fun part.
  90.  
  91.  
  92. Installing Ubuntu 14.04.3 on the VM
  93. Video tutorial: https://www.youtube.com/watch?v=QUmMnpobyB8 (Credits to Basic IT Stuff)
  94.  
  95. 1- Select the VM you just configured and click on Start.
  96.  
  97. 2- Choose your language and press Enter.
  98.  
  99. 3- Select Install Ubuntu Server and press Enter.
  100.  
  101. 4- Again choose a language for the setup and press Enter.
  102.  
  103. 5- Select your location and press Enter.
  104.  
  105. 6- If you have QWERTY keyboard select <No>. (if you have another type of keyboard select <Yes> and follow the instructions.)
  106.  
  107. 7- Select English (US) and press Enter.
  108.  
  109. 8- Again select English (US) and press Enter.
  110.  
  111. 9- Enter a hostname for the server and press Enter.
  112.  
  113. 10- Enter a name for the 1st user of the server which will have root sudo privileges by default and press Enter.
  114.  
  115. 11- Select a username for this account and press Enter.
  116.  
  117. 12- Enter a password for this account and press Enter.
  118.  
  119. 13- Enter the same password to confirm and press Enter.
  120.  
  121. 14- Select <No> to encrypting you home directory and press Enter.
  122.  
  123. 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.)
  124.  
  125. 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.)
  126.  
  127. 17- Select <Yes> to Write the changes to disks and press Enter. (This will take more time if you created a larger virtual disk.)
  128.  
  129. 18- Select <Continue> to HTTP proxy information screen and press Enter. (Unless you are behind a proxy then you should input the information.)
  130.  
  131. 19- Select No automatic updates and press Enter.
  132.  
  133. 20- Check OpenSSH server and press Enter.
  134.  
  135. 21- Select <Yes> on the Install the GRUB boot loader on a hard disk screen and press Enter.
  136.  
  137. 22- Select <Continue> and press Enter.
  138. The Linux VM will now reboot.
  139.  
  140. Connecting to the server using SSH and setting up a static IP for your Linux server.
  141.  
  142. 1- At the login as: prompt enter the username and password you have chosen previously.
  143.  
  144. 2- At the prompt type the following to get the IP of the server so you can use Putty.
  145. ifconfig | grep -A1 'eth0' | grep 'inet addr'
  146.  
  147. 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.
  148.  
  149. 4- Type sudo vi /etc/network/interfaces and press Enter.
  150.  
  151. 5- Go to the iface eth0 inet dhcp line and press i to go in insert mode.
  152.  
  153. 6- At the beginning of the line add a # to comment out that line and press Escape.
  154.  
  155. 7- Press the Shift-4 ($ sign) to get to the end of line and press i again.
  156.  
  157. 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)
  158. iface eth0 inet static
  159. address 192.168.2.10 (or choose an IP that is not in use on your network.)
  160. netmask 255.255.255.0
  161. network 192.168.2.0
  162. broadcast 192.168.2.255
  163. gateway 192.168.2.1 (this should be the IP address of your router)
  164. 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.)
  165.  
  166. 9- Press Escape to exit edit mode.
  167.  
  168. 10- Type :wq to save and quit VI.
  169.  
  170. 11- Type exit to close this session.
  171.  
  172. 12- Now go back to VirtualBox console where you got the original IP from and type this:
  173. sudo su -
  174. ifdown eth0 && ifup eth0
  175.  
  176. 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.
  177.  
  178. Installing Sonarr.
  179. Source: https://github.com/Sonarr/Sonarr/wiki/Installation#linux
  180.  
  181. 1- Install mono-devel
  182. sudo apt-get install mono-devel
  183.  
  184. 2- Add Sonarr’s repository to you software source
  185. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC
  186. echo "deb http://apt.sonarr.tv/ master main" | sudo tee /etc/apt/sources.list.d/sonarr.list
  187.  
  188. 3- Update your software sources
  189. sudo apt-get update
  190.  
  191. 4- Install Sonarr
  192. sudo apt-get install nzbdrone
  193.  
  194. 5- Start Sonarr
  195. sudo mono --debug /opt/NzbDrone/NzbDrone.exe
  196.  
  197. 6- Launch your favorite browser and go to:
  198. http://IP_OF_YOUR_SERVER:8989
  199.  
  200. 7- That’s it! Sonarr is now installed.
  201.  
  202.  
  203. Installing CouchPotato
  204. Source: http://www.htpcguides.com/install-couchpotato-ubuntu/
  205.  
  206. 1- Install the pre-requisites to CouchPotato
  207. sudo apt-get install git-core libffi-dev libssl-dev zlib1g-dev libxslt1-dev libxml2-dev python python-pip python-dev build-essential –y
  208.  
  209. 2- Install lxml and pyopenssl
  210. sudo pip install lxml cryptography pyopenssl
  211.  
  212. 3- Install CouchPotato from github
  213. mkdir /opt/couchpotato
  214. cd /opt
  215. git clone git://github.com/RuudBurger/CouchPotatoServer.git /opt/couchpotato
  216.  
  217. 4- Change ownership of directory and files to start with root.
  218. sudo chown -R root:root /opt/couchpotato
  219.  
  220. 5- Start CouchPotato
  221. sudo python /opt/couchpotato/CouchPotato.py --daemon
  222.  
  223. 6- Launch your favorite browser and go to:
  224. http://IP_OF_YOUR_SERVER:5050
  225.  
  226. 7- That’s it! CouchPotato in now installed.
  227.  
  228.  
  229. Adding Windows shares to the Linux server for file transfers.
  230.  
  231. On the host server
  232. 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.
  233.  
  234. 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.
  235.  
  236. On the guest server (VM)
  237. 1- Create the directories where the shares will be mounted.
  238. for example:
  239. mkdir /network
  240. mkdir /network/downloads
  241. mkdir /network/mediafiles
  242.  
  243. 2- Add the shares to your /etc/fstab so they mount everytime the server boots.
  244. sudo vi /etc/fstab
  245.  
  246. 3- Create a new line at the end of the file and add these lines:
  247. //WINDOWS_SHARE_IP_ADDRESS/DOWNLOADS_SHARE_NAME /network/downloads cifs username=WINDOWS_SHARE_USER,password=WINDOWS_SHARE_PASSWORD,iocharset=utf8 0 0
  248. //WINDOWS_SHARE_IP_ADDRESS/MEDIA_SHARE_NAME /network/mediafiles cifs username=WINDOWS_SHARE_USER,password=WINDOWS_SHARE_PASSWORD,iocharset=utf8 0 0
  249.  
  250. ** replace the values with the ones you will be using.
  251.  
  252. 4- Test the mount points
  253. sudo mount –a
  254. df -h
  255.  
  256. You should now see 2 file systems starting with //WINDOWS_SHARE_IP_ADDRESS/SHARE_NAME
  257.  
  258. These shares will automatically reconnect when the Linux server boots.
  259.  
  260.  
  261. Installing Transmission
  262. Source: https://help.ubuntu.com/community/TransmissionHowTo
  263.  
  264. 1- Add Transmission PPA repository
  265. sudo add-apt-repository ppa:transmissionbt/ppa
  266.  
  267. 2- Update software sources
  268. sudo apt-get update
  269.  
  270. 3- Install Transmission
  271. sudo apt-get install transmission-cli transmission-common transmission-daemon
  272.  
  273. 4- Make sure Transmission is not running.
  274. sudo service transmission-daemon stop
  275.  
  276. 5- Edit Transmission’s settings
  277. sudo vi /var/lib/transmission-daemon/info/settings.json
  278.  
  279. 6- Change username and password for Transmission
  280. a. find rpc-password and rpc-username
  281. b. delete the info between the “ “ from this:
  282. "rpc-password": "{62b16db87b89a91dd49a5110a7cafc06d20eb4f2wtK6kqPj",
  283. "rpc-username": "transmission",
  284.  
  285. to something like this:
  286. "rpc-password": "YOUR_NEW_PASSWORD",
  287. "rpc-username": "YOUR_TRANSMISSOIN_USERNAME",
  288.  
  289. 7- In the same file look for rpc-whitelist and make sure your IP range is in there.
  290. something like this:
  291. "rpc-whitelist": "127.0.0.1,192.168.*.*",
  292.  
  293. 8- In the same file change the download directory so that you don’t fill up the space on the Virtual hard disk:
  294. "download-dir": “/network/downloads”,
  295.  
  296. 9- Start Transmission
  297. sudo service transmission-daemon start
  298.  
  299. 10- Launch your favorite browser and go to:
  300. http://IP_OF_YOUR_SERVER:9091
  301.  
  302. 11- That’s it Tranmission is now installed!
  303.  
  304.  
  305. Setting up the VPN connection using OpenVPN client and IPVanish VPN provider.
  306.  
  307. 1- Install Open VPN
  308. sudo apt-get install openvpn
  309.  
  310. 2- Download the config files and certificate to all the IPVanish servers.
  311. sudo su -
  312. cd /etc/openvpn
  313. wget http://www.ipvanish.com/software/configs/configs.zip; wget http://www.ipvanish.com/software/configs/ca.ipvanish.com.crt
  314.  
  315. 3- Unzip the configs
  316. unzip configs.zip
  317.  
  318. 4- Make a copy of the file from the server you wish to use
  319.  
  320. for example:
  321. cp -p ipvanish-US-Los-Angeles-lax-a13.ovpn OpenVPNConfigFile.conf
  322.  
  323. 5- Create a file with your IPVanish credentials
  324. vi yourserver.txt
  325.  
  326. and add your username and password (one per line)
  327. similar to this:
  328.  
  329. your_IPVanish_user_name
  330. your_IPVanish_password
  331.  
  332. 6- Add this credentials file to your VPN profile.
  333. vi OpenVPNConfigFile.ovpn
  334.  
  335. Find auth-user-pass and add yourserver.txt next to it like this:
  336. auth-user-pass yourserver.txt
  337.  
  338. 7- Make OpenVPN autostart
  339. vi /etc/default/openvpn
  340.  
  341. Uncomment this line:
  342. AUTOSTART="all"
  343.  
  344. 8- Start OpenVPN
  345. sudo service openvpn start
  346. There we go that wasn`t so difficult wasn`t it?
  347.  
  348.  
  349. I am not responsible for any problems/damages/death that may occur by using this how-to.
  350.  
  351. Have fun!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement