Jump to content

FreeNAS - Emby Library Access Jail


Blackie

Recommended Posts

Blackie

Very much a NOOB. I am trying out Emby and Plex on a FreeNAS setup. I used the new Emby plugin (thank you!)

 

Everything runs except:

  

With Emby I can only put SMB shares for Windows into the Library:  \\FREENAS\FN-Media\Movies

Yet with Plex I can put the jail folders into its libraries: \\FreeNAS\jails\plex\Movies

 

I understand this is not correct and I should be putting the Emby jail folders into its libraries.

\\FREENAS\FN-Media\Movies

\\192.168.1.219\jails\emby_1\Movies  

Also tried using // vice \ since I am on windows.

 

When I try this I get:  "There was an error adding the media path. Please ensure path is valid and Emby Server Process has access to that location"

 

The jail folders are owned by user root, group wheel.  I have made a user emby and assigned it to the group wheel. This user has the same ID as the user emby inside the jail (983).

 

Can't find the solution to this in any post I have seen.

Edited by Blackie
Link to comment
Share on other sites

josh4trunks

When you say "new Emby plugin", do you mean the FreeNAS 9.X version or is this for FreeNAS 11?

 

Can you show a screenshot of your Jails > Storage tab, and Shares > Windows (SMB) tab.

 

Creating a user in the FreeNAS userland, and adding it into a group has no affect on whether that user can use group permissions in a jail. Group databases are not shared from the FreeNAS host, and different jails.

https://forums.freenas.org/index.php?threads/how-to-giving-plugins-write-permissions-to-your-data.27273/

  • Like 1
Link to comment
Share on other sites

PhilWhite

Very much a NOOB. I am trying out Emby and Plex on a FreeNAS setup. I used the new Emby plugin (thank you!)

 

Everything runs except:

  

With Emby I can only put SMB shares for Windows into the Library:  \\FREENAS\FN-Media\Movies

Yet with Plex I can put the jail folders into its libraries: \\FreeNAS\jails\plex\Movies

 

I understand this is not correct and I should be putting the Emby jail folders into its libraries.

\\FREENAS\FN-Media\Movies

\\192.168.1.219\jails\emby_1\Movies  

Also tried using // vice \ since I am on windows.

 

When I try this I get:  "There was an error adding the media path. Please ensure path is valid and Emby Server Process has access to that location"

 

The jail folders are owned by user root, group wheel.  I have made a user emby and assigned it to the group wheel. This user has the same ID as the user emby inside the jail (983).

 

Can't find the solution to this in any post I have seen.

 

Josh knows much, much more about this than me, but the path for Emby above looks like a correct path substitution for a share called FN-Media.

 

When you added storage to the jail -- should be the second selection at the bottom of the page when you click on/highlight the jail -- what did you enter as your source and destination?.  Within the Emby plugin the direct path for your media in Freenas should be /(whatever you chose for your destination)/Movies for access to your movies.

 

So, for instance, if you have all of your media in a folder called Media, you would typically browse to a source something like mnt/[your volume]/Media and then you can choose a destination like /media.  You would then access everything in Emby through /media -- which should give you access to individual folders like Movies, Music, etc. if you have everything set up in individual folders that way.

 

You can, then, provide a path substitution for better access for certain apps, like Kodi, that look like the paths you mentioned above -- \\FREENAS\FN-Media\Movies (for Movies) if you choose.  The initial path, however, before adding a path substitution, should begin with /(whatever you entered as destination when you added storage).

  • Like 1
Link to comment
Share on other sites

Blackie

Hi, late replies I went to bed. Plus took some time to do the attachments.

 

The plug-in I was giving thanks for is Emby for FreeNAS 11

3.2.25.0 emby-3.2.25.0-amd64

Attached the jails/storage and the smb shares.  post-231827-0-20324300-1502215906_thumb.jpgpost-231827-0-82673400-1502215916_thumb.jpgpost-231827-0-11822800-1502216945_thumb.jpg

 

Ok, now understand the jail usrs/groups are inside each jail only.

 

Same setup for Plex and Emby.  Would prefer to just drop Plex since Emby seems to be just what I want.

 

Change: Last jpg shows the lib I am using in Emby.  Will still not take the jail storage as a library in Emby.

Edited by Blackie
Link to comment
Share on other sites

PhilWhite

Hi, late replies I went to bed. Plus took some time to do the attachments.

 

The plug-in I was giving thanks for is Emby for FreeNAS 11

3.2.25.0 emby-3.2.25.0-amd64

Attached the jails/storage and the smb shares.  attachicon.gifSMB Shares.jpgattachicon.gifJail-Storage.jpgattachicon.gifEmby Lib.jpg

 

Ok, now understand the jail usrs/groups are inside each jail only.

 

Same setup for Plex and Emby.  Would prefer to just drip Plex since Emby seems to be just what I want.

 

Change: Last jpg shows the lib I am using in Emby.  Will still not take the jail storage as a library in Emby.

 

It's a little more complicated than you need to set up Emby (or Plex), but could work.  Personally, I would redo the storage in your jail so that you just point to /media.  You can then direct the particular media subcategories within Emby (and also within Plex).  So, if you go back and destroy the storage (as long as you have a separate dataset branching off your primary volume), you should be fine and not lose anything.  You could just use /mnt/(your volume)/Media as your source (or if your volume is called Media, then just use /mnt/Media/Media as your source).  Then use /media as your destination.

 

Then when you want to add Movies to Emby, for the path click on / and choose media.  That should give you several options, including Movies, Music, etc.  It looks like TV will probably need to follow a different path.  With /media, for Movies, choose your Movies folder and that should give you a good path for access to movies.  For music, click on / then media, then Music -- which should give you a good path to your music.  And all others following the same rubric.

 

Plex can be set up in the same manner.

 

The full path does include the jail, but you won't see it when you set things up in Emby.  The full path runs /mnt/(your volume)/Dataset/jails/emby_1 (if that is the name of your jail)/media (if you choose that for your path)/Movies, Music, etc.

 

If you decide to destroy the storage for your jails, then make sure that the jail is turned off.  You might find it difficult to destroy jail storage with the jail running.  You won't need to destroy any actual data or the jail or plugin, but you might find it easier if the storage you add to your jail is one level up (instead of /media/Movies, just point to /media).

 

After you create those paths, if you want to use path substitution, you could add another path out of your jail for others to use outside of your network (if that is what you want).  That path would look like the ones you originally created -- \\FREENAS (or the ip address of your freenas box)\share\Movies, etc.

  • Like 1
Link to comment
Share on other sites

Blackie

Thanks for the help.  I will cut it all up and retry it just the way you suggest.

 

Still a little confused where the Plex player does point to the jails while the Emby player does not.  However, I am hoping the change to the way you suggest will fix this.  

 

By just pointing to media I am guessing you mean in the destination should point just to media when setting up the jail. Not the source just pointing to media. 

Having the source and the destination point to /media.  Then letting the player choose the library.

 

Nicely confusing. No.

 

Will let you know.

 

BTW, I just restarted FreeNAS and neither Plex or Emby will restart so they will get loaded again anyway.  That though is a FreeNAS not an Emby thing.

 

Cheers

---------------------------------------------------------------------------------------

Ok, I got it.  It now allows me to go to "/" and choose media/music etc.  The only thing Emby will not do is let go of the SMB shares.  Can not get it to delete them.  I am going to see if I can turn off the shares without destroying the and then maybe Emby will release them.

 

BTW I guess I was just working to hard here.  Much easier your Way!!

 

Thanks very much. Phil!

Edited by Blackie
Link to comment
Share on other sites

Blackie

Phil, still uncertain about the source and destination and where each should point.

 

Thinking that I should have the source pointed at the correct source such as /media/Movies and the jail just point to /media. And then in Emby choosing / , media, and the correct folder I made inside of the jail.  I.E. /media/Movies.

 

As the saying goes:  I am soooo confused. 

Edited by Blackie
Link to comment
Share on other sites

PhilWhite

The source should be mnt/Volume/Dataset -- so it will run from where you mounted your volume originally in Freenas.  Freenas creates a dataset associated with the volume that you originally created (when you first set up Freenas), from what I recall.  So source is mnt/Volume name/Dataset name (presumably Media?) -- it depends on what you called it, but this will be the folder/directory where all your media files are stored.  

 

The destination can be anything you want that is in the jail, but /media is empty to begin with and is a great place to mount the folders from your source.  What I gather the jail does is take the data that you have in your volume/dataset and remounts it where you want so that you can use it in your plugins within the jail.  /media is just an easy and logical place to do it.  The jail is essentially a small virtual machine that allows the plugin to run in a 'safe' environment.  But, since it is 'separate' from the main operating system, you have to remount the Freenas data somewhere in the jail -- sort of like a symlink.  That is what you do when you fix a destination.  If you destroy the jail or plugin or the remount point in the jail your data will still be safe, since you still have the original volume/dataset that you created in Freenas.

 

It's been a while since I played with Plex, but I recall its setup being fairly similar to Emby.  It might be that Plex prefers full path names, I just don't recall.  Emby does use jails in the full path, but it isn't necessary to specify the full path when you set it up.  There is a 'new' path from the mount point in the jail, and that is all you need to specify.

 

So, it sounds like you have things set up properly.  It looked like you called your dataset associated with your volume Media.  So, yes, for the source you would use mnt/Volume/Media.

 

For destination, again, I would use /media.  You then choose which folders you want to associate with the different 'sections' in Emby from /media.  You could choose another folder/directory in the jail -- like etc, bin, mnt -- and doing that would mount your media folder there.  But I wouldn't do that because there are plenty of other files and folders in those directories and there is no reason to add new confusion.  I know it sounds confusing to go from /mnt/volume/Media to /media, but that makes the most since. And, more importantly, it works.

 

 

ETA: I'm not entirely sure what you mean by being unable to let go of the smb share.  You should be able to edit the path if you click on the library you created and use whichever path you want.  But you can use the smb share to your advantage as a path substitute.  So, if you set up Movies with a path /media/Movies you can also specify an alternate path \\FREENAS\Sharename\Movies (or smb:\\FREENAS\Sharename\Movies) just under the first path (/media/Movies) and that will work great.  If that is what you are seeing in your library I would just leave it as it is.

 

ETA:  I hope that makes sense.  And Josh, Luke, or anyone please correct me if I have any of this wrong.  I'm still learning how all of it works myself.

Edited by PhilWhite
  • Like 1
Link to comment
Share on other sites

Blackie

Very nice Phil. Thanks.

 

BTW all OBE for me for the moment.  FreeNAS started gettting really slow and then quit.  No reboots, no restarts, etc. would get it going.  At the server it said it was ok but no access.

 

So I get to do all this again.  Will follow your points very closely.  It seemed that I had everything running on Emby when it took the dump so I am hopeful to be there again.

Cheers

Link to comment
Share on other sites

Blackie

Backup up and running.  Emby now sees all my files.  I went back to the source /FNAS/media/Movies  Destination: /jails/media/Movies and it is working fine now.

 

Hopefully, last question on this.

 

I read where the jails for the situation above should be READ ONLY.  Why would we do that?  If so then what does the jail do if it is read only?

 

As I said I am really new to this. Once I see Emby run for me I think I will go Premiere vice paying Plex.

 

BTW I was in the military and heard and said OBE quite a bit.  Example: My plans to paint the house are now OBE.  The house burned down.

Link to comment
Share on other sites

Where did you read that? The server has to be able to save within it's local data folders.

  • Like 1
Link to comment
Share on other sites

PhilWhite

Blackie,

 

Excellent, glad you got it working.  Jails shouldn't be read only -- listen to Luke. The big issue with jails is that you shouldn't change the permissions of the jail once it is created.  The standard permission set is for the owner to have read, write and execute privileges.  The group and others do not have write privileges.  I would leave those permissions as they are.  If you try to change the permissions of the jail, then it will cause problems and the jail won't work properly -- because there are several files that will 'break' in the jail if you try to change permissions.

 

If you want to change permissions for your data, then that is fine.  You can do that from where it is mounted in the jail or you can change the permissions for the dataset associated with your Volume.  That won't cause any problems.  I wouldn't make that read only either, though you might want to restrict permissions for others for safety reasons (make 'others' read only).

Link to comment
Share on other sites

Blackie

Thanks.  Found out about permissions the wrong way.  But I will change the make the jail storage read/write.  

 

With everyone's help everything seems to be working now.

 

Quite a learning experience.  First time with FreeNAS and first time with Emby.

 

Why cool.

 

Thank you everyone!

Link to comment
Share on other sites

  • 3 weeks later...
BetaLeaf

Seems like this is fixed, but I wanted to post for future reference.

 

To add storage to Emby from your FreeNAS Server:

 

1> Create a dataset called "Media". AtTime should be on. Share type should be unix, unless you plan to access your Media from a Windows computer via something like SMB. Owner/group should be media/media and permissions can be set to 770. Check "Set Permissions Recursively" checkbox. (full access to owner and group, no access to everyone else. Probably excessive.) https://doc.freenas.org/11/storage.html#create-dataset AND https://doc.freenas.org/11/storage.html#change-permissions

2> Install the emby plugin on FreeNAS https://doc.freenas.org/11/plugins.html#installing-plugins

3> Attach the dataset "Media" to "/mnt/Media" inside the plugin jail. https://doc.freenas.org/11/jails.html#add-storage

4> Open a shell to your FreeNAS server. https://doc.freenas.org/11/services.html#ssh AND https://doc.freenas.org/11/jails.html#accessing-a-jail-using-ssh

5> Type "jls" and press enter. This command lists all of your jails. Find the one that says emby and make note of its number.

6> Type "jexec # tcsh" and press enter. Replace # with the number you obtain from step 5.

7> Lets update emby while we are here. Type "pkg update && pkg upgrade" and press enter. Then type "pkg install emby-server" and press enter.

8> Type "pw usermod emby -G media" and press enter.

 

If you have done everything correctly, emby should be able to access the media with full read and write permissions.

Edited by BetaLeaf
  • Like 2
Link to comment
Share on other sites

  • 1 year later...
Currypaul

Hi all,

 

I know  the post is a little bit outdated, but I wanted to leave a big THANK YOU to BetaLeaf, Blackie and PhilWhite.

This Thread helped me much.

I also have one additioN.

This also works for group-permissions, also within smb. You just have to create the group first in the emby jail. 

 

5> Type "jls" and press enter. This command lists all of your jails. Find the one that says emby and make note of its number.

6> Type "jexec # tcsh" and press enter. Replace # with the number you obtain from step 5.

8> Type "pw usermod emby -G media" and press enter.

 

If you have done everything correctly, emby should be able to access the media with full read and write permissions.

 

So my addition /correction:

7> Type "pw groupadd series_read -g 1045"

8> Type "pw groupmod series_read -m emby"

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...