Resource icon

[HOW TO] FN11.1 Docker VM, Rancher, Plex, Tautulli, Ombi, Deluge w/OpenVPN & PIA, Sickrage, & More

Status
Not open for further replies.

dublea

Dabbler
Joined
May 27, 2015
Messages
33
I've spent the past couple weekends teaching myself RancherOS and Docker for the intended purpose of migrating my Plex from a Jail to a Docker container. In this guide, we will install and configure a RancherOS VM, spin up Plex, Tautulli (formally plexpy,) and Plex Requests containers. Additionally, I will also be walking you through backing up and migrating your current Plex data from a Plugin or Jail install.

[EDIT 12.3.2018] I found the the better section to place this How-To would be the Resources section. Plans are being made to migrate this guide. Additionallyu, I will be adding details how to set up Deluge w/ OpenVPN, Couchpotato, Sickrage, and many others! If you can, please provide suggestions.

[EDIT 18.3.2018] I am still working on writing up the new How-To. While doing so, I expanded the options for choice of VM & Will elaborate on leveraging some Rancher\Docker features in a multi-host Rancher setup. Considering all this new information, it will take time to capture all the info while I set this up in my Homelab.

[EDIT 25.3.2018] I've got all but Nextcloud documented and posting the guide now!

Installing RancherOS VM:

Log into your FreeNAS and go to VMs
001_VM.PNG


Select Add VM
002_AddVM.PNG


VM Type: Change to Docker VM
Name: Give it a name
Description: {Optional}
Virtual CPUs: Min of 1
Memory Size (MiB): Min of 2048
Autostart: Enable

OK to save. You can then select the VM and then Devices at the bottom
003_Devices.PNG


Select the RAW device and then Edit at the bottom
004_RAWEdit.PNG


Raw File: Provide a path to a .IMG file. You must enter the full filename after the path but the install will create it.
Disk boot: Enable
Password: Provide a password. When we access RancherOS via shell, this is the password we will use.
Disk size: Enter the size of the disk

Start the VM! It will download and install the image. You will now want to access your FreeNAS's shell through your preferred method. Now to access VM's shell by running:
cu -l /dev/nmdm#B (Replace # with number listed in /dev/)

You may have to hit enter to get the RancherOS login
005_RacherOS.PNG


Login with the username ' rancher' and the password you configured earlier for the RAW device. Next you will want to configure a static IP. First run ' ifconfig' to get your interface name ( eth0 be default.) Then run the following after modifying what you need to depending on your network configuration:[/b]

sudo ros config set rancher.network.interfaces.eth0.address 10.1.10.15/24
sudo ros config set rancher.network.interfaces.eth0.gateway 10.1.10.1
sudo ros config set rancher.network.interfaces.eth0.mtu 1500
sudo ros config set rancher.network.interfaces.eth0.dhcp false


Reboot the VM by running ' sudo reboot'. You should be able to SSH into the VM now instead of going the FreeNAS's shell.

Run the following to install the Rancher container so we can access the Web UI:
sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server

Once that completes, go to http://{Your_Static_IP}:8080 and go to Add Host. Verify and save the Host Registration URL. Enter the IP for the new host, copy the command and run it in the RancherOS shell
007_AddHost.PNG


Got to Admin > Access Control and select Local Authentication
008_LocAuth.PNG


Enter in your information and Enable Local Auth. RancherOS VM is now installed!

Items to address for Migration

Now to disable some Plex features for the server migration. You will want to go to Settings > Server > Library and disable Empty trash automatically after every scan in your Plex Jail. Thanks to Where is the Plex Media Server data directory located? we also know the following:

Manual Jail Install:
${JAIL_ROOT}/usr/local/plexdata/Plex Media Server

Plugin Jail Install:
${JAIL_ROOT}/var/db/plexdata/Plex Media Server/

If you do not have a share, you will want to create one to copy your Plex data to.
I migrated my Plex Media Server folder to an existing Backup share via shell like this:
# In a shell, navigate to your plexdata folder and run the following to compress folder
tar -zcvf pms.tar.gz "Plex Media Server/"
# Copy .tar.gz file to share.
cp -R /mnt/Jails/plex/usr/local/plexdata/pms.tar.gz /mnt/Volume01/Backup/plexdata


Mounting Media and Backup storage CIFS

I also want to mirror the paths I have in my jail with the new container. In the FreeNAS WebUI, Go to Jails and select Storage. Mine was mounted at /media and I will want to do the same with RancherOS. We will create a .YAML file and merge it into the config.
vi mount.yaml

Press i to enter insert mode.

mounts:
- - //{FreeNAS}/Backup/plexdata
- /config/plexdata
- cifs
- username={Username},password={Password},iocharset=utf8,_netdev
- - //{FreeNAS}/Media
- /media
- cifs
- username={Username},password={Password},iocharset=utf8,_netdev


Once you've configured the file to your needs, press ESC and then :x to save and close the file.

Run the following to merge the file into the config
sudo ros config merge -i mount.yaml

Reboot the VM by running ' sudo reboot'. You can then run ' sudo df -h' to verify everything mounted correctly.

Configure and install Plex container

Go to INFRASTRUCTURE > Containers > Add Container
009_AddCon.PNG


Name: pms
Description: {Optional}
Select Image*: plexinc/pms-docker
+ Port Map: 32400:32400

Add two Environment Variables
010_EnvVar.PNG


Auto Restart= Always
HOSTNAME= pms
TZ= Timezone
PLEX_CLAIM= claim-https://www.plex.tv/claim/

Configure Volumes
011_Vol.PNG


/media/config:/config
/media/Media:/media
/media/transcode:/transcode


Configure Networking
012_Net.PNG


Network: Host
DNS: Enable Rancher DNS service discovery
Hostname: {Hostname}
Domain Name: {Domain}
Resolving Servers: {DNS}

You should now be able to Create the container. It will download and configure the container. You should now be able to access it at http://{Docker_IP}:32400

Completing the data migration

Once you've verified you can access the Plex Wizard first webapge, go ahead and stop the container. Back in the RancherOS shell, navigate to /media/config/Library/Application Support and run ls -l to view UID:GID
drwxr-xr-x 8 sshd input 4096 Mar 11 05:05 Plex Media Server
In this case the UID:GID is sshd:input.

Delete the current Plex Media Server folder by running
sudo rm -R "Plex Media Server"

Now, lets copy the Jails Plex Media Server to /media/config/Library/Application Support in the container by running
sudo cp /media/Backup/plexdata/pms.tar.gz "/media/config/Library/Application Support/" This took some time!
cd "/media/config/Library/Application Support/"
sudo gunzip pms.tar.gz && sudo tar -xvf pms.tar
Must perform two commands as z is missing from tar in RancherOS. If someone knows a better way...
sudo rm pms.tar

Next we need to adjust the file permissions by running
sudo chown -R sshd:input "/media/config/Library/Application Support/*"

After everything was done, I was able to start the pms container and access the WebUI just as if it were in my jail! Remember to enable Empty trash automatically after every scan in Settings > Server > Library. Be sure and allow your PMS to re-process all your media.
 
Last edited:

dublea

Dabbler
Joined
May 27, 2015
Messages
33
Tautulli (formally plexpy) Is a Python-based Plex Usage tracker.

Go to INFRASTRUCTURE > Containers > Add Container
012_tautulli_AddCon.PNG


Name: tautulli
Description: {Optional}
Select Image*: shiggins8/tautulli
+ Port Map: 8181:8181

Add Environment Variables
013_tautulli_EnvVar.PNG


Auto Restart= Always
TZ= Timezone


Configure Volumes
013_tautulli_Vol.PNG


Variables we will need to address:

  • <path to plexlogs>:/logs:ro Map to Plex Media servers log directory; preferably mapped with ro (ReadOnly) access.
We know from earlier it is located on the RancherOS at /media/config/Library/Application Support/Plex Media Server/Logs

/media/tautulli:/config
/media/config/Library/Application Support/Plex Media Server/Logs:/logs:ro


Configure Networking
015_tautulli_Net.PNG


Network: Host
DNS: Enable Rancher DNS service discovery
Hostname: {Hostname}
Domain Name: {Domain}
Resolving Servers:
{DNS}

Start the Tautulli container and access the Setup page http://{Docker_IP}:8181 to get started.
016_tautulli_Wiz.PNG
 
Last edited:

dublea

Dabbler
Joined
May 27, 2015
Messages
33
Plexrequests is a simple automated way for users to request new content

Go to INFRASTRUCTURE > Containers > Add Container
017_plexrequests_AddCon.PNG


Name: plexrequests
Description: {Optional}
Select Image*: linuxserver/plexrequests
+ Port Map: 3000:3000

Add Environment Variables
018_plexrequests_EnvVar.PNG


Auto Restart: Always

Configure Volumes
019_plexrequests_Vol.PNG


/media/plexrequests:/config

Configure Networking
020_plexrequests_Net.PNG


Network: Host
DNS: Enable Rancher DNS service discovery
Hostname: {Hostname}
Domain Name: {Domain}
Resolving Servers: {DNS}

Start the Plex Request container and access the Setup page http://{Docker_IP}:3000 to get started. FYI, It may take a while for things to get configured.{/SPOILER]
 
Last edited:

geoff10e

Cadet
Joined
Mar 12, 2018
Messages
1
Wanted to add that I'm running on an old jail and my Plex Data was at:

Legacy Plugin Install:
${JAIL_ROOT}/usr/pbi/plexmediaserver-amd64/plexdata

To my knowledge there is no separate DB folder.

Probably a better question for the PLEX community but do you know of any fat trimming that can be done in the plexdata folder?
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Ive had some issues with connecting to the Tautulli interface, I've followed the instruction word for word and also tried other configs aswell as tried remaking the container multiple times. But every time when I go to connect I get
This site can’t be reached
192.168.2.20 refused to connect.

I have no idea why, any help ideas?
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
I've had some issues with connecting to the Tautulli interface, I've followed the instruction word for word and also tried other configs aswell as tried remaking the container multiple times. But every time when I go to connect I get
This site can’t be reached
192.168.2.20 refused to connect.

I have no idea why, any help ideas?
Sorted the issue, the web server was just taking a ridiculous amount of time to start, my impatience got the better of me hahaha
 

dublea

Dabbler
Joined
May 27, 2015
Messages
33
Sorted the issue, the web server was just taking a ridiculous amount of time to start, my impatience got the better of me hahaha

Hahaha, Same thing occurred with me. I'll make a note of it as I'm writing up the Resources How-To. Just to verify, it was the Rancher WebUI you are referring to?
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Hahaha, Same thing occurred with me. I'll make a note of it as I'm writing up the Resources How-To. Just to verify, it was the Rancher WebUI you are referring to?
Nah i was referring to the Tautulli WebUI, but yeh when I set up rancher I did have the same issue but only on its first boot
 

dublea

Dabbler
Joined
May 27, 2015
Messages
33
Nah i was referring to the Tautulli WebUI, but yeh when I set up rancher I did have the same issue but only on its first boot

OK. Keep in mind there is a way to view the log when it's first starting up. You can view it out from the container in the UI. In the upper left is an box with three vertical dots. Select it and then View Logs. That way you can tell when the WebUI should be accessible.
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
OK. Keep in mind there is a way to view the log when it's first starting up. You can view it out from the container in the UI. In the upper left is an box with three vertical dots. Select it and then View Logs. That way you can tell when the WebUI should be accessible.
Yeh I eventually thought to check the logs and the timestamps, about a 3-4 minutes delay from container start to WebUI start
 

Kennyvb8

Contributor
Joined
Mar 18, 2017
Messages
112
hmm your network page looks different! if i select host as network i dont get the option for hostname and if i select bridge i dont get RAncher dns service
 

dublea

Dabbler
Joined
May 27, 2015
Messages
33
hmm your network page looks different! if i select host as network i don't get the option for hostname and if i select bridge i don't get RAncher dns service

That is very odd. I have since moved away from RancherOS but have still using Rancher on Ubuntu... but the network page is still the same for me. Care to share some screenshots?
 

Kennyvb8

Contributor
Joined
Mar 18, 2017
Messages
112
That is very odd. I have since moved away from RancherOS but have still using Rancher on Ubuntu... but the network page is still the same for me. Care to share some screenshots?
3 images of 3 different network settings, hard to know what to choose, because i want all the settings hehe
Skærmbillede 2018-03-23 kl. 05.24.52.png Skærmbillede 2018-03-23 kl. 05.24.58.png Skærmbillede 2018-03-23 kl. 05.25.08.png
 

Kennyvb8

Contributor
Joined
Mar 18, 2017
Messages
112
What web browser are you using? The default is Managed and is usable instead of Host tbh. I'm at a loss as to why you cannot configure a hostname when selecting Host...


Safari (macOs)
Same in Chrome


Sent from my iPhone using Tapatalk
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,176
I just saw that this was submitted as a Resource, so I took the liberty of assigning this existing thread as the discussion thread for the Resource. In the future, feel free to bring existing threads that should be attached to a new Resource to my attention, so that I can deal with them.

As an aside, why would anyone want to migrate Plex from a jail to a VM running Docker? I can understand the ease of use argument for initial setup with the old jails infrastructure (which is fortunately being addressed), but migrating a working setup to a VM seems counterproductive.
 

dublea

Dabbler
Joined
May 27, 2015
Messages
33
Thanks for assigning the existing thread as the discussion thread for the Resource.

As an aside, why would anyone want to migrate Plex from a jail to a VM running Docker?

After testing and not really getting hit with any resource issues, considering ease of use, manageability, and several other factors, I made the jump. There are more things one can do with Docker vs jails. I have the choice of adding hosts and growing. For me, it was a better choice for my existing setup.
 

NetSoerfer

Explorer
Joined
May 8, 2016
Messages
57
Something I noticed while trying to fix issues with my Rancher server becoming unreachable:

Turns out Rancher tries to use a subnet that's already in use in my home network. If you use any subnets in the 10.42.0.0/16 (10.42.x.x) range, they will collide with Rancher's default managed network (see Rancher FAQ for more information):
Rancher FAQ said:
The default subnet (10.42.0.0/16) used by Rancher is already used in my network and prohibiting the managed network. How do I change the subnet?

To prevent Rancher from using a subnet that will collide with any existing subnets you may have in the 10.42.x.x range, set a different managed network in the Cattle Environment Template (see attached screenshots if you can't find where to do the below steps):
  • Go to Manage Environments
  • Edit the Cattle Environment Template
  • Scroll to the Networking services and click Edit Config for the Rancher IPsec service
  • In the Configuration Options section, change the Subnet variable to an unused subnet
    (note that this is a /16 subnet - so if you set 10.32.0.0/16, Rancher will use up the entire IP range from 10.32.0.0 to 10.32.255.255!)
  • Scroll down and click Configure to return to the Environment Template, then don't forget to scroll all the way down to actually Save the Environment Template's changed configuration!
After updating the template, you must create a new environment - the environment created by default won't be updated with the new managed network settings. In Manage Environments, create a new environment using the Cattle template, set it as default, Deactivate the old environment and then Delete it.
 

Attachments

  • Manage Environments.PNG
    Manage Environments.PNG
    681.9 KB · Views: 833
  • Edit Cattle Environment Template.PNG
    Edit Cattle Environment Template.PNG
    812.8 KB · Views: 882
  • Edit Config Rancher IPsec.PNG
    Edit Config Rancher IPsec.PNG
    774.3 KB · Views: 871
  • Edit Subnet.PNG
    Edit Subnet.PNG
    668.1 KB · Views: 671
Last edited:

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@dublea On fact you do not address is that in the current FreeNAS implementation the base rancheros is not user upgradable. There have been numerous releases since v1.1.3 and v1.3.0 is due soon.

https://github.com/rancher/os/releases
 
Status
Not open for further replies.
Top