Jump to content

FreeNAS plugin


Luke

Recommended Posts

Vidman

Is it possible to have a freenas releases thread that gets updated when a new release has been submitted to the freenas repo? Because it would be nice to be able to get notifications when a update is available seeing as the server itself only notifies of windows releases

Link to comment
Share on other sites

josh4trunks

Is it possible to have a freenas releases thread that gets updated when a new release has been submitted to the freenas repo? Because it would be nice to be able to get notifications when a update is available seeing as the server itself only notifies of windows releases

I would think windows releases happen the same time the source code gets tagged a stable release. whenever this happens I build a new version for freenas and upload it to the repo.

 

so, if you check a day or two after a seeing the notification a freenas plugin update should be available.

Link to comment
Share on other sites

buechling

excuse me.. but i don't get it how to run emby on freenas.. 

 

on your site ( http://emby.media/downloads/nas-server/ ) you post a link to this thread and in this thread a link to the site.. i can not find any guide?

 

what i already did:

install freenas 9.3

install emby plugin ( unfortunately the server crashed at step 6/6 , 86% - i have no idea why )

activate emby plugin

go to emby config ( strange enough - the emby server has a completely different IP ( same dhcp range ) than my freenas -is this correct? )

find dlna-shares on my TV ( but no movies in it )

 

my problem:

emby can not find any harddisks! when i create a media folder, i can select "/mnt/" , but then the folder is empty. i can scan "/" and no media is found!

there is no user or group emby, for which i could change folder permissions..

 

so how can i add my local movies to emby and play them on my TV?

 

thank you

Edited by buechling
Link to comment
Share on other sites

buechling

Ah thank you! That was the missing info..

i saw the button "jails", but it did not mean anything to me.. when i created a folder in jails, i could open the folder in emby

( maybe a guide would be usefull? )

 

so here i have the next problem..

my samsung TV ( 5 years old ) tells me on every file that the "file format is not supported"

transacoding is "auto"

any ideas how to fix that?

Link to comment
Share on other sites

josh4trunks

Ah thank you! That was the missing info..

i saw the button "jails", but it did not mean anything to me.. when i created a folder in jails, i could open the folder in emby

( maybe a guide would be usefull? )

 

so here i have the next problem..

my samsung TV ( 5 years old ) tells me on every file that the "file format is not supported"

transacoding is "auto"

any ideas how to fix that?

As for mounting your media files into a jail; it's documented here. http://doc.freenas.org/9.3/freenas_jails.html#add-storage

 

In my opinion there's no reason to have a guide opn how to do this for Emby because mounting storage applies to the majority of the FreeNAS plugins. But feel free to writeup in the How-To section of the FreeNAS forums if you like.

Link to comment
Share on other sites

buechling

 

so here i have the next problem..

my samsung TV ( 5 years old ) tells me on every file that the "file format is not supported"

transacoding is "auto"

any ideas how to fix that?

 

 

maybe a furter permission problem? a also cannot access jpg-pictures.. i can see all the file names, but not the file content ( on TV and also not in the webinterface.. )

Link to comment
Share on other sites

As for mounting your media files into a jail; it's documented here. http://doc.freenas.org/9.3/freenas_jails.html#add-storage

 

In my opinion there's no reason to have a guide opn how to do this for Emby because mounting storage applies to the majority of the FreeNAS plugins. But feel free to writeup in the How-To section of the FreeNAS forums if you like.

 

Thanks. I'll add that link to our download page. It will probably be helpful.

Link to comment
Share on other sites

josh4trunks

maybe a furter permission problem? a also cannot access jpg-pictures.. i can see all the file names, but not the file content ( on TV and also not in the webinterface.. )

 

To clarify, the earlier issue you had wasn't related to permissions, just mounting storage to a plugin jail.

 

As for the files not being read, maybe the emby user can't read the files? Can you show the output of the below?

ls -l /path/to/media
Link to comment
Share on other sites

buechling

 

To clarify, the earlier issue you had wasn't related to permissions, just mounting storage to a plugin jail.

 

As for the files not being read, maybe the emby user can't read the files? Can you show the output of the below?

ls -l /path/to/media

-rw------- 1 1001 1001 403368265 May 30 22:40 wmv_original.wmv

 

when i do ( in jail )

touch 123

i can see

-rw-r--r-- 1 root 1001 0 May 31 00:07 123

 

i also tried cat /etc/passwd ( in jail )

and see a user "emby"

 

but when i do /etc/passwd ( on shell )

there is no user "emby"

 

can i simply create it?

 

 

 

 

edit:

 

now i can see the pictures when i change the permissions to rwxrwxrwx !

i copied them with ftp, so maybe that was the problem ( rw--------- )

Edited by buechling
Link to comment
Share on other sites

josh4trunks

-rw------- 1 1001 1001 403368265 May 30 22:40 wmv_original.wmv

 

when i do ( in jail )

touch 123

i can see

-rw-r--r-- 1 root 1001 0 May 31 00:07 123

 

i also tried cat /etc/passwd ( in jail )

and see a user "emby"

 

but when i do /etc/passwd ( on shell )

there is no user "emby"

 

can i simply create it?

Yes you create the emby user if you want, though that alone wont solve your issue.

Your issue is that the file was written with owner read privledges only.

So either..

  1. You change the permissions your media files are and are written with to allow group or world reading
  2. You run emby as the same UID the files will be written with

Option (1) depends on your external program. Option (2) is acheived in Solution 1 or 2 in the linked guide.

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

Edited by josh4trunks
Link to comment
Share on other sites

buechling

great! thank you for the very fast & very good support!

 

so here is my conclusion on how to run a simple ( not very secure ) emby server on freenas

- install freenas

- install plugin "emby"

- activate plugin ( plugins -> installed )

- create disk /mnt/disk

- create volume /mnt/disk/share1

- create user, edit permissions of share1 : give it to user

- copy files with ftp ( or another method ) to share1

- go again to permissions of share1 : click "apply mode", read for all, ok

- go to jails, storage: mount /mnt/disk/share1 to /media

- open emby ( link under plugins, port 8096 )

- create new user, new folder to the library: /media

Edited by buechling
Link to comment
Share on other sites

josh4trunks

great! thank you for the very fast & very good support!

 

so here is my conclusion on how to run a simple ( not very secure ) emby server on freenas

- install freenas

- install plugin "emby"

- activate plugin ( plugins -> installed )

- create disk /mnt/disk

- create volume /mnt/disk/share1

- create user, edit permissions of share1 : give it to user

- copy files with ftp ( or another method ) to share1

- go again to permissions of share1 : click "apply mode", read for all, ok

- go to jails, storage: mount /mnt/disk/share1 to /media

- open emby ( link under plugins, port 8096 )

- create new user, new folder to the library

Looks like a good like of steps to me =]

Link to comment
Share on other sites

pclausen

Ok, I'm a little lost on the last few steps listed above.

 

Taking it from the top, here's what I did:

 

Create group called "media1" and another one called "peter"

 

sharingstep1.PNG

 

Create user "peter" using the same credentials as my windows machines and make that user a member of the group "peter"

 

sharingstep2.PNG

 

Create "media1" dataset

 

sharingstep3.PNG

 

Add Windows share with a name of "media1"

 

sharingstep4.PNG

 

Change permissions on "media1" to "peter" and make the owner group "media1"

 

sharingstep6.PNG

 

At this point I'm able to access the "media1" share from any of my windows machines without having to provide credentials and I can write files as well.

 

Next I install the Emby plug-in and add storage as follows:

 

sharingstep7.PNG

 

Emby can see the destination "media" and I'm able to add media folders

 

sharingstep8.PNG

 

So life is good and everything is working, BUT, when I try to download new meta data, Emby is not allowed to write/add a new file within the destination.

 

sharingstep9.PNG

 

So where did I go wrong?

 

Thanks!

Edited by pclausen
Link to comment
Share on other sites

pclausen

Ok, so I read this:

 

http://http://doc.freenas.org/9.3/freenas_jails.html#add-storage

 

And I added an "emby" user and made it a member of the group "emby".

 

The instructions above go on to say that I should then edit the dataset to be user "emby" and group "emby" with read and write permissions.  But if I do that, won't I loose the ability for "peter" to have access as well?

 

I'm taking about this window:

 

sharingstep10.PNG

 

I'm sure I'm missing something obvious.  I want both "peter" and "emby" to have full read/write access to the datastore "media1".  The above window only seems to allow me to set it to a single user at a time.  Surely there must be a way?

 

Once I get it figured out, I'll cleanup my previous post with some concise screen caps as the exact procedue as I think it will help others.

 

Thanks again.

Edited by pclausen
Link to comment
Share on other sites

josh4trunks
...

So where did I go wrong?

 

Thanks!

You didn't implement any of the Solutions in this thread for the Emby plugin.

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

 

...

 

I'm sure I'm missing something obvious.  I want both "peter" and "emby" to have full read/write access to the datastore "media1".  The above window only seems to allow me to set it to a single user at a time.  Surely there must be a way?

 

Once I get it figured out, I'll cleanup my previous post with some concise screen caps as the exact procedue as I think it will help others.

 

Thanks again.

Yes, there are multiple ways to accomplish this. The thread I linked has all the tools you'll need, but you will need to combine things when multiple plugins / sharing service needs to access the same files.

 

I'm not an expert at CIFS, but when I have set it up in the past I have CIFS do operations as a specific user, which I added to the FreeNAS host. I usually have this setup as the 'media' user with UID=816 so it matches the user plugins are using but in this case you'd want to use UID 983.

This is similar to 'Solution 1' but with the added step of forcing CIFS to use a specific user.

 

####

 

Your issues aren't related specifcally to the Emby plugin, but with file permissions related to CIFS and it's relations to plugins. The best place to get help with this is probably the Sharing section of the FreeNAS forums.

Link to comment
Share on other sites

pclausen

Thanks Josh.  I read through the 7 pages of your thread on the FreeNAS forum and I think 'Solution 2' would work out best for me.

 

Step 1 completed with no issues, but step 2 fails right away as follows:

 

embyjail.PNG

 

As you can see, I tried various other names for the plugin, but they all fail.  Btw, the plugin is running and I'm able to access it while running the above commands.  I also tried stopping the plugin and rerunning the above commands, but I still get the same error.

 

Please let me know if I should take this over to your thread on the FreeNAS forum.

Edited by pclausen
Link to comment
Share on other sites

josh4trunks

Thanks Josh.  I read through the 7 pages of your thread on the FreeNAS forum and I think 'Solution 2' would work out best for me.

 

Step 1 completed with no issues, but step 2 fails right away as follows:

 

embyjail.PNG

 

As you can see, I tried various other names for the plugin, but they all fail.  Btw, the plugin is running and I'm able to access it while running the above commands.  I also tried stopping the plugin and rerunning the above commands, but I still get the same error.

 

Please let me know if I should take this over to your thread on the FreeNAS forum.

Lol, that's alot of reading! I thought I covered everything in the OP, but there are several examples in the thread.

Emby's service is actually called "emby-server"

Link to comment
Share on other sites

pclausen

Thanks Josh, I really appreciate your patience!  With your help, I was able to complete all the steps:

 

embyownstep1.PNG

 

But the Emby plug-in will no longer start.  I restarted the entire jail to no avail.  Deleted the plug-in and repeated the whole process, same thing.

 

To recap, I created 2 groups as follows:

 

816 media

989 emby

 

I created 3 users as follows: (all have 'media' as the primary group)

 

ID - username - home dir

816 -- media -- /mnt/v1/media1

989 -- emby -- /mnt/v1/media1

1001  -- peter -- /mnt/v1/media1

 

The storage on emby_1 has a source of /mnt/v1/media1 and a destination of /media.

 

On the the datastore "media1" the owner (user) is "peter" and the owner (group) is "media".

 

I suspect this last piece is what's causing me trouble, but could that be what is preventing the Emby plugin from starting?

 

Maybe I need to forget about CIFS for now, change the "media1" owner (user) from "peter" to "media" and see if that clears thing up.  Only problem is that I got a 20TB copy running right now from my windows box to my FreeNAS box, and if I change the owner from peter to media, I think that process is going to die.  Maybe I just need to be patient for another ~30 hours or so until the copy has completed. :D

Edited by pclausen
Link to comment
Share on other sites

josh4trunks

Thanks Josh, I really appreciate your patience!  With your help, I was able to complete all the steps:

 

embyownstep1.PNG

 

But the Emby plug-in will no longer start.  I restarted the entire jail to no avail.  Deleted the plug-in and repeated the whole process, same thing.

 

To recap, I created 2 groups as follows:

 

816 media

989 emby

 

I created 3 users as follows: (all have 'media' as the primary group)

 

ID - username - home dir

816 -- media -- /mnt/v1/media1

989 -- emby -- /mnt/v1/media1

1001  -- peter -- /mnt/v1/media1

 

The storage on emby_1 has a source of /mnt/v1/media1 and a destination of /media.

 

On the the datastore "media1" the owner (user) is "peter" and the owner (group) is "media".

 

I suspect this last piece is what's causing me trouble, but could that be what is preventing the Emby plugin from starting?

 

Maybe I need to forget about CIFS for now, change the "media1" owner (user) from "peter" to "media" and see if that clears thing up.  Only problem is that I got a 20TB copy running right now from my windows box to my FreeNAS box, and if I change the owner from peter to media, I think that process is going to die.  Maybe I just need to be patient for another ~30 hours or so until the copy has completed. :D

The sysrc command isn't changing settings for the actualy emby-server service. It should the below, which has the service name, with any dashes turned to underscores.

sysrc 'emby_server_user=media'
Link to comment
Share on other sites

pclausen

Sweet, that finally did it!  Thanks again Josh.

 

I was getting pid permission denied errors, but after blowing away the Emby plugin/jail for the 10th time or something, I was able to run the commands properly and confirmed that I was finally able to save metadata from within the plugin.

 

That dash vs. underscore was really throwing me for a loop. :)

 

So here's the proper sequence for Emby for the noobs like me:

 

embyownstep3.PNG

Link to comment
Share on other sites

pclausen

It's me again.  So I have been slowly getting Emby up and running using the web gui.  The first thing I noticed was that I'm unable to create a password and save it.  When I attempt to do so, I get the message "invalid user or password entered".  I'm able to create additional users no problem, but I get the same error anytime I try to set a password for any one them.  Never had this problem with the Windows version.  Is there supposed to be a relationship between the Emby users defined in the Emby gui and those in the Jail and/or FreeNAS?  When I was testing last month I didn't run into this issue.  Perhaps this is related to making Emby run as the 'media' user?

 

2nd issue (or difference compared to the Windows version) is that when I scan my library and watch the progress bar, it doesn't update automatically like in Windows.  The only way to get it to update is to hit the browser reload button, and when I do, Emby pops me back to the login screen, where I then click my user, and them I'm back where I was.  This lack of real-time updates in the browser is also present when installing plug-ins.

 

Btw, I'm using Firefox on windows 8.1 64-bit in case that matters.

Link to comment
Share on other sites

josh4trunks

It's me again.  So I have been slowly getting Emby up and running using the web gui.  The first thing I noticed was that I'm unable to create a password and save it.  When I attempt to do so, I get the message "invalid user or password entered".  I'm able to create additional users no problem, but I get the same error anytime I try to set a password for any one them.  Never had this problem with the Windows version.  Is there supposed to be a relationship between the Emby users defined in the Emby gui and those in the Jail and/or FreeNAS?  When I was testing last month I didn't run into this issue.  Perhaps this is related to making Emby run as the 'media' user?

 

2nd issue (or difference compared to the Windows version) is that when I scan my library and watch the progress bar, it doesn't update automatically like in Windows.  The only way to get it to update is to hit the browser reload button, and when I do, Emby pops me back to the login screen, where I then click my user, and them I'm back where I was.  This lack of real-time updates in the browser is also present when installing plug-ins.

 

Btw, I'm using Firefox on windows 8.1 64-bit in case that matters.

No, there is no relationship between users on the the FreeNAS host or the plugin jail. I have created additional users with password on Emby running on FreeNAS 9.3 and FreeBSD 10.1 so I'm guessing your experiencing a bug.

You could try installing a second instance of Emby (not worring about the other steps) and see if you experience the same issue.

 

I haven't experience your second issue either. You might want to check the logs. Maybe it's related because it also seems related to authentication.

Link to comment
Share on other sites

pclausen

Here's what my log shows when I hit the browser reload button (top portion) and when I attempt to set a password.

 

embyjaulauthfail.PNG

 

I'll stand up a fresh Emby jail and see if this behavior still exists.

Link to comment
Share on other sites

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...