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

Joined
Mar 6, 2014
Messages
686
You're welcome. I don't know anything about Plex database migration however
 

rumdr19

Dabbler
Joined
Jan 18, 2015
Messages
28
No worries, you've helped enough
 

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
Hey there!

I've been happily running Plex via this installation method for quite some time now. Periodically I'd upgrade the jail w/ a portsnap fetch update and portupgrade -a command. Looks like something is wonky w/ ruby now, and it's keeping me from being able to upgrade.

[Plex] Installing ruby19-1.9.3.551_2,1...
[Plex] Extracting ruby19-1.9.3.551_2,1: 100%
Message for ruby19-1.9.3.551_2,1:
====
Some of the standard commands are provided as separate ports for ease
of upgrading:

devel/ruby-gems: gem - RubyGems package manager
devel/rubygem-rake: rake - Ruby Make

And some of the standard libraries are provided as separate ports
since they require extra dependencies:

converters/ruby-iconv: iconv module
databases/ruby-gdbm: GDBM module
x11-toolkits/ruby-tk: Tcl/Tk modules
japanese/ruby-tk: Tcl/Tk modules for Japanized Tcl/Tk

Install them as occasion demands.
====
** Fix the installation problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
! lang/ruby20 (ruby19-1.9.3.551_2,1) (install error)
root@Plex:/ #​

I've tried make deinstall / make reinstall / make install clean specifically on the listed ruby package, but I'm not getting anywhere. I still end up with this same error. What am I missing? Thanks!
 

ikonspirasi

Cadet
Joined
Apr 3, 2015
Messages
9
How To Install Plex in a Jail:

Accessing Mounted Storage In Your Jail With Plex:
To add storage to your FreeNAS Jail, start by following this documentation:http://doc.freenas.org/index.php/Adding_Jails#Adding_Storage

After mounting the storage in your jail, it may be tempting to grant your files 777 access to give Plex access to them. With that said, don’t do it; there is an easy work around. Basically, you can add groups to the jail with the same GroupID as the ones on the host system.

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

You’ll then see a list of mount points such as this one:
drwxrwx---+ 7 1002 1001 8 Mar 3 18:35 Media


The column with 1002 is the UserID, and 1001 is the GroupID. If you want Plex to have access to the Media mount, you need need to create the Media group in the jail with a GroupID of 1001, and have the plex user in it.

To do this, start by editing /etc/group with this command:
ee /etc/group

Then add this to the bottom of the file (excluding the 1/line number in the box below):
Code:
Media:*:1001:plex

After saving the file, you can look at the permissions of the mount again by using:
ls -l /mnt

Now, you should see the following instead:
drwxrwx---+ 7 1002 Media 8 Mar 3 18:35 Media


You are now done. Plex will now have access to the Media mount.

This my friend, has save me a lot of time, thank you.
By default the folders always with user and groups 1001 in plex and btsync plugins installation, with this tutorial i manage to make folder in my cifs share to be used in plex and btsync.
Before i found out about this, the plugins cannot write into the folder because of it's permission.
 

StarkJohan

Explorer
Joined
Mar 27, 2015
Messages
62
These instructions helped me very much and I now have a couple of nice jails up and running.

However, I'm having some problems with plex. All my media is located in a jail storage used by the plex jail. Adding and playing media works just fine but if media files are deleted a library refresh/update does not remove the metadata for some reason. Has anybody experienced this
 

StarkJohan

Explorer
Joined
Mar 27, 2015
Messages
62
These instructions helped me very much and I now have a couple of nice jails up and running.

However, I'm having some problems with plex. All my media is located in a jail storage used by the plex jail. Adding and playing media works just fine but if media files are deleted a library refresh/update does not remove the metadata for some reason. Has anybody experienced this

Edit: For some reason everything started working the next day without me doing anything. Perhaps the scheduled tasks fixed it... Working like a charm now.

Edit: While experimenting today I also noticed that the file permissions of the media library is important. I can't imagine permissions changing while I was sleeping though...
 
Last edited:

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Question:

Why would you install Plex in a jail, rather than just use the regular plugin which ships in FreeNAS?
I've just installed Plex via the plugin method and it's not signing in to the plex web site with my account, it's either a routing issue on my NAS (I doubt) or perhaps it's because my newly installed Plugin is out of date (?)

So I figure Plex in a jail will solve that, right?
 

EvanVanVan

Patron
Joined
Feb 1, 2014
Messages
211
As you noticed the Plex port for jails is updated much more often, and also has a specific plex-pass version. IDK about your problem, but I'm sure you have more control over it going the jail route.
 

ikonspirasi

Cadet
Joined
Apr 3, 2015
Messages
9
Question:

Why would you install Plex in a jail, rather than just use the regular plugin which ships in FreeNAS?
I've just installed Plex via the plugin method and it's not signing in to the plex web site with my account, it's either a routing issue on my NAS (I doubt) or perhaps it's because my newly installed Plugin is out of date (?)

So I figure Plex in a jail will solve that, right?

It might be your router, i'm using Plex from plugin method and it's working flawlesly, i even managed to make the movies downloaded by Couchpotato.
Is your router has UPnP and NAT-PMP feature activated? i'm using PfSense and turned on that feature on the LAN interface.
 

Attachments

  • Screen Shot 2015-04-27 at 2.09.21 AM.png
    Screen Shot 2015-04-27 at 2.09.21 AM.png
    74.1 KB · Views: 323
  • Screen Shot 2015-04-27 at 2.11.08 AM.png
    Screen Shot 2015-04-27 at 2.11.08 AM.png
    133.6 KB · Views: 325

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
I am getting this error:

[root@freenas] ~# cd /usr/ports/ports-mgmt/portupgrade/ && make install clean
/usr/ports/ports-mgmt/portupgrade/: No such file or directory.

What am I doing wrong?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Did you pull down the ports tree using portsnap fetch extract? And also make sure you typed the path correctly.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
I am getting this error:



What am I doing wrong?

I have solved the problem.
The below post should DEFINITELY be included in the first post tutorial? :/
\/\/\/\/\/

Ah yes you are correct... I read it wrong...
First: pkg update & pkg upgrade
Then: portsnap fetch extract (if first time) or portsnap fetch update
Then use the command to Install portupgrade
 

StarkJohan

Explorer
Joined
Mar 27, 2015
Messages
62
I'm having the same log entries repeat twice every five seconds in a "from scratch plex jail". Ipv6 is disabled in the jail settings and in the PMS settings. PMS 0.9.11.17.My server otherwise runs perfectly. RAM issues has been suggested but my 64GB RAM shouldn't be the problem.

<code>WARN - NetworkServiceBrowser: Error sending out discover packet: send_to: Can't assign requested address</code>

This is most likely also causing the repeating log entries below in my FreeNAS logs which would be nice to get rid of as well:

<code>Limiting closed port RST response from 783 to 200 packets/sec</code>

Anyone else having these issues or perhaps a suggestion to get rid of the problem?
Turning off the GDM service solves the problem but I need the GDM as I normally use the plex.tv/web/app to manage my players.
 

JJT211

Patron
Joined
Jul 4, 2014
Messages
323
I'm having the same log entries repeat twice every five seconds in a "from scratch plex jail". Ipv6 is disabled in the jail settings and in the PMS settings. PMS 0.9.11.17.My server otherwise runs perfectly. RAM issues has been suggested but my 64GB RAM shouldn't be the problem.

<code>WARN - NetworkServiceBrowser: Error sending out discover packet: send_to: Can't assign requested address</code>

This is most likely also causing the repeating log entries below in my FreeNAS logs which would be nice to get rid of as well:

<code>Limiting closed port RST response from 783 to 200 packets/sec</code>

Anyone else having these issues or perhaps a suggestion to get rid of the problem?
Turning off the GDM service solves the problem but I need the GDM as I normally use the plex.tv/web/app to manage my players.

Check ports are opened

I found this from a 5 min google search

LIMITING CLOSED PORT RST REPONSE
One of the nifty things about FreeBSD’s kernel is that it will limit closed port RST responses, which, in layman’s terms, just means that if someone repeatedly hits a port that’s closed, the kernel won’t respond to all of the requests.

https://forums.freenas.org/index.php?threads/plex-and-limiting-closed-port-rst-response.16046/
https://major.io/2007/06/06/freebsd-limiting-closed-port-rst-response/
 

StarkJohan

Explorer
Joined
Mar 27, 2015
Messages
62
Yeah, I found those links too but they don't really answer the question or solve the issue. The errors can be suppressed with "net.inet.tcp.blackhole", that's not addressing the real issue. I understand that some ports (most likely the GDM network discovery ports UDP 32410, 32412, 32413, 32414) is "flooded" with requests and that is what is expressed in the logs. I can't figure out how to confirm the port numbers that the error springs from though? They aren't logged as far as I can see.

Can Plex GDM service be "pounding it's own ports"? Plex seems to be bound to all the correct ports according to sockstat. I'm not sure what you mean by "check ports are open".

Here's some info on the Plex ports: https://support.plex.tv/hc/en-us/ar...ports-do-I-need-to-allow-through-my-firewall-
 

JJT211

Patron
Joined
Jul 4, 2014
Messages
323
My bad, didnt read the entire post before I shot off to do a search. I've had the same error previously but it disappeared within a few days before I could put any serious thought into it.

And yea I agree you shouldnt suppress with that blackhole command which is why I didnt quote it. I just thought the definition would at least be a good starting point.

Anyways, you should create a separate thread, especially since you're able to pinpoint the cause. The plex forum would prob be better though.

EDIT: Actually, I take that back, I see where you're at now, it actually may be a FreeNAS issue.

Note: This article is discussing ports in the local firewall of the computer running Plex Media Server. This is not discussing ports on a router.
 
Last edited:

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
@Cosmo_Kramer - any advice on how to setup a torrent client i.e. transmission manually inside the same jail or is this not advised? I'm asking as I would liek to keep things together and not have an extra jail for this...
 
Joined
Mar 6, 2014
Messages
686
Should be possible, but I would keep them separate. If something goes wrong with one of the jails, you only might lose and have to redo a small part and not everything. Also you might want t use firewall rules, VPN or whatever for your torrenting. You don't need that for pms
 

JJT211

Patron
Joined
Jul 4, 2014
Messages
323
@Cosmo_Kramer - any advice on how to setup a torrent client i.e. transmission manually inside the same jail or is this not advised? I'm asking as I would liek to keep things together and not have an extra jail for this...
Its makes no sense to combine programs in a jail when there's no benefit of doing so. You're more likely to cause problems. Jails use very little resources as it is, so its strongly recommended you keep them separate.
 
Last edited:

Smithcraft

Dabbler
Joined
May 30, 2015
Messages
24
Hello!

I've been going slightly crazy trying to get Plex set up.

The most recent time, I set up the jail using Rilo Ravestein's method for 9.3.

After setting the group permission(separately, I've tried C_K's method and RR's method), I do the "ls -l /mnt" and I see:

"drwxr-xr-x 2 root wheel 2"

instead of:

"drwxrwx---+ 7 1002 Media 8" (from Cosmo_Kramer's example).

I have this in the etc/group list:

Code:
plex:*:972:  
Media:*:2000:plex


Is there something that I need to reference differently with changing the group permission? Is there any substantial problem from just using chmod?

SC
 
Last edited:
Top