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

jetter555

Cadet
Joined
Feb 6, 2018
Messages
5
I added a new library to Plex using a different name and pointed it to the same directory I was using before and this time the new
shows appeared in plex, but not the ones that were in original library. Could it be a rights issue with plex itself? maybe not having rights to the database or something?
 

Kingr_

Dabbler
Joined
Sep 3, 2013
Messages
20
I followed the guide and thought I had everything set up correctly until I copied some new tv shows into one of the folders I had setup in Plex.
Plex does not detect any new shows that I copy to it. It seems like a permissions issue, but when I ssh into the jail, the new files have the same
permissions as the ones currently in that folder. If it is a permissions issue, im not sure where to modify them. In the plex jail itself? in the freenas dataset? on the cifs share? Anyone have any ideas?

This may seem basic, and I hope it solves your problem. If not I apologize for this noob post.

index.php
 

Attachments

  • Untitled.png
    Untitled.png
    357.6 KB · Views: 1,048

ThreeDee

Guru
Joined
Jun 13, 2013
Messages
698
I followed the guide and thought I had everything set up correctly until I copied some new tv shows into one of the folders I had setup in Plex.
Plex does not detect any new shows that I copy to it. It seems like a permissions issue, but when I ssh into the jail, the new files have the same
permissions as the ones currently in that folder. If it is a permissions issue, im not sure where to modify them. In the plex jail itself? in the freenas dataset? on the cifs share? Anyone have any ideas?

Might not be your issue, but are the shows named correctly for tv shows? ie .. whatevershow-S01E01.mkv ... I have had tv shows not show up because I didn't have them named correctly as tv shows.

https://support.plex.tv/articles/200220687-naming-series-season-based-tv-shows/
 
Joined
Apr 13, 2018
Messages
5
Hi everyone,

I am currently experiencing some issues with installing Plex on Freenas 11.1.

First I installed Plex via the UI and it created its "plexmediaserver_1" jail, but I didn't like not controlling this naming so I started it over with this tutorial. Not sure if I made a mistake, but I ran it in this very same "plexmediaserver_1" jail and it worked (Plex available at the expected url).
Then I uninstalled the plugin and therefore the "plexmediaserver_1" jail got deleted and I started the process from scratch on a very new "jails" root and inside a new "plexJail" for Plex, created with a plugin template from http://download.freenas.org/jails/11/x64/ .

But I basically cannot even update the packages and keep bumping into :
Code:
pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sq
lite) failed: No such file or directory										
pkg: http://pkg.FreeBSD.org/freebsd:11:x86:32/latest/meta.txz: No address record
repository FreeBSD has no meta file, using default settings					
pkg: http://pkg.FreeBSD.org/freebsd:11:x86:32/latest/packagesite.txz: No address
 record																		
Unable to update repository FreeBSD											 


I made a clean reinstall of the OS and reimported the volume, nothing changed.
I also tried to reinstall the plugin via UI but now it does not even want to start

Searching on the forum brings me back here to post #388 and #385 by scottmaverick but does not help (I think).

I could use some help here !
Thank you in advance
 
Last edited:
Joined
Apr 13, 2018
Messages
5
Thanks for the tutorial by the way, too obvious to say ! Very helpful and clear.

In my case so I did make a DNS mistake in the config. A bit too optimistic I guess. But it worked in the end.
I also modified /usr/local/etc/pkg/repos/FreeBSD.conf based on the following post too modify in the jail, but I may rollback to previous config.
https://forums.freebsd.org/threads/cannot-use-pkg-after-v11-upgrade.62618/

In the meantime I gathered several URLs with related info that could be useful for someone, who knows
- related to /etc/resolv.conf
https://forums.freebsd.org/threads/pkg-repository-error.61903/
https://www.freebsd.org/doc/handbook/configtuning-configfiles.html
https://redmine.ixsystems.com/issues/3758

- pkg and DNS
https://forums.freenas.org/index.php?threads/pkg-install-errors-in-jail.35350/
https://forums.freenas.org/index.php?threads/freenas-updated-to-11-cannot-update-repository.56558/

I still could not do 1 thing in the tutorial, which is the workaround the user and user group for the mount ... working on it but I can't seem to make pw usermod do what it is supposed to do (no changes at all) in the userId/GroupId

Cheers
 
Last edited:

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Thanks for the tutorial by the way, too obvious to say ! Very helpful and clear.

In my case so I did make a DNS mistake in the config. A bit too optimistic I guess. But it worked in the end.
I also modified /usr/local/etc/pkg/repos/FreeBSD.conf based on the following post too modify in the jail, but I may rollback to previous config.
https://forums.freebsd.org/threads/cannot-use-pkg-after-v11-upgrade.62618/

In the meantime I gathered several URLs with related info that could be useful for someone, who knows
- related to /etc/resolv.conf
https://forums.freebsd.org/threads/pkg-repository-error.61903/
https://www.freebsd.org/doc/handbook/configtuning-configfiles.html
https://redmine.ixsystems.com/issues/3758

- pkg and DNS
https://forums.freenas.org/index.php?threads/pkg-install-errors-in-jail.35350/
https://forums.freenas.org/index.php?threads/freenas-updated-to-11-cannot-update-repository.56558/

I still could not do 1 thing in the tutorial, which is the workaround the user and user group for the mount ... working on it but I can't seem to make pw usermod do what it is supposed to do (no changes at all) in the userId/GroupId

Cheers
These are old posts that refer to issues around Warden jails. I don't think it would be wise for someone to follow them if they don't know what they are doing. Especially since Warden has been replaced by iocage in new versions of FreeNAS.

It would be better to learn how to use iocage.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
Especially since Warden has been replaced by iocage in new versions of FreeNAS.
I'd probably say "is being replaced" rather than "has been replaced", but I'd agree with your recommendation--especially since there isn't a warden template for FreeBSD 11.1, and 11.0 has been EOL'd. The problem is that iocage networking is broken in 11.1-U3 and -U4.
 
Joined
Apr 13, 2018
Messages
5
These are old posts that refer to issues around Warden jails. I don't think it would be wise for someone to follow them if they don't know what they are doing. Especially since Warden has been replaced by iocage in new versions of FreeNAS.

It would be better to learn how to use iocage.

Fair point, maybe the links could be confusing.
I assume that creating Jail storage via the UI is using the warden, but how "deprecated" is it compared to iocage, what's the LTS?
 

zvans18

Dabbler
Joined
Sep 6, 2016
Messages
23
Doing everything but starting the service last gives me a perfectly functional server, but it breaks with a reboot. Service is running and network+dns resolution are fine, but plex web says it's unreachable and local ip isn't connecting

I know I probably should learn iocage cli, but my network is just complicated enough and I'm just dumb enough for the broken networking workaround to not be viable.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Fair point, maybe the links could be confusing.
I assume that creating Jail storage via the UI is using the warden, but how "deprecated" is it compared to iocage, what's the LTS?
For the last couple of releases, the FreeNAS legacy GUI has shown Warden jails and the new beta GUI has shown iocage jails. The problem with Warden jails is that they are no longer being updated. Existing Warden jails continue to work OK, but don't expect updates. Most home users don't really need the latest versions of things like Plex anyway.

I'd probably say "is being replaced" rather than "has been replaced", but I'd agree with your recommendation--especially since there isn't a warden template for FreeBSD 11.1, and 11.0 has been EOL'd. The problem is that iocage networking is broken in 11.1-U3 and -U4.
Fair point. Iocage is not completely ready for prime time. I skipped 11.1u3 and went directly to 11.1u4. The version of iocage in 11.1u4 is v1 Alpha, so it is an early release. I don't have much confidence in the beta GUI yet, so I created an iocage jail for Plex using the CLI. So far, no problems at all. I can see the jail from the new GUI, which is nice, but I don't do any administration there.

For someone who might be inclined to learn about jails, I see no problem with trying to create an iocage jail via CLI. There are some tutorials out there that explain how to do this, just be certain to follow a recent one. Be wary of old posts that have been resurrected because someone added a comment (check the date of the actual posts, not just the latest post.)
 
Joined
Apr 13, 2018
Messages
5
Thank you for these details, appreciate :)

I was not sure but from what you explain, now I am : the iocage thingy is available more natively from the new UI, which I don't dig too much ... good for some sections, but a bit "overkill" for what I really want to access/see quick. Anyway, I'll have a look there, and on the CLI install too.

Do you know when iocage will be fully implemented ?
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
iocage was targeted for 11.2. If you want to wait for full support via the GUI, then wait for 11.2. Unfortunately, we don't know when 11.2 will be released.

I decided to learn about jails, and the best way to do that is to create one by hand... play with the options... and learn from what happens when you change things. The good news is that messing up a jail doesn't mess up your entire system.
 
Joined
Apr 13, 2018
Messages
5
Ok I will have a look on a manual approach to Jail and iocage. And may come back here to share the results !
Cheers
 

badogski29

Dabbler
Joined
Nov 4, 2016
Messages
16
Hi!

So I recently got plexpass, it seems like i have to update my jail to a plexpass install instead of the regular one. Is there a guide for it?
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
You cannot update a Plex install to a Plexpass install. You need to make a new installation. I would suggest you create a new jail and install Plexpass into it. You can keep both jails for a while, just make certain the IP addresses do not conflict. You can stop the Plex service and it won't take any resources. If you do not want to rebuild your library from scratch, you can find advice on the Plex forum for moving a copy of the library to the new Plexpass install.

After the new Plexpass setup is working well, you can delete the old Plex install and its jail.
 

JJT211

Patron
Joined
Jul 4, 2014
Messages
323
Anyone having problems deleting media from the Plex client UI? When I try to delete using icon I get this message "Unable to delete media. Please check your file permissions"

I used to be able to do this with my old Plex warden jail but can no longer do it since ive gone to an iocage jail installation. I definitely have "Allow media deletion" checked in the server settings. I tried setting 777 permissions on my media shares but im still getting the same message. I think it has something to do with the permissions inside of the actual Plex jail but I know from the past that you need to be careful with permissions inside of jails.

Anyone have any ideas?
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
When you mounted the data folders in your jail, did you mount them as read-only, or read-write? That could make a difference.
 

Grewterd

Dabbler
Joined
Nov 30, 2015
Messages
31
Hello, I'm lost and wondered if someone could point me in the right direction.

Following the instructions on the first post, I have a jail setup with a dataset attached to the jail. I have this in /media/Plex.

ls -l /media gives me this:
Code:
drwxr-xr-x   2   nobody   wheel   2 may   5 10:54   Plex

No group numbers.

I've tried adding the plex user to wheel: pw usermod plex +G plex,wheel, restarted the service, no write access.

I'm just not sure how to proceed, not sure what to search for. I also do not want to mess up CIFS permissions on my actual TV show dataset so this is on a test jail and a test dataset. Any assistance is appreciated.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Hello, I'm lost and wondered if someone could point me in the right direction.

Following the instructions on the first post, I have a jail setup with a dataset attached to the jail. I have this in /media/Plex.
This is a very old thread and the first post is obsolete. It sets up a Warden jail, for which support and updates have been dropped. The Warden jail manager is going away.

You would be much better off creating an iocage jail and installing Plex or Plexpass there. If you search, you can find some instructions for doing this. I have posted on this topic, including how to mount data into the jail.

You can leave the warden jail on your system for now (and remove it later). It won't hurt anything - just make certain the IP address for your new jail does not conflict with the IP address assigned to the old jail.

Good luck.
 

hernanbozzano

Dabbler
Joined
Aug 3, 2018
Messages
15
How To Install Plex in a FreeNAS 11.0 Jail:

First off, navigate to your FreeNAS WebUI in your browser.

Next, click on the "Jails" button on the top bar, and then click on the "Configuration" tab.

From there, select a "Jail Root" that is suitable to where you want your jails to be stored. Then click on "Advanced Mode" to expose the network settings. Then fill in the network settings to match your environment. Then click on "Save".

Next, click on the "Jails" tab and then click on the "Add Jails" button.
From there, a window will popup with options to configure your jail. Click on "Advanced Mode".

Then select the following options:
Jail Name: plex
IPv4 Address: 192.168.x.x (Anything that isn't taken and isn't in your DHCP scope)
Autostart: Checked (default)
VIMAGE: Checked (default)


Then click "Ok".
For more information on creating jails in FreeNAS, visit: http://doc.freenas.org/11/jails.html#adding-jails


Once the jail is created, navigate to a shell prompt, either through the FreeNAS WebUI Shell or via SSH.
Once at a shell prompt, view the currently installed jails with the following command:

jls

You should see something like this:

Code:
JID  IP Address	  Hostname					  Path
1	-			   plex						  /mnt/Jails/plex


In this case, the plex jail has a JID of 1, so to get a shell prompt in the jail, use the following command:
jexec 1 tcsh

Next, to update the jail's packages, run the following command:
pkg update && pkg upgrade -y

Now, to install Plex, run the following command:
pkg install multimedia/plexmediaserver -y

Once that is complete, you need to setup Plex to start automatically when the jail starts with the following command:
sysrc plexmediaserver_enable=YES

Next, start Plex with the following command:
service plexmediaserver start

Plex is now ready to use and you can navigate to it with this URL:
http://192.168.x.x:32400/web

Once you tie a Plex account with your server, you will be able to access Plex internally and externally via:
https://plex.tv/web



Accessing Mounted Storage In Your Jail With Plex:
To add storage to your FreeNAS Jail, start by following this documentation: http://doc.freenas.org/9.10/jails.html#add-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:
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, run the following command (where 1001 is the GroupID):
pw groupadd Media -g 1001 && pw usermod plex -G plex,Media

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

Now, you should see the following instead:
Code:
drwxrwx---+  4 root  Media   4 Feb 21  2014 Media


when i

Finally, restart Plex:
service plexmediaserver restart

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


Upgrading Plex:

When new releases of Plex come out, you may update without losing your data and preferences. To check if a new release of Plex is available, visit this page:
http://www.freshports.org/multimedia/plexmediaserver/

First off, stop Plex with the following command:
service plexmediaserver stop

To actually update Plex, run the following command:
pkg update && pkg upgrade multimedia/plexmediaserver

Lastly, start Plex again with the following command:
service plexmediaserver start

first of all, i want to thank you for the job you've done with this tutorial. it really helps.

however, im having problems folliwing it: when i run the "jls" command it shows nothing at all.

do you have any idea what could be wrong?
 

Attachments

  • Captura.JPG
    Captura.JPG
    14.2 KB · Views: 398
Top