(Tutorial) How To Install Plex in a FreeNAS 11.2 Jail

DaChaos

Dabbler
Joined
Mar 11, 2016
Messages
11
Bummer.
Hopefully someone advanced will get to you soon.

If I had to guess the /etc/resolv.conf on Plex Jail doesn't have the updated DNS settings. You could try to edit the file yourself or try making a new jail now that you have filled in Nameserver 1.

Example resolv.conf
Code:
nameserver 192.168.0.1
nameserver 192.168.0.2
 
Last edited:

BamBamm

Patron
Joined
Aug 30, 2015
Messages
207
I deleted the Jail and I will restart everything later. It is 12 AM, time for bed.
Thanks for the help.
 

DaChaos

Dabbler
Joined
Mar 11, 2016
Messages
11
If your still having trouble some things to consider.
I just installed a fresh copy FreeNAS-9.3-STABLE-201601181840 on 1/27/2016.
I had no trouble with this tutorial. I noticed you joined in August 2015 so maybe you're running a different version.
I keep mine up to date & currently running FreeNAS-9.3-STABLE-201602031011 (u can check version on System -> Info)
Have you ran System -> Update? I read somewhere they made it easier to update at some point in time. I just click a button in web GUI presto, updated.
Download a copy of your config first in case something goes wrong.

Double check what Adrian posted maybe this URL has changed since u installed. I also use the same as Adrian for Jails -> Config -> Advanced -> Collection URL
Code:
http://download.freenas.org/latest/RELEASE/x64/jails


What do you have in the Collection URL field in Jails > Configuration?

I have > http://download.freenas.org/latest/RELEASE/x64/jails - and have no problems creating default jails.

That said, it could be because I already have the required templates!

When you added your first jail & it downloaded "freenas-standard-9.3-RELEASE.tgz" this should of created a new dataset in your jail root (/mnt/pool0/jails/.warden-template-standard) double check this is there since you had an error. Maybe it never finished downloading or is corrupted, mine is 1.6GiB

If this the case u might need to make new jail dataset & set the new path in Jails -> Config -> Jail Root to get it to download correctly (my first suggestion, I had to do this)

I don't want u to mess your systems up (nice systems btw) so this my last advice for now as it could be anything & never safe to follow a rookie. Good luck.
 

BamBamm

Patron
Joined
Aug 30, 2015
Messages
207
Thank you DaChaos,
I did all that several times. What I ended up doing:
  1. Installed firefly server via plugin
  2. Took screenshots of all the information that the firefly plugin automatically inputted for me
  3. Checked them against my Plex Jail information
  4. I deleted my plex jail
  5. Rebooted
  6. Installed a new jail via this tutorial
  7. I added my Mac Address
  8. I added allow.raw_sockets=true to the jail under Sysctls:
Everything seems to be okay, I am inside Plex now, adding libraries...
 
Last edited:

DaChaos

Dabbler
Joined
Mar 11, 2016
Messages
11
Glad to hear you figured it out. Yea "allow.raw_sockets=true" is added to mine by default. I never needed to mess with that on mine. But did see someone ask on here if it was necessary.
 

BamBamm

Patron
Joined
Aug 30, 2015
Messages
207
Yes, and it was said it wasn't needed.
So, I am guessing with the new update, it needs to be there.
 

Polzy

Dabbler
Joined
Dec 16, 2011
Messages
13
I need some help with mounting shares from a different Freenas box for the Jail storage part please.

I have 3 separate Freenas servers with each having a Share named "Media", within that I have sub-directories for TV Shows, Movies etc.

I've added Jail storage and pointed that to the Local server and Plex detects the files. What I am now trying to do is add storage to the Jail from the other 2 servers. I am assuming that the way to do this is via mounting a folder to point to that server?

I am trying to use "mount_smbfs -I 192.168.0.14 //guest@serverName/mySharedFolder /mnt/mySharedFolder"

When trying to access the recently mount folder via Windows and receive an error "\\X\X\X is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions. This handle is invalid".

When I go back into the Jail I can see the mount point, and it allows me to drill down and see the folders within that Share. However when I go into the Plex via Web and try and add the location into my Library it shows that the directory is blank.

I access the files today without a username or password, but not sure how to configure this for the same sort of thing for access within the Jail. Any ideas?
 

Markstamp

Cadet
Joined
Jul 7, 2014
Messages
8
Plex Users running FreeNAS and Pfsense If you are having issues with getting the SSL Green Lock locally in your browser Please add the following to your DNS Resolver under Advanced.
server:
private-domain: "plex.direct"
fwExo0y.png
 

zipfel

Dabbler
Joined
Dec 16, 2013
Messages
25
Hi guys,

Awesome tutorial! Thanks for writing it. However I am stuck on this part:

"Once at a shell prompt within the jail, find out what the GroupID is of the group that is(have?) assigned permissions on the mount with this command:
ls -l /mnt"

When I do this command this is what I get for output:

[root@freenas ~]# jexec 1 tcsh
root@plex:/ # ls -l /mnt
total 0

I have indeed mounted my storage linking 2 datasets together (MyLibrary and Plex) in the /media folder on the Plex Jail.

PLEX JAIL
/media/movies
/media/tv
/media/sports

Which links to

MyLibrary Dataset
/MyLibrary/movies
/MyLibrary/tv
/MyLibrary/sports


I need to figure out all this permission stuff as it is crucial to understand to run a good server and any help I would really appreciate.

So since that first command didn't work, I am assuming I need to find out user/group of the folders I created to share data between the 2 datasets:

root@plex:/ # ls -l /media/
total 338
drwxrwxr-x+ 2 1001 wheel 565 Mar 18 20:32 movies
drwxrwxr-x+ 3 1001 wheel 3 Jan 3 14:25 sports
drwxrwxr-x+ 67 1001 wheel 67 Mar 1 07:38 tv
root@plex:/ #

I see a UID of 1001 and a GID of wheel.

So I would also assume that I need to know the user/group of the folders in the MyLibrary dataset, which is also wheel.

[root@freenas ~]# ls -l /mnt/FreeNAS/MyLibrary/
total 1004
drwxrwxr-x+ 2 phil wheel 565 Mar 18 20:32 movies
drwxrwxr-x+ 3 phil wheel 3 Jan 3 14:25 sports
drwxrwxr-x+ 67 phil wheel 67 Mar 1 07:38 tv
[root@freenas ~]#

But I assume these are two different wheels. One is from the main freenas system and the other from my plex jail. That being said, everything appears to be working. Plex can see all my files and play them etc.

Again, I assume this works because the GID is the same between the 2 datasets.

[root@freenas ~]# getent group wheel | cut -d: -f3
0

root@plex:/ # getent group wheel | cut -d: -f3
0

Is this the correct way to do this? Or is there another more secure way? I just want to do what is best is all.

Thanks!
 
Joined
Feb 1, 2016
Messages
1
Hi,

I'm having some problems getting this to work and would really appreciate any help you can.

I can create the jail without any problems, but when I try to run the command pkg update && pkg upgrade -y I get the following error:

Code:
root@Plex:/ # pkg update && pkg upgrade -y
Updating FreeBSD repository catalogue...
Repository FreeBSD has a wrong packagesite, need to re-create database
pkg: http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/meta.txz: No address record
repository FreeBSD has no meta file, using default settings
pkg: http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/packagesite.txz: No address record
Unable to update repository FreeBSD
root@Plex:/ # 


I have tried changing the Collection URL and creating a new dataset for the jail root, deleting and creating a new jail after each step.

Many Thanks for your help
 

Cybix

Dabbler
Joined
Oct 23, 2015
Messages
11
Hi guys,

Awesome tutorial! Thanks for writing it. However I am stuck on this part:

"Once at a shell prompt within the jail, find out what the GroupID is of the group that is(have?) assigned permissions on the mount with this command:
ls -l /mnt"

When I do this command this is what I get for output:

[root@freenas ~]# jexec 1 tcsh
root@plex:/ # ls -l /mnt
total 0

I have indeed mounted my storage linking 2 datasets together (MyLibrary and Plex) in the /media folder on the Plex Jail.

PLEX JAIL
/media/movies
/media/tv
/media/sports

Which links to

MyLibrary Dataset
/MyLibrary/movies
/MyLibrary/tv
/MyLibrary/sports


I need to figure out all this permission stuff as it is crucial to understand to run a good server and any help I would really appreciate.

So since that first command didn't work, I am assuming I need to find out user/group of the folders I created to share data between the 2 datasets:

root@plex:/ # ls -l /media/
total 338
drwxrwxr-x+ 2 1001 wheel 565 Mar 18 20:32 movies
drwxrwxr-x+ 3 1001 wheel 3 Jan 3 14:25 sports
drwxrwxr-x+ 67 1001 wheel 67 Mar 1 07:38 tv
root@plex:/ #

I see a UID of 1001 and a GID of wheel.

So I would also assume that I need to know the user/group of the folders in the MyLibrary dataset, which is also wheel.

[root@freenas ~]# ls -l /mnt/FreeNAS/MyLibrary/
total 1004
drwxrwxr-x+ 2 phil wheel 565 Mar 18 20:32 movies
drwxrwxr-x+ 3 phil wheel 3 Jan 3 14:25 sports
drwxrwxr-x+ 67 phil wheel 67 Mar 1 07:38 tv
[root@freenas ~]#

But I assume these are two different wheels. One is from the main freenas system and the other from my plex jail. That being said, everything appears to be working. Plex can see all my files and play them etc.

Again, I assume this works because the GID is the same between the 2 datasets.

[root@freenas ~]# getent group wheel | cut -d: -f3
0

root@plex:/ # getent group wheel | cut -d: -f3
0

Is this the correct way to do this? Or is there another more secure way? I just want to do what is best is all.

Thanks!

Hi zipfel

You can try using this command from the plex jail to see all user/group IDs: " cat /etc/passwd "

I found that adding the "plex" user in the FreeNAS webgui gives root access for this user in FreeNAS. (if the User ID is matched)

I just added the group ID form the Plex jail Group and matched it's ID to that on a new group in FreeNAS.

Hope this is of some help for you and others
 
Last edited:

Cybix

Dabbler
Joined
Oct 23, 2015
Messages
11
Hi,

I'm having some problems getting this to work and would really appreciate any help you can.

I can create the jail without any problems, but when I try to run the command pkg update && pkg upgrade -y I get the following error:

Code:
root@Plex:/ # pkg update && pkg upgrade -y
Updating FreeBSD repository catalogue...
Repository FreeBSD has a wrong packagesite, need to re-create database
pkg: http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/meta.txz: No address record
repository FreeBSD has no meta file, using default settings
pkg: http://pkg.FreeBSD.org/freebsd:10:x86:64/latest/packagesite.txz: No address record
Unable to update repository FreeBSD
root@Plex:/ # 


I have tried changing the Collection URL and creating a new dataset for the jail root, deleting and creating a new jail after each step.

Many Thanks for your help

Hi BlueSimmo1031

This may be an issue with not having a DNS server set. Under networking tab in FreeNAS set the " Nameserver 1: " to " 8.8.8.8 " googles default DNS server.

Also you might need to set a default gateway in the Jail, from the "Edit jail" button. IPv4 default gateway:

Hope this helps
 
Last edited:

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Excellent tutorial. Thanks. I followed it and now have plex up and running. However, a couple of things ...

My system didn't like this ... "service plexmediaserver start"

Instead, it wanted "onestart" at the end.

The 'echo plexmediaserver_enable="YES" >> /etc/rc.conf' didn't seem to take as plex needs to be started manually after a reboot. How can I look inside that file?

Finally, the GUI is showing the plex jail but is not showing the plex add-in. Is that normal?
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I always install nano in my jails as I prefer that as an editor (pkg install nano)

Then is just a case of editing the rc.conf file (nano /etc/rc.conf) and adding the plexmediaserver_enable=YES (no "")
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Thanks. Good suggestion.

Nano installed and this is what my rc file contains ...

Capture.JPG


Seems I have it enabled 3 times ... with no " ... but the other lines have them. I'll delete two of the lines and add the " and see what happens when I reboot.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
It's 'plexmediaserver_enable=YES'

So no "" and no d (at the end of enable) :)
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Just coming back to report that first option didn't work. And ... typical of me ... I mis-spell a key word. Does this forum have +REP (or similar) ... because I want to award '+1' to AdrianW for his assistance.

Thanks.

Another reboot coming up.

Edit: Rebooted, checked the jail and ...

root@plex:/ # service plexmediaserver status
plexmediaserver is running as pid 4662.

The plugin isn't showing up in the GUI but I can live without that.
 
Last edited:

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
You've created it as a jail so it won't appear as a plugin!

Good to hear it's all working though now :D
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,996
I always install nano in my jails as I prefer that as an editor (pkg install nano)

Then is just a case of editing the rc.conf file (nano /etc/rc.conf) and adding the plexmediaserver_enable=YES (no "")
"ee" is also a text editor that is already installed. It's just as simple to use. I don't like "vi" at all. Maybe I should give "nano" a try.
 
Top