Fixes for Most Common FreeNAS Plex Issues

JustinL

Cadet
Joined
Nov 14, 2019
Messages
2
Hey everyone,

It took me absolutely forever to get Plex on FreeNAS up and running properly, and I had to do a lot of digging to find the solutions to my problems, so I wanted to make a quick post to put all of that info in one place. I’m not gonna write out the entire process, as there’s already several guides and videos for that are easy to find – but these particular problems seemed to be very common from what I saw while searching for solutions, and the solutions were buried through a lot of useless suggestions & advice. For the 1 post and 1 video I found with the solutions, I probably read/watched another 50 without any solutions. I'm hoping that the next time someone runs into these problems, they're able to find this post.

I ran into 2 major issues, both of which happened after setting up the plugin/jail:

Issue 1: Plex is unable to find your server
Plex will say “To get started streaming your media everywhere download and install Plex Media Server on the computer or device where you keep your media.”

Solution: Create an SSH tunnel to the Plex Jail (only necessary for the initial setup)
Source: https://www.ixsystems.com/community/threads/plex-cannot-find-a-server.58954/page-2
  1. Open a shell for the jail through the FreeNAS Web GUI
  2. Edit /etc/rc.conf (you can use ee (easy editor) or vi if you're a psychopath), and add the following line anywhere in the file:
    sshd_enable="YES"
  3. Start SSH with the command: service sshd start
  4. Add a user by typing adduser and following the prompts
  5. When you get to the prompt to add your new user to any additional groups, add it to wheel:
    Login group is NewUserThatYouJustCreated. Invite NewUserThatYouJustCreated into other groups? [ ]: wheel
  6. Set the root password so that the new user will be able to use the su command to gain superuser privilege. To set the password, type in passwd and entire your desired password.
  7. Create your tunnel
    1. On OSX or Linux, run the command ssh IP.address.of.server -L 8888:localhost:32400
    2. On Windows, run the above command through a Linux subsystem for Windows, or create the tunnel through Putty by following these instructions: https://www.skyverge.com/blog/how-to-set-up-an-ssh-tunnel-with-putty/
      If going with the latter option, user the following settings: Gateway: IP.address.of.server | Source Port: 8888 | Destination: localhost:32400
  8. Browse to http://localhost:8888/web & you're good to go!

Issue 2: Plex is unable to access your files/mount point
When trying to browse to the folder you've set your mount point in with Plex's file browser, the folder appears grayed out. This happens 1 folder level behind your mount point - eg. if your mount point is /media/folder1, /media is grayed out, and inaccessible.

Solution: Create a new group matching the UID that Plex is looking for
Source:
https://www.youtube.com/watch?v=XUCIhlh6jCM
  1. Open a shell for the jail
  2. In the shell, navigate to 2 folders under where you set your mount point (eg. If your mount point is /media/folder1/folder2, navigate to /media). Run ls -al and take note of the group ID of the folder (folder1 in this example) - this is the third number that appears. In the example output, 1001 is the number you're looking for:
    drwxr-x---+ 2 1000 1001 6 Nov 27 19:55 folder1
  3. Create a new user with a matching UID by typing adduser
  4. Name the user whatever you'd like - I went with plexgroupuser
  5. When prompted for the UID, enter the UID we found above (in this example, 1001)
  6. Leave everything else as default
  7. Add the plex user account to the group (this is a built-in user account, no need to create it). type pw group mod plexgroupuser -m plex
  8. Type id plex to verify that plex was added to the group
  9. If you run ls -al again, it should now show plexgroupuser instead of 1001 for the folder1 group ownership. And now Plex will finally work!

I hope this helps somebody!
Cheers!
 

nbbb

Dabbler
Joined
Oct 1, 2019
Messages
14
Hi,

thanks a lot for this guide. I successfully applied fix #2. I used a streamlined version of it:
pw addgroup whatevergroupname -g <GID> -M plex
is the only command I issued from the plex jail shell. This adds a new group in the jail with whatevergroupname and with a group id <GID> which has to be identical to the gid of the host system group that owns the mounted share. The command also adds the use plex to the group (which is the pre-existing standard user of the plex jail), so plex can get permission to edit the share.

As you have pointed out, the plex user *inside* the jail has to get added to the group with the same gid as the group that owns the mounted directory outside the jail -- nothing has to be done outside of the jail contrary to what is suggested by one of the comments on the how-to .
 
Last edited:

Meftun

Cadet
Joined
Sep 21, 2023
Messages
1
Thank you dude!

The solution helped me to solve the permission issue with mount point with piwigo plugin!
 
Top