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

Fox_McCloud

Cadet
Joined
Apr 17, 2020
Messages
5
Does anyone have the issue where you can see you MiniDLNA host in WMP, TV, Roku, etc., but none of your media shows up?

I've went through the steps multiple time, trying iocage as well. Everytime the DLNA server shows up, but never any media. I had this working on a 9.x build, but cant seem to get it to work on my new build with11.3. Any ideas?
 

Frank Collins

Explorer
Joined
Apr 10, 2019
Messages
53
@Fox_McCloud,
I had a similar problem after deleting a legacy miniDLNA jail from FN 11.1 and installing in an iocage jail in 11.3. Some vidoes/movies appeared but not all. Surprisingly, what fixed was a restart of the whole FreeNAS box. I don't know why but it did.
 

Fox_McCloud

Cadet
Joined
Apr 17, 2020
Messages
5
@Fox_McCloud,
I had a similar problem after deleting a legacy miniDLNA jail from FN 11.1 and installing in an iocage jail in 11.3. Some vidoes/movies appeared but not all. Surprisingly, what fixed was a restart of the whole FreeNAS box. I don't know why but it did.
Rebooted, but issue still persists :(

Do you have you share setup at a Windows Share, or Unix?
 

Frank Collins

Explorer
Joined
Apr 10, 2019
Messages
53
My miniDLNA datasets are Music and Movies and they are SMB shares.
 

Fox_McCloud

Cadet
Joined
Apr 17, 2020
Messages
5
I ended up adding user and group both named "dlna" with UID "933", and added permissions to the share where the videos are kept per instructions in this forum: https://www.xigmanas.com/forums/viewtopic.php?t=2099 . No sure if that was actually it, or changing "notify_interval=900" to "notify_interval=10" in the "/usr/local/etc/minidlna.conf" file gave it a kick. Either way it works now. Thanks for the help.
 

Frank Collins

Explorer
Joined
Apr 10, 2019
Messages
53
@Fox_McCloud,
Actually,
You have done it the right way. I forgot that I allowed Guest access, which isn't a good practice.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I'm surprised folks are referencing this thread and I'm glad everyone is offering good advice. Unfortunately I'm still in progress of moving from Virginia to Georgia and all my server hardware is packaged up for a few more months at a minimum. One day I'll be back online a few hours a week but that isn't in the cards for a while. The new job has me very busy, and this old man likes busy. It's either busy or just retire, but I'm too poor to retire now that I'm buying a new house.
 

FlatCapWolf

Cadet
Joined
May 2, 2020
Messages
1
I have ran through the setup and it worked, but momentarily. I saw my data, then 10 minutes later I came back to it to set it up on another device and it said there was no data to display. The DNLA itself works, but I just can't see the data
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The DNLA itself works, but I just can't see the data
What do you mean exactly? You can see the DLNA Server name but no media or something else? Also, what is the device that you are streaming to? The first thing I'd try to do is restart of MiniDLNA, if that fails then a restart of the device you are steaming to.

Of course if you do have enough RAM available you could use the DLNA server built into Plex and it works so much better than MiniDLNA.
 

Frank Collins

Explorer
Joined
Apr 10, 2019
Messages
53
Of course if you do have enough RAM available you could use the DLNA server built into Plex and it works so much better than MiniDLNA.
I haven't found that. For me miniDLNA works far better than Plex: it updates content much faster.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I haven't found that. For me miniDLNA works far better than Plex: it updates content much faster.
I can't speak to how fast your content is updated but Plex does have a built in DLNA server that is not the cool interactive Plex that many love. But the DLNA does benefit from the advanced features such as looking up movie/music info (even though it doesn't always get it right). I;m glad that MiniDLNA is supporting your needs.
 

Phil1295

Explorer
Joined
Sep 20, 2020
Messages
79
Hi,

I have permission issues accessing the media files
I have my medias on an SMB share properly set and working with ACLS on the FreeNAS host
I added a mount point of my SMB share to the jail /media folder as r/w

Code:
minidlna error: open(/media) [Permission denied]


In the host, I tried to create the dlna/dlna user/groups with same 933 uig/gid and membership and added them to the share with r/w access
but no hope

I tried to add user admin in the jail which have wide read/write permissions on the host, and obviously with same uid/gid. I verified
Code:
su - admin
in the jail has proper r/w access to the /media.
I then started minidlna service under the admin user by editing the proper entry in minidlna file
Code:
minidlna_uid=${minidlna_uid-"admin"}


Still, same error. I verified the minidlna service was properly running under the admin user with the command
Code:
ps aux


I also tried to edit the jail fstab adding the acl option:
Code:
/mnt/pool/movies    /mnt/pool2/iocage/jails/minidlna/root/media       nullfs  rw,acl      0       0 # Added by iocage on 2020-12-02 15:24:25


Fixes I found:
- If I run it as root, it properly works. But I really don't want it running as root !
Code:
minidlna_uid=${minidlna_uid-"root"}

- Also, if I use a regular unix folder mount, it properly scans the media folder: not an option for me
- If I change the owner of the share to the user dlna, it would also work. However, if I add a new file through smb, it won't have the dlna user as owner and won't be detected by minidlna unless i change the owner

Anyone managed to make it run with an SMB ACLS mounted share ?
 
Last edited:

Phil1295

Explorer
Joined
Sep 20, 2020
Messages
79
Ok, I figured it out
it is rather the user in minidlna.conf that must be set, and not the daemon user, a bit wired...
What made me crazy is that the user must have as primary group in the jail a group with read access to the share on the host. I set it up like in the host, with auxillary groups, but it doesn't work unless the primary group in jail have the needed permissions in host

I just have a wired setup where all smb users have the same primary group for easier management, and the primary group has no rights
It works on the host, it works in the jail shell, but not for minidlna that seems to require the primary group
 

Phil1295

Explorer
Joined
Sep 20, 2020
Messages
79
A few more notes, if the first post guide can be edited for new minidlna users...

- Do not set the destructive scan on each star: use -r instead of -R
It is no more needed now because FreeBSD has now a properly working inotify equivalen and added medias are immediately detected by minidlna
This can be really time consuming if you have a very large library like I do
Code:
command_args="-r -P $pidfile -u $minidlna_uid -f /usr/local/etc/minidlna.conf"


- If you want to trigger a real full rescan:
Code:
service minidlna stop
service minidlna rescan


if started manually or by script:
Code:
service minidlna onerescan


- mindlna.conf:
Code:
user=username


+ username must exist on both host and jail
+ username must have read rights on the media library IN THE HOST, either "directly", or through a group membership (primary or auxiliary)
+ username must be added to the jail, with THE SAME UID as in the host
+ if username does not have a "direct" read access to the media library on the host, but rather through a group membership: then, the group with read access must also be added on the jail, with the same gid as in the host AND the username MUST have that group as his PRIMARY group in the jail

The last part is very important for people that use group only permissions on their SMB shares
By "direct", I mean the username is added in the SMB share permissions and not only his group
 
Top