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

R.G.

Explorer
Joined
Sep 11, 2011
Messages
96
@ trey: I think you have to manually delete the jail as well. I wound up deleting and reinstalling several combinations of jail and plex last night. I had to manually do deletions.

But on another front. I gave up on manually installing in a jail of my own making, and went with the GUI plugin install. This appeared to work fine ... until I tried to start it. It will not start. The incredibly lucid message appeared: "Some error occurred.".

OK back to research. Dsiminiuk's post helped: you have to manually go tinker about with adding users and groups outside the jail that match the users and groups created by the plugin process inside the jail before the user inside the jail can access storage that you add to the jail. Then you need to manually tinker the permissions on the external datasets to let the matching users/groups access the dataset. Sure, a person who is experienced and current with *n*xes would expect this to be the case. But coming to it fresh and trying to get this to work if you don't work with similar operating systems makes this difficult to find.
https://forums.freenas.org/index.php?members/dsiminiuk.29062/
IMHO, the plugin process needs a warning in the GUI plugin install pointing to the need for creating users and groups matching those inside the plugin. It would sure help with us folks who don't deal with this daily. The GUI's appearance of just doing the work without actually letting anything happen is very confusing. It ought to at least tell you it's not doing all the work and that some additional assembly is required, as well as batteries not being included.

I went through several variations of that during the research, got matching internal and external users set up, and then manually tinkered the permissions.

However, the plex media server in the plugin still will not start.

Still working.
 

R.G.

Explorer
Joined
Sep 11, 2011
Messages
96
OK. Got it working. What's needed is
(1) Do the plugin install per the recommendations
(2) Create matching users and groups inside and outside the jail; the simplest way is to create the default user from inside the jail in the outside FreeNAS, to my mind at least.
(3) Modify the access permissions to the outside-the-jail storage that you intend to make accessible inside the jail so the inside+outside user/group can access it.
(4) Actually assign the external storage datasets to the jails for access.
(5) Get the networking working. This requires digging through the FreeNAS networking documentation AND the FreeNAS Jails documentation in some detail. Particularly on the checking and unchecking of VIMAGE and NAT boxes, and reading up on the bug reports involving VIMAGE and promiscuous mode and whether or not you need to do one or the other. Tricky.
(6) Get the outside LAN restrictions backed off to where the Plex server can access through the external LAN. This is not as obvious (to me at least) as it seems. The final change after all of the above that got mine working was to find that the external LAN's mask was one bit too restrictive.

The more seasoned readers here will say "well, sure, you have to get all that stuff done..." in a slightly exasperated voice, choking back a chuckle. But it is not obvious to people who don't work with this particular system all the time. I'm posting this to leave bread crumbs for people who are mystified after me.

This all reminds me uncomfortably of my quest to get wake-on-LAN running for FreeNAS, and finding that there is a long chain of subtle and ill-documented requirements - including in that case having a compatible POWER SUPPLY already installed in the computer involved. o_O
 

Tim W

Cadet
Joined
Mar 19, 2015
Messages
1
OK. Got it working. What's needed is
<Snip>
The more seasoned readers here will say "well, sure, you have to get all that stuff done..." in a slightly exasperated voice, choking back a chuckle. But it is not obvious to people who don't work with this particular system all the time. I'm posting this to leave bread crumbs for people who are mystified after me.
<Snip>

Step 4 for 9.3 seems to be here: despite all the broken links http://doc.freenas.org/9.3/freenas_jails.html#add-storage

Any chance you can write that up for the of steps 5 and 6?

Thanks,
TimW
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I followed the updated guide last night to create a new jail for running plexmediaserver-plexpass as I was interested to have a look at the new transcoder and optimisation functionality.

Took less than 10 minutes to create using the pkg method, and about another 5 hours to scan my /mnt/pool/media folder :D

Having a problem with the optimisation functionality though, as it effectively creates a new version of the file and saves it with the original, and it clearly doesn't like the permissions I have on the /mnt/pool/media folder which as set as the user (me) I use to access the share to add new media.

Any idea what the PMS tries to use and how do I configure that in FreeNAS so that I can continue to add media through the AFP share and PMS can create the optimised files?

Update:

I've resolved this by creating a new folder in /mnt/pool/media/films called "Plex Versions" and changing the owner/group to "plex:plex", then changing PMS server settings for Optimisation to /media/films folder.
 
Last edited:

RichTJ99

Patron
Joined
Sep 12, 2013
Messages
384
So for someone just getting started in freenas - is it better to read up and do everything manually? This last page seems to have plenty of info
 
Joined
Apr 9, 2015
Messages
1,258
So for someone just getting started in freenas - is it better to read up and do everything manually? This last page seems to have plenty of info

It depends on how inclined you are to learn. The greatest thing about the jail system is if you mess up you can trash the jail and start over. You could do that hundreds of times till you figure it out or finally give up.

The advantage of the Plugin system is that you don't have to think, it's "Oh, I want to try that." click, wait, done, and it will generally work but you have to wait for someone else to update the information so you will usually be behind. If you install the jail then you get to decide when to update but it is a little bit more work.

A lot of us started off with the plugin system and then saw the light of being able to update whenever something is available without complicated scripts.

So if you can follow the instructions to cook a recipe, fix a car, work on a house, or build a computer it should be simple enough to install something into a jail after a try or two. Later on you will be able to use the skills you learned to do other things like install a webserver with a CMS or install a linux VM and a gameserver for CS:S so you can kill some bots or have a lan party.
 

RichTJ99

Patron
Joined
Sep 12, 2013
Messages
384
I can certainly follow instructions though I would want to understand how it works in the event of later troubleshooting.

Which instructions did you follow? The ones on page 1 or elsewhere?
 
Joined
Apr 9, 2015
Messages
1,258
Pretty much the ones on page one. The only difference is I install the plexmediaserver-plexpass version which is just slightly newer but works just fine.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231

SoonerLater

Explorer
Joined
Mar 7, 2013
Messages
80
I'm trying to following the instructions in the 1st post... I have gotten to this part of the instructions:

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:
Code (text):
  1. 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.

I've added two storage locations:
Freenas_3_zpsuropq9t5.jpg


However when I run the ls -l command, I don't see quite the same information returned
Freenas_4_zpsf5vt8plf.jpg

as the example given in the tutorial
Freenas_5_zpszb1rbcyr.jpg

And if I use the command ls - /mnt I get nothing.
Freenas_6_zpsf94s2uf6.jpg


I'm not sure whether I've done something wrong or whether the output of the ls command has changed between the FreeNAS version that @Cosmo_Kramer was using when he wrote his guide and the version that I'm using (9.3).
 
Joined
Apr 9, 2015
Messages
1,258
Your mounting the files in the /media directory not the /mnt directory

If you wanted the movies and tv to be in the /mnt/media folder you would change the destination to /mnt/media/plexmovies and /mnt/media/plextv

You can mount a directory to ANY directory it does not automatically cause it to be mounted in the /mnt directory

It also looks like you went into the jail and manually created the directories that is why the user is root and the group is wheel.

Simply put you're trying to overthink things. Go into your plex and set the movies directory to /media/plexmovies and let it load.
 

Apolitosz

Cadet
Joined
Oct 31, 2015
Messages
5
First of all, thanks for the useful guide.

Quick question though: is there a relatively easy way of switching to multimedia/plexmediaserver-plexpass from multimedia/plexmediaserver? I noticed that even the service name is different, but I thought I might ask

Thanks
 
Joined
Apr 9, 2015
Messages
1,258
Install the other one in a new jail and then just copy the settings and database over into the new one. Verify everything is working as it should be and then shut down/remove the old one. You would have to do this via command line either outside of the jails or add a storage point to each jail and copy out of the one and into the other.

Even though the "plexpass" version is meant for plexpass holders it seems to work fine even if you don't have an actual plexpass just that the features that would require it do not work same as the non plexpass version.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I was going to suggest the same approach as above, given how easy it is to install plex in a jail using pkg install. I recently did exactly the same thing before Christmas to test some of the new features in 0.9.14.0, although I didn't remove the old jail, I removed the PlexPass one I'd just created.

Unless there is something in a PlexPass release that you really really need, my advice would be to stick with the standard releases and just get the new functionality as it's released, which is usually less than a couple of months (0.9.14.6 is now the latest standard release). The Plex forum is full of people complaining about what is in effect pre-release beta versions under the banner of PlexPass.
 

Apolitosz

Cadet
Joined
Oct 31, 2015
Messages
5
thanks guys for the tip. Maybe I will stick with the normal release channel. A like running the last version from any software I have and the plexpass version being a month or so ahead was compelling but if that version is this buggy I will just stick with the main channel. Thanks again!
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
I've been using the plexpass version for quite some time. Not sure when the last time I ran an update was, but I am currently on (0.9.12.18). It says there is an update available in the Plex Web GUI. I've tried running portsnap/portupgrade, or whatever other upgrade commands I could find on here and it doesn't seem to be working.

Update: A little more fiddling and I got it to work. Followed the original instructions and it didn't work, but after omitting the multimedia/plexmediaserver from the command it seemed to pull the latest update (0.9.15.0). It says there is an update available even after the upgrade, but I'm guessing the newest version is not available yet.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
The FreeBSD version of PMS always says there is an update available, even when you have the latest version!

Looks like you did well to avoid the 0.9.14.x versions :D
 

depayns

Cadet
Joined
Dec 9, 2015
Messages
1
Hi guys,
Silly question, but where so you store your personnal Plex profiles, as opposed to the generic ones provided by default ?
 

TheDubiousDubber

Contributor
Joined
Sep 11, 2014
Messages
193
Your mounting the files in the /media directory not the /mnt directory

If you wanted the movies and tv to be in the /mnt/media folder you would change the destination to /mnt/media/plexmovies and /mnt/media/plextv

You can mount a directory to ANY directory it does not automatically cause it to be mounted in the /mnt directory

It also looks like you went into the jail and manually created the directories that is why the user is root and the group is wheel.

Simply put you're trying to overthink things. Go into your plex and set the movies directory to /media/plexmovies and let it load.

I have some of the same issues seen in post #170 and I'm afraid those suggestions are too vague to be of any help. I have created the source destination using the add storage button under jails. I'm not sure how you're supposed to add storage to a jail without it being user root and group wheel. I'm not sure what you mean by going into the jail and manually creating the directories. I used the GUI to add storage and the result is the same. So the issue remains, according to this guide I should see something similar to:

Code:
drwxrwx---+ 7 1002 1001 8 Mar 3 18:35 Media


but instead I see something like this:

Code:
drwxrwxrwx 2 root wheel 2 Jan 2016 08:24 plexmovies
drwxrwxrwx 2 root wheel 2 Jan 2016 08:24 plexmusic
drwxrwxrwx 2 root wheel 2 Jan 2016 08:24 plextv


Given that the rest of the guide does not make sense since the next command is based on the output being the same as the example, I'm not sure how to proceed.
 
Top