FreeNAS 8.2.0: Add media directories to minidlna.conf

Configuration GUI for minidlna in FreeNAS 8.2.0

With FreeNAS 8.2.0 support for minidlna as a plugin has been added. Unfortunately the settings are limited, so you can only define a media path via the GUI. However, with a few changes in the minidlna.conf it is very easy to define folders for videos, pictures and movies. In the following I assume that the plugin jail has been installed and configured successfully and that the minidlna-PBI is loaded.

Hint: the media path (here /music) must be created as mountpoint in the jail, this is also controlled by the plugin configuration. If you press "Browse" in this menu, you get into the directory tree of the host and not of the jail. The paths are relative to the jail, if the jail is stored in "/mnt/pool/jail/Jail", "/Music" corresponds to "/mnt/pool/jail/Jail/Music". This directory must be created and mounted on the actual data directory.

 customize minidlna.conf

Since you can only specify one path via the GUI (see screenshot), you have to edit the minidlna.conf. The easiest way to do this is via an SSH connection. The directory path is composed as follows (where jail is the name of the jail directory and jail is the name of the jail itself)

~# /mnt/pool/jail/Jail/mnt/plugins/pbi/minidlna-amd64/etc/minidlna.conf

With "nano -w minidlna.conf" you can open the configuration data for editing and set the settings accordingly:

media_dir=A, /Music
media_dir=V, /Videos
media_dir=P, /Pictures

Since FreeNAS overwrites the changes to minidlna.conf with the settings from the GUI, the file must be read-only. This must be removed each time you want to edit the file again:

~# chmod 444 minidlna.conf (write protection active)
~# chmod 644 minidlna.conf (write protection disabled)

With these changes, minidlna will also use data from the additional directories - making it much more convenient as a DLNA server than with the standard setting options offered by FreeNAS. As DLNA player you can use for example the Playstation 3 or a Apple TV2 with XMBC. If you are looking for a more powerful and flexible solution, you can contact my first example compilation for a HTPC Get inspiration.

16 thoughts on “FreeNAS 8.2.0: minidlna.conf um Medien-Verzeichnisse erweitern”

  1. You don't have to write these things in the config.
    Just write them as they are in aux parameter of MiniDLNA and it works.

  2. Falk Jeromin

    Sayyadin :

    You don't have to write these things in the config.
    Just write them as they are in aux parameter of MiniDLNA and it works.

    Even the additional paths? You still can't specify the type of the default media path, as I understand it.

  3. @Falk Jeromin
    Yep, that works. You only need to enter a double cross (#) at the top of the "general media path" (comment in the generated conf).
    And inotify=yes doesn't work in the BSD port yet, so it's a Linux-only feature and therefore totally unnecessary in the FreeNAS context.

  4. or you can write "A, /Music" in the general and in the aux-parameter the other two lines, as Sayyadin already mentioned.

  5. Hello, the description is simply great, everything works perfectly. Does jemenad know the aux-parameter for Game (media_dir=?, /Game) to save games on the media server or is that not possible?

    Greetings Sven

  6. I have solved this a bit different: Just login via shell and create a directory under the jail in the /mnt/ path. With me it looks like this:

    cd /mnt/Homeserver/Jail/jail/mnt/
    mkdir Media
    cd media
    mkdir movies
    mkdir series

    Then specify mountpoints to these subdirectories and you can do the configuration in the web interface of miniDLNA by simply specifying "Media" as the top directory - the folder structure will be preserved.

  7. Hello, unfortunately this does not work for me yet, miniDLNA can obviously not read the folders. The minidlna.conf, which by the way is now located in another folder (.../jails/minidlna_1/usr/pbi/minidlna-amd64/etc), looks like this for me:

    media_dir=A, /Music
    media_dir=V, /Movies
    media_dir=V, /Videos
    media_dir=V, /TV series
    friendly_name=TEST Media Server

    The config file has the owner and the group "www" and I set the permissions to 444, because otherwise the file was actually always overwritten. What seemed strange to me: When I wanted to change the file again later, I didn't have to remove the write protection. Could this be because I edited the file with root privileges?
    In any case, miniDLNA can read the file correctly, because the name of the server is correctly taken from the config file. So it can only be due to the folders I mounted in the jail. Instead of using the "media" folder, I manually created the media folders music etc. directly in the jail directory and then assigned them to the folders on my HDD via the user interface.
    I'm hoping you could help me with the problem.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top