How to: Install MiniDLNA into iocage (FreeNAS 11.2)

hervon

Patron
Joined
Apr 23, 2012
Messages
353
This is a follow up highly inspired (copy/paste) of the excellent guide from joeschmuck to install minidlna in FreeNAS prior to 11.2.


This guide uses FreeNAS new UI 11.2 beta 2 with iocage jails.

What is MiniDLNA ?
MiniDLNA is server software with the aim of being fully compliant with DLNA/UPnP-AV clients.

Creating the Jail
Create a jail in the new UI from FreeNAS 11.2 (press on the + icon in the upper right of the screen)
Choose a jail name. I chose : MiniDLNA
Select the release : 11.2-RELEASE
Click Next.
Configure network : i'm a noob in the area. This is what worked for me.
IPv4 interface. I chose my interface em0
IPv4 Address: i chose a static IP outside my DHCP : 192.168.1.94. Highly depends of your network configuration. You may also choose DHCP.
IPv4 Netmask : 24
Click Auto-Start.
Did not change the rest.
Click Next then submit.

Add a mount point : Normally, you should now see the newly created jail.
Click on the 3 small dots far right to add mount points
Again press on the + icon in the upper right of the screen
  • Source is the media you want to share in your tank. In my case it is : /mnt/NASHD/Media/Movies
  • Destination is : /mnt/iocage/jails/MiniDLNA/root/media (the name of the jail depends on what you chose when you created the jail.)
As previously noted by joeschmuck : "It is recommended to not select Read-Only as some players will have issue with it however if you do select Read-Only and have a player having issues, go back and just change this."

Make sure the jail is started : again click on the 3 small dots far right

SSH into the Jail
You have several ways to SSH into the jail. I use XShell (free for home). This is not the scope of the tutorial. I will not answer questions about how to connect to FreeNAS using SSH. You can copy and paste the below commands if there is any doubt about spaces or format issues.

Type "iocage list" to make sure your jail was successfully created.
Type "iocage console MiniDLNA" (chose the right jail name) to enter in the jail.
Type "pkg install minidlna" (you will be prompted to install pkg too) to install MiniDLNA

Edit minidlna.conf file (instead i personally use WinSCP to access FRENAS and edit files)
Type "cd /usr/local/etc/" and you should be in that directory
Type "ee minidlna.conf" and you will now be editing the minidlna.conf file
Scroll down to the line where it says
  • Code:
  • media_dir=/opt
  • and change it to
  • Code:
  • media_dir=/media
Scroll down to the line where it says
  • Code:
  • #friendly_name=My DLNA Server
  • and change the line to (remove the # and change the name if you like)
  • Code:
  • friendly_name=MiniDLNA Server
Scroll down to the line where it says
  • Code:
  • #db_dir=/var/db/minidlna
  • and remove the "#"
  • Scroll down to the line where it says
  • Code:
  • #log_dir=/var/log
  • and remove the "#"
Press the ESCape key and Enter key twice to Leave and Save the changes.

Edit minidlna file
Type "cd rc.d"
Type "ee minidlna"
Scroll down to the line where it says
  • Code:
  • command_args="-P $pidfile -u $minidlna_uid -f /usr/local/etc/minidlna.conf"
  • and add -R to make the line read
  • Code:
  • command_args="-R -P $pidfile -u $minidlna_uid -f /usr/local/etc/minidlna.conf"
Press ESCape and then Enter key twice to Leave and Save the changes.

Testing MiniDLNA
Type "service minidlna onestart" and you should get "Starting minidlna".

Now go see if your DLNA compliant viewer can see your content. I use an old WDTVLive. I also see DLNA shares in my Windows 10 computer on the network window.

Make MiniDLNA starts when the jail is started (edit the rc.conf file)
Type "echo minidlna_enable="YES" >> /etc/rc.conf"
Type "exit"
Type "exit" which will close the shell.

Voilà. This is mostly a copy and paste of joeschmuck's thread. Hope that helps.
 
Last edited by a moderator:

Ziggy

Contributor
Joined
Oct 7, 2015
Messages
157
Well done on recreating this from joeschmuck's original. I'm stuck at editing the mindlna .conf file. The shell just seems to hang. I've ssh'd in via the shell option at the three dots:
upload_2018-10-25_17-24-18.png

Scrolling up and down there's nothing but empty space between the ee command and the above screenshot. Any ideas? Thanks.
 

hervon

Patron
Joined
Apr 23, 2012
Messages
353
I use Winscp and his included text editor. Much more easier for me.
 

Brandano

Cadet
Joined
Oct 26, 2018
Messages
1
The iocage does not set the correct terminal type for the most common ssh clients. Try this: set term=xterm
it should get both vi and ee working again inside the iocage
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
I have updated my thread with new instructions now that FreeNAS 11.2-RC2 came out.

I like these instructions, they get the job done (Thumbs-up)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
@hervon
Why use "iocage console" command? is it better than "jexec" or is jexec falling away? I found that "jls" and "jexec" still worked so I'm curious if there is some obsolescence or maybe better reason to use "iocage" command. I'm always looking to learn.
 

hervon

Patron
Joined
Apr 23, 2012
Messages
353

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
Found this link :

https://iocage.readthedocs.io/en/latest/

I like the simplicity of the commands related iocage. I do snapshots with it too. No other reason.
Holy Cow, I like that reference! All the awesome commands to help you tweak a jail, fantastic! The Advanced Usage page got my attention. Not sure if I'll need to use it but I will likely play with it. Thanks, really.
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
friends
I have a problem with minidlna.
I have a final version of 11.2 Freenas.
I was make a iocage jail for minidlna.
If i check the my static IP: eg. 19.2168.0.10 i have a data:
Media library
Audio files11751
Video files1187
Image files4706

vbut i can't read thius data.
Windows Media Player or My TV can't see any resources from my Freenas, and my NAS is visible on neteork neightbougth
Were is a problem ?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
friends
I have a problem with minidlna.
I have a final version of 11.2 Freenas.
I was make a iocage jail for minidlna.
If i check the my static IP: eg. 19.2168.0.10 i have a data:
Media library
Audio files11751
Video files1187
Image files4706

vbut i can't read thius data.
Windows Media Player or My TV can't see any resources from my Freenas, and my NAS is visible on neteork neightbougth
Were is a problem ?
In Windows Media Player do you see MiniDLNA at all or is it that you don't see any files shared under MiniDLNA? The solution is different depending on how you answer this.

In the very first posting of this thread is a link to another thread, read the first posting there and see if that helps, although the instructions here I thought were good but the other ones may work better for you.
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
Ok. I was change the lan interface from re0 to VNET and now my server working ok
 
Last edited:

Theos80

Cadet
Joined
Dec 26, 2018
Messages
5
Bonjour,
Toute ma configuration est bonne et j'ai même revérifier avec votre tuto. Alors voilà mon problème, je vois bien mon minidlna sur mon réseau mais aucun contenu n'est affiché dedans alors que quand je vais dans le fichier de destination mes films sont bien présent.
Pourquoi il n'y a aucun contenu d'affiché ?

Merci
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
Bonjour,
J'espère que le traducteur anglais-français a bien fonctionné.

La première publication de ce fil contient un lien vers ma version de cette procédure comportant des étapes numérotées. Examinez cela et je soupçonne que vous n’avez pas exécuté la procédure "Ajouter un dossier de support" et / ou l’étape 24.

J'espère que cela t'aides.

-Joe
 

hervon

Patron
Joined
Apr 23, 2012
Messages
353
Excellent translation job Joe. ;-)
 

isamudysan

Dabbler
Joined
Feb 25, 2015
Messages
11
is minidlna a free for all devices to view, or can/is like emby's dlna where it can be device profiled? thx.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
is minidlna a free for all devices to view, or can/is like emby's dlna where it can be device profiled? thx.
MiniDLNA is just a simple DLNA server. If the device supports DLNA (I'd think most do these days) then it should work. I don't think it can be device profiled like you expect but you can profile the media content to some very minor extent. Do a search on MiniDLNA or ReadyDLNA on the internet and you can read up about the configuration file parameters and options but please note, this was ported to FreeBSD and while it works for the most part, not all options are usable. You will find out if you play with it. Good luck.
 

MrT412

Cadet
Joined
Mar 23, 2019
Messages
1
hey guys

I'm new at this and followed the steps given but keeps saying failed to start miniDLNA

I'm running FreeNAS-11.2-U2.1. Any pointers at what I'm doing wrong?

dlna.png
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
hey guys

I'm new at this and followed the steps given but keeps saying failed to start miniDLNA

I'm running FreeNAS-11.2-U2.1. Any pointers at what I'm doing wrong?

View attachment 29522
I suspect you did something wrong but go back to the first posting and click the link.
 

BigBadBear

Cadet
Joined
Apr 16, 2019
Messages
2
Excellent guide, got MiniDLNA working for me but then I ran into a weird issue. When I add an MP4 file while the system is running MiniDLNA says it's an Audio file, MKV and AVI seem to be ok when added and all the existing MP4 files are seen as Video. If I restart the jail, it re-scans all the files and says all the MP4s are video files, then add another MP4 and it sees the new one as an Audio file. I'm assuming I've got something wrong or forgotten to change a setting somewhere but I can't figure it out. Any ideas would be much appreciated
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,970
Excellent guide, got MiniDLNA working for me but then I ran into a weird issue. When I add an MP4 file while the system is running MiniDLNA says it's an Audio file, MKV and AVI seem to be ok when added and all the existing MP4 files are seen as Video. If I restart the jail, it re-scans all the files and says all the MP4s are video files, then add another MP4 and it sees the new one as an Audio file. I'm assuming I've got something wrong or forgotten to change a setting somewhere but I can't figure it out. Any ideas would be much appreciated
You may need to do an internet search for "minidlna mp4 audio" or something similar because I'm not sure why minidlna is doing this. You might also try to specify in the minidlna.conf file the fact that all files in a specific directory is video only. In the step where is specifies "media_dir=/media", assuming you do not have any media other than video, change it to read "media_dir=V,/media" and if by chance you do have audio content then you should setup proper subdirectories and tag those using something for example in the minidlna.conf file as follows:
Code:
media_dir=V,/media/video
media_dir=A,/media/audio
media_dir=P,/media/photos

and of course you would have to create specific mount points to do it this way but if you only have video files, just use media_dir=V,/media and give it a try.
 
Top