How to Install MiniDLNA on FreeNAS 9.3 (Prior to Plugin)

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Thanks for the feedback. I think I will look at updating the MiniDLNA procedures, it's been a while since I've done that.

You can add move folders for sharing however you need to basically create a subdirectory under /media and attach the shares there. Example: "/media/movies" and "/media/tv_shows" and then in FreeNAS, attach the shares to those locations specifically. MiniDLNA would not need any changes as it will scan everything in the "/media" directory.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
But I was getting an error, when I want to install minidlna in the jail. First of all, with FreeNAS 9.10 in the jail itself a file called "FreeNAS-10.3-Stable" or something like that was downloading. Not sure if this is important, but I was not able to install minidlna with pkg
Error:
Code:
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
pkg: repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/digests.txz: No such file or directory
pkg: Unable to update repository local
All repositories are up-to-date.

So I just looked into this thread: https://www.reddit.com/r/freenas/comments/2s5q7f/help_pkg_install_nano/
Maybe this is helping someone.
I need to install gettext first, then everything works fine, like you have documented it.
Code:
pkg install gettext

Hit a few times YES than and voila ;)
I'm not sure why you got that message and had this trouble. I just ran the install (twice) on a clean 9.10.1-U1 system and had no issue. The jail OS was also the same "FreeBSD-10.3-RELEASE" file you downloaded and installed. But thanks for reporting the problem, other folks could run into this and your posting may help them.
 

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
Thanks for the feedback. I think I will look at updating the MiniDLNA procedures, it's been a while since I've done that.

You can add move folders for sharing however you need to basically create a subdirectory under /media and attach the shares there. Example: "/media/movies" and "/media/tv_shows" and then in FreeNAS, attach the shares to those locations specifically. MiniDLNA would not need any changes as it will scan everything in the "/media" directory.
Thank you for the information.


I'm not sure why you got that message and had this trouble. I just ran the install (twice) on a clean 9.10.1-U1 system and had no issue. The jail OS was also the same "FreeBSD-10.3-RELEASE" file you downloaded and installed. But thanks for reporting the problem, other folks could run into this and your posting may help them.

Mhh thats kind of interesting. When I have some time, I will try this again and look, if the error will occur in another jail on my machine too.

So, you wrote that sometimes there are problems when the mounted storage from the freenas-volume is read-only. What is the specific error on this? Because I am a little bit paranoid, that the jail can change the data or that there is no security ;)

Cheers
IceBoosteR
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
So, you wrote that sometimes there are problems when the mounted storage from the freenas-volume is read-only. What is the specific error on this? Because I am a little bit paranoid, that the jail can change the data or that there is no security ;)
Some players will just fail to work. What happens is the player will try to write a temporary file to the server and when you have Read-Only selected, well that file cannot be created and the player will not work. Of course you can select Read-Only and if you don't have any problems, well all is good. If the player fails to work, then deselect Read-Only.
 

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
Some players will just fail to work. What happens is the player will try to write a temporary file to the server and when you have Read-Only selected, well that file cannot be created and the player will not work. Of course you can select Read-Only and if you don't have any problems, well all is good. If the player fails to work, then deselect Read-Only.
Well - thats easy to understand :)
Thanks
 

xt4c

Dabbler
Joined
Feb 11, 2013
Messages
13
Hi Joeschmuck,
Many thanks for your write up and subsequent follow ups to peoples' posts.
I have installed minidlna as you describe, but I cannot for the life of me get minidlna to actually see my mp3 files.
When I ssh into the jail and go to the media folder and from the prompt type 'ls' I can see all the directories of my mp3 files in alphabetical order as I would expect, (so the 'source' and 'destinaltion' settings are correct in the jail) but when I go to the minidlna server via the web the number of files minidlna has recognised is '0'.
What am I doing wrong? Do all my mp3 files just need to be in one directory? Is it something to do with my heirachy of directories? Any advice would be greatly appreciated.
ChrisR
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
That is odd that if you can see the files in the jail, that MiniDLNA doesn't see it. I would suggest you look at step 22 and verify that you change the line "media_dir=/media" at step 24. If that doesn't work, I'd create a new subdirectory with only a few MP3 files and use just that as the source, see if that works.

What program are you accessing the MiniDLNA server with? In my examples it was WMP.

If that doesn't work, could you post a copy of the minidlna.conf file (in code tags) and from within the jail, the /media directory structure.

I'm working some really long hours so I doubt I'll get back to you again today but hopefully you just need to make a simple change and all will be good.
 

xt4c

Dabbler
Joined
Feb 11, 2013
Messages
13
Hi JS
Sorry for being slow getting back to you. I've been rather busy!
In the end, in order to get the minidlna server to see and 'scan' my files I had to do this in the minidlna.conf file:
Code:
# specify the user account name or uid to run as								
user=root


Not sure if that's the best strategy but it's worked!
So big thanks for your write up - this is just what I need to serve my music to my Naim Mu-So! Works a treat!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Not sure why you would need to change the user account unless there was something wrong with the permissions of your media files. Eh, you got it to work, good enough.
 

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
Hi joeschmuck,
I have just installed a fresh 9.10-U2 and my previous error message is gone now. Everything works as expected. Just a little feedback as I wanted to also test this another time ;)
 

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
Argh damn it
I faced some new issues. Unless if the mounted filesystems are read only or not (I was mounting and unmounting those for half an hours now), MiniDLNa is not indexing my files...
I did the same as before. Nevertheless I am trying to solve this, so I looked into /var/log/minidlna.log and found this:
Code:
[2016/10/29 23:49:35] inotify.c:108: error: inotify_add_watch[kqueue,open](/media/Movies) [Permission denied]					

This is kind of interesting.
My permissions:
Code:
4 71 drwx------+ 261 1001  1001   262 Oct 29 23:07 Movies
				

So I was wondering why the owner is 1001 here and not "root".
Could someone check if this could be the error?
The permissions should work in my opinion. I dont want to give more permissions to my jail as needed.
Thanks :)

Edit: There is no User with UID 1001 in my passwd. Crazy because last time it just worked... meh
Edit 2: Set user to dlna, change folder to 777 and nothing changes. I am confused and now I stop investiating as I dont know what to do -_-
Maybe I will reinstall or something like that.


And another hint for everyone:
DO NOT CHANGE the permissions on a mounted folder in the jail. I was not able to see my movies anymore on the CIFS share. I had to login to root-shell and reset the permissions.
Ok I am frustrated now xD :D

Edit 3:
Got an idea. I have set the group ID to 1001 in the FreeNAS itself, the user I want to access this specific files (movies). So ID 1001 is not known to the jail.
So my question is, do I have to create a user with ID 1001 also in the jail? But this would not help unless the minidlnad is running with 933
Any suggestions? :)
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
When you install MiniDLNA in a jail it will automatically create the user account 'dlna'. All permissions are automatically created as well.

While I can't get to it tonight, I'll install MiniDLNA again and test it out. Exactly which version of FreeNAS are you running and also inside your jail, type "uname -v" and provide the data from it.

Thanks

EDIT: Here are the permissions I have for my Movies directory:
 

Attachments

  • Capture.JPG
    Capture.JPG
    34.6 KB · Views: 350

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
When you install MiniDLNA in a jail it will automatically create the user account 'dlna'. All permissions are automatically created as well.

While I can't get to it tonight, I'll install MiniDLNA again and test it out. Exactly which version of FreeNAS are you running and also inside your jail, type "uname -v" and provide the data from it.

Thanks
Hi joeschmuck,

thank you for your reply, here are the information you have requested:
Code:
root@MiniDLNA:/ # uname -v																										 
FreeBSD 10.3-STABLE #0 r295946+0ea9076(9.10-STABLE): Mon Oct  3 06:51:23 UTC 2016	 root@gauntlet:/freenas-9.10-releng/_BE/objs/fr
eenas-9.10-releng/_BE/os/sys/FreeNAS.amd64																						 
root@MiniDLNA:/ #


So I am pretty sure that is is an inherit permission problem. when I was testing this a few weeks ago, the dataset owner was root, now its the user with ID 1001. I think this is the problem. I will look if I can find a workaround for this.
Thank you :)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I just posted an update (screenshot above). You can go in and change the permissions to the files in the folder.
 

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
I just posted an update (screenshot above). You can go in and change the permissions to the files in the folder.
Hey,
thank you for the update and the information -> It just fits with my thesis. It was the inherit permissions on the dataset.
Now everything works - unless my access with CIFS as I have configured a "non root user" to access the files and directories, so I set this also on the dataset permissions. Now I have to look, how I can solve the problem on CIFS side ;)


Okey, is there a possibility to have all my permissions set as I had before and configuring the jail to can also access the data where the owner is 1001?
Thant would be kind.
This takes now about 3 hours, but now I know a lot more about permissions for jails.
So I woud be happy about any input. I only have bad ideas (sharing internally NFS to access the files (quick and dirty...).

Edit1:
This drives me crazy, aaand I could not sleep. So I found an entry of Comso_Kramer about Plex and those mount points. I have just deleted my jail, because I did a lot of things there, just need a clean install now xD.
Now back to his post: https://forums.freenas.org/index.ph...all-plex-in-a-freenas-9-3-jail-updated.19412/
He is adding the Plex user to the group which he created in the jail only. So my plan is, leave everything as it is (I mean the permission I have on the dataset) and mount this to the jail Then just add the required user and put in group and user id 1001. I dont know if this works, but that would be the cleanest way ;)

Update 2, 2am .... :
I checked the documentation, and found point 13.2.1.2. I think it is clear what to do now. Create the user "dlna" I think on the freenas system and add the user to the group which is granted to the dataset. This user with the group should be similar in the jail, and should work then, when I understand the documentation correct.

Sorry for writing a blog here, but this should work without root permissions.
Ok so, joeschmuck, can you confirm that the dlan-user needs the access to the mounted filesystem? I was learning, that the FS was delivered by
MOUNT_NULLFS, so everything which is done is going from the jail direct to the productive data, including permissions. So when I want to access those files, I need to create a dlna user with id 933 on freenas and add it to my group 1001 (lets call it: "test-group". When the user is memeber of the group, it should be possible to acess the files, unless if they are read-only or not?
Are my thoughts correct?

Good night
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Looking into it, without messing up my own configuration, I have discovered that for my setup I must have the permissions set for OTHER Read and Execute using Unix permissions in order for the media to be shared with MiniDLNA. Of course for my setup I run with Write checked as well but I didn't need it for MiniDLNA to operate. Oh, and I set the user and group to "nobody" and "nogroup" and it worked fine.
 

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
Looking into it, without messing up my own configuration, I have discovered that for my setup I must have the permissions set for OTHER Read and Execute using Unix permissions in order for the media to be shared with MiniDLNA. Of course for my setup I run with Write checked as well but I didn't need it for MiniDLNA to operate. Oh, and I set the user and group to "nobody" and "nogroup" and it worked fine.
Hi again,

sorry with stealing your time while struggling around with my problems...
So I will give it a try, I just installed a fresh jail.
Could you please be more precise, where you changed the user and group to nobody? In the jail, on the mountpoint?
Thanks :)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
There are no changes in the jail at all.

The changes are here:
FreeNAS -> Storage Icon -> Volumes -> (Select your storage location) -> Change Permissions -> (See screen capture).
 

Attachments

  • Capture1.JPG
    Capture1.JPG
    166.9 KB · Views: 350
  • Capture2.JPG
    Capture2.JPG
    59.3 KB · Views: 319

IceBoosteR

Guru
Joined
Sep 27, 2016
Messages
503
There are no changes in the jail at all.

The changes are here:
FreeNAS -> Storage Icon -> Volumes -> (Select your storage location) -> Change Permissions -> (See screen capture).
Thank you for the clarification. I was jist having "Windows" as my permission type - os I will change that. Give me some minutes.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
While all my computers at home are Windoze, my FreeNAS is setup as Unix. This makes things very simple and I do not worry about authentication issues since I'm on a closed network and I don't have kids to start deleting things by accident. If I need to ever do some authentication at a later date, I'll tackle it then.
 
Top