- Joined
- May 28, 2011
- Messages
- 10,996
How to install MiniDLNA into a FreeNAS 9.3, 9.10.x., 11.x (original GUI & New GUI) Jails (warden and iocage).
It appears that FreeNAS has no plans to incorporate a simple DLNA server for FreeNAS 9.3 and later so this thread contains detailed instructions to install MiniDLNA in a jail, your other option is to use Plex which does have a very good built in DLNA server.
This thread is for those folks who want to manually install MiniDLNA into a jail and I will give you step by step instructions to achieve that.
One thing to note, this is only to restore MiniDLNA functionality and nothing more since the Plugin was removed from FreeNAS. MiniDLNA does have some limitations which I cannot get past as MiniDLNA was a port from Linux, and FreeBSD and Linux are not the same thing. If MiniDLNA doesn't do it for you then I suggest installing Plex Media Server and using the built in DLNA server.
There are a few assumptions:
1) Your FreeNAS network is already configured and can access the internet.
2) You have some videos/music ready to be shared on your FreeNAS server.
If you have any issue with a step below, reference the step that worked last and the step you are having issue with. This may sound odd but this is the way to ensure you are provided accurate help.
So lets get started...
UPDATE! I have made some changes with the layout, I wasted to maintain the same numbering system to ensure the steps remained basically the same. If you have a problem then you should be able to read through the thread and if someone had an issue before, it would still relate if they found an answer. I also called the sections of steps by "Old GUI" and "New GUI". Pay attention to what you are doing and it should all go well.
Creating the Jail (Old GUI)
1) You 'should' identify an IP address you will use for the MiniDLNA server or you can use DHCP if you must. For my example I will use 192.168.1.54.
2) In the FreeNAS GUI click on the Jails Icon
3) Click on Add Jail
4) Click on the Advanced Mode button
5) Enter the Jail Name MiniDLNA (Note: You could call it FreeBSD as you can use this jail for much more than just MiniDLNA, but for this purpose we will simply call it MiniDLNA)
6) Now comes the tricky part, do you use DHCP or a static IP address.
a) DHCP: Click DHCP and skip to step 7
b) Static IP Address: Fill in IPv4 address, netmask /24 (255.255.255.0), and default gateway. In my case the values are address: 192.168.1.54, netmask: /24 (255.255.255.0), default gateway: 192.168.1.1
7) Scroll to the bottom of the screen and click OK (Leave Autostart and VIMAGE checked)
8) If this is the first time creating a FreeBSD jail then you will have a large download start up.
9) At the completion you should have a standard jail called MiniDLNA and it lists the IP address of that jail.
Creating the Jail (New GUI)
1) You 'should' identify an IP address you will use for the MiniDLNA server or you can use DHCP if you must. For my example I will use 192.168.1.54.
2) In the FreeNAS GUI click on the Jails Icon
3) Click on Add Jail (Round yellow dot with a "+")
4) Click on the ADVANCED JAIL CREATION button
5) Enter the Jail Name MiniDLNA (Note: You could call it FreeBSD as you can use this jail for much more than just MiniDLNA, but for this purpose we will simply call it MiniDLNA)
a) Select the Release version you desire. AS of this writing I selected "11.2-RELEASE"
6) Now comes the tricky part, do you use DHCP or a static IP address.
a) DHCP: Click DHCP and skip to step 7 (Note: a few options will auto-select for you)
b) Static IP Address: Select "vnet0" for the IPv4 Interface (or whatever option you desire, some work, somoe don't). Fill in IPv4 address, netmask /24 (255.255.255.0), and default gateway. In my case the values are address: 192.168.1.54, netmask: /24 (255.255.255.0), default gateway: 192.168.1.1
7) Select Auto-start.
a) Now scroll down to the bottom of the screen and select "SAVE"
8) If this is the first time creating a FreeBSD jail then you will have a large download start up.
9) At the completion you should have a standard jail called MiniDLNA and it lists the IP address of that jail.
a) Once your jail is running you must Stop it to finish the configuration. On the right side of the jail (those three virticle dots), click it and select Stop.
Adding the Media Folder (Old GUI)
10) On the left panel of the GUI open Jails -> MiniDLNA -> Storage -> Add Storage
11) The first box should say MiniDLNA, leave that one alone
12) The Source you will need to locate your media to share
13) In the Destination box locate and select "/media"
14) 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.
15) Click OK
Adding the Media Folder (New GUI)
10) Click on the right side of the new jail (three verticle dots) and select "Mount points"
11) A new scree opens up called Mount ponts, on the right side is a yellow circle with a "+", click it
12) In Source you will need to locate your media to share
13) In the Destination box locate and select "/media" (Full path would look similar to this: "/mnt/pool/iocage/jails/MiniDLNA/media")
14) 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.
15) Click "SAVE"
a) We must start the jail again. On the left side of the GUI select "Jails"
b) On the right side of the GUI for your MiniDLNA jail select the three virticle dots and select "Start"
SSH into the Jail (Old & New GUI's)
You have several ways to get into the jail and I like to use Putty myself (you must have SSH enabled) but for this example we will use the built in GUI Shell. You can use the PASTE in the shell if you want to cut and paste the below commands if there is any doubt about spaces or format issues.
16) In the left hand pane select Shell and select the maximum window size you can read, for my screen it's 132x43.
17) Type "jls"
18) You should see a listing of jails by JID numbers, assuming JID 1 is MiniDLNA in this scenario...
19) Type "jexec 1 /bin/csh"
20) Type "pkg_add -r minidlna"
20a) Type "pkg install minidlna"
21) At this point MiniDLNA and support files will install
21a) At this point you will be asked to install, upgrade, reinstall, and/or remove software. You must type "y" to continue. This may occur several times and upgrade your FreeBSD jail to support the MiniDLNA program. If you fail to update then you may not have a working network connection.
Configuring MiniDLNA (Old & New GUI's)
22) Type "cd /usr/local/etc/" and you should be in that directory
23) Type "ee minidlna.conf" and you will now be editing the minidlna.conf file
24) Scroll down to the line where it says and change it to
25) Scroll down to the line where it says and change the line to (remove the # and change the name if you like)
26) Scroll down to the line where it says and remove the "#"
27) Scroll down to the line where it says and remove the "#"
28) Press the ESCape key and Enter key twice to Leave and Save the changes.
29) Type "cd rc.d"
30) Type "ee minidlna"
31) Scroll down to the line where it says and add -R to make the line read
32) Press ESCape and then Enter key twice to Leave and Save the changes.
Testing MiniDLNA (Old & New GUI's)
33) Type "service minidlna onestart" and you should get a message of Starting minidlna. Now go see if your DLNA compliant viewer can see your content, I use Windows Media Player (WMP) for testing purposes as I don't need to leave the computer when doing this test.
Make the MiniDLNA Run Normally (Old & New GUI's)
Now we must tell MiniDLNA to start when the jail is running.
34) Type "echo minidlna_enable="YES" >> /etc/rc.conf"
35) Type "exit"
36) Type "exit" which will close the shell.
Make the MiniDLNA Run Normally (Old GUI)
37) In the Jails Tab, select the MiniDLNA jail and at the bottom for the screen select Stop. Wait until the jail has stopped before continuing, this could take a minute or two depending on your system, be patient.
38) Verify the MiniDLNA is no longer running by testing your DLNA Device (WMP for me)
39) In the Jails Tab, select the MiniDLNA jail and at the bottom of the screen select Start. Wait about 30 seconds after it starts.
40) Verify MiniDLNA is working now and if it is, you are all done.
Make the MiniDLNA Run Normally (New GUI)
37) On the Jails screen, on the right side of the MiniDLNA jail select the three verticle dots and select Stop. Wait until the jail has stopped before continuing, this could take a minute depending on your system, be patient.
38) Verify the MiniDLNA is no longer running by testing your DLNA Device (WMP for me)
39) On the Jails screen, on the right side of the MiniDLNA jail select the three verticle dots and select Start. Wait about 30 seconds after it starts.
40) Verify MiniDLNA is working now and if it is, you are all done.
In order to rescan your database you have a few options:
1) Reboot your FreeNAS system
2) Stop the MiniDLNA Jail and then Restart it
3) Using a shell/SSH into the jail you can type "service minidlna restart"
4) You can use the script mentioned below only if you have the one Jail as it will stop other jails from running.
If you have any issues running this, before posting a question I request you start over again and use the cut & paste method to enter your commands. I have tested this out and it does work perfectly on "FreeNAS 9.3-STABLE-201505130355". Make sure you post the last step that worked and the step that failed along with the error you are seeing.
UPDATE: 10 January 2015
When you install the minidlna package it will be 1.1.1_5,1 which includes the kqueue support so when you add, delete, or rename a file in your library, the minidlna application will sense that and update the library database. This alleviates the issues of running a separate rescanning script.
UPDATE: 25 May 2015
Steps 20a and 21a were added because the package installer works differently in more recent versions of FreeNAS 9.3 and the FreeBSD jail must be updated. Also the newer version of MiniDLNA (1.1.4_1,1) now apparently supports faithful rescanning of the database, I'm glad kqueue is finally working well.
UPDATE: 1 October 2016
The entire set of instructions were tested with a clean installation of FreeNAS 9.10-1U1 and worked perfectly with one exception, a bug which prevents selecting the DHCP (step 6a). This jail bug has already been reported. Also, MiniDLNA (1.1.5_1,1) is now the current package.
UPDATE: 26 May 2017
Verified this procedure works fine with FreeNAS 11-RC3. No changes were made to the procedure.
UPDATE: 23 November 2018
Updated procedures to include FreeNAS 11.2. The proceduaral changes are purely GUI related, MiniDLNA is installed identical within the jail as the old GUI style.
-Mark
It appears that FreeNAS has no plans to incorporate a simple DLNA server for FreeNAS 9.3 and later so this thread contains detailed instructions to install MiniDLNA in a jail, your other option is to use Plex which does have a very good built in DLNA server.
This thread is for those folks who want to manually install MiniDLNA into a jail and I will give you step by step instructions to achieve that.
One thing to note, this is only to restore MiniDLNA functionality and nothing more since the Plugin was removed from FreeNAS. MiniDLNA does have some limitations which I cannot get past as MiniDLNA was a port from Linux, and FreeBSD and Linux are not the same thing. If MiniDLNA doesn't do it for you then I suggest installing Plex Media Server and using the built in DLNA server.
There are a few assumptions:
1) Your FreeNAS network is already configured and can access the internet.
2) You have some videos/music ready to be shared on your FreeNAS server.
If you have any issue with a step below, reference the step that worked last and the step you are having issue with. This may sound odd but this is the way to ensure you are provided accurate help.
So lets get started...
UPDATE! I have made some changes with the layout, I wasted to maintain the same numbering system to ensure the steps remained basically the same. If you have a problem then you should be able to read through the thread and if someone had an issue before, it would still relate if they found an answer. I also called the sections of steps by "Old GUI" and "New GUI". Pay attention to what you are doing and it should all go well.
Creating the Jail (Old GUI)
1) You 'should' identify an IP address you will use for the MiniDLNA server or you can use DHCP if you must. For my example I will use 192.168.1.54.
2) In the FreeNAS GUI click on the Jails Icon
3) Click on Add Jail
4) Click on the Advanced Mode button
5) Enter the Jail Name MiniDLNA (Note: You could call it FreeBSD as you can use this jail for much more than just MiniDLNA, but for this purpose we will simply call it MiniDLNA)
6) Now comes the tricky part, do you use DHCP or a static IP address.
a) DHCP: Click DHCP and skip to step 7
b) Static IP Address: Fill in IPv4 address, netmask /24 (255.255.255.0), and default gateway. In my case the values are address: 192.168.1.54, netmask: /24 (255.255.255.0), default gateway: 192.168.1.1
7) Scroll to the bottom of the screen and click OK (Leave Autostart and VIMAGE checked)
8) If this is the first time creating a FreeBSD jail then you will have a large download start up.
9) At the completion you should have a standard jail called MiniDLNA and it lists the IP address of that jail.
Creating the Jail (New GUI)
1) You 'should' identify an IP address you will use for the MiniDLNA server or you can use DHCP if you must. For my example I will use 192.168.1.54.
2) In the FreeNAS GUI click on the Jails Icon
3) Click on Add Jail (Round yellow dot with a "+")
4) Click on the ADVANCED JAIL CREATION button
5) Enter the Jail Name MiniDLNA (Note: You could call it FreeBSD as you can use this jail for much more than just MiniDLNA, but for this purpose we will simply call it MiniDLNA)
a) Select the Release version you desire. AS of this writing I selected "11.2-RELEASE"
6) Now comes the tricky part, do you use DHCP or a static IP address.
a) DHCP: Click DHCP and skip to step 7 (Note: a few options will auto-select for you)
b) Static IP Address: Select "vnet0" for the IPv4 Interface (or whatever option you desire, some work, somoe don't). Fill in IPv4 address, netmask /24 (255.255.255.0), and default gateway. In my case the values are address: 192.168.1.54, netmask: /24 (255.255.255.0), default gateway: 192.168.1.1
7) Select Auto-start.
a) Now scroll down to the bottom of the screen and select "SAVE"
8) If this is the first time creating a FreeBSD jail then you will have a large download start up.
9) At the completion you should have a standard jail called MiniDLNA and it lists the IP address of that jail.
a) Once your jail is running you must Stop it to finish the configuration. On the right side of the jail (those three virticle dots), click it and select Stop.
Adding the Media Folder (Old GUI)
10) On the left panel of the GUI open Jails -> MiniDLNA -> Storage -> Add Storage
11) The first box should say MiniDLNA, leave that one alone
12) The Source you will need to locate your media to share
13) In the Destination box locate and select "/media"
14) 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.
15) Click OK
Adding the Media Folder (New GUI)
10) Click on the right side of the new jail (three verticle dots) and select "Mount points"
11) A new scree opens up called Mount ponts, on the right side is a yellow circle with a "+", click it
12) In Source you will need to locate your media to share
13) In the Destination box locate and select "/media" (Full path would look similar to this: "/mnt/pool/iocage/jails/MiniDLNA/media")
14) 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.
15) Click "SAVE"
a) We must start the jail again. On the left side of the GUI select "Jails"
b) On the right side of the GUI for your MiniDLNA jail select the three virticle dots and select "Start"
SSH into the Jail (Old & New GUI's)
You have several ways to get into the jail and I like to use Putty myself (you must have SSH enabled) but for this example we will use the built in GUI Shell. You can use the PASTE in the shell if you want to cut and paste the below commands if there is any doubt about spaces or format issues.
16) In the left hand pane select Shell and select the maximum window size you can read, for my screen it's 132x43.
17) Type "jls"
18) You should see a listing of jails by JID numbers, assuming JID 1 is MiniDLNA in this scenario...
19) Type "jexec 1 /bin/csh"
20a) Type "pkg install minidlna"
21) At this point MiniDLNA and support files will install
21a) At this point you will be asked to install, upgrade, reinstall, and/or remove software. You must type "y" to continue. This may occur several times and upgrade your FreeBSD jail to support the MiniDLNA program. If you fail to update then you may not have a working network connection.
Configuring MiniDLNA (Old & New GUI's)
22) Type "cd /usr/local/etc/" and you should be in that directory
23) Type "ee minidlna.conf" and you will now be editing the minidlna.conf file
24) Scroll down to the line where it says
Code:
media_dir=/opt
Code:
media_dir=/media
25) Scroll down to the line where it says
Code:
#friendly_name=My DLNA Server
Code:
friendly_name=MiniDLNA Server
26) Scroll down to the line where it says
Code:
#db_dir=/var/db/minidlna
27) Scroll down to the line where it says
Code:
#log_dir=/var/log
28) Press the ESCape key and Enter key twice to Leave and Save the changes.
29) Type "cd rc.d"
30) Type "ee minidlna"
31) Scroll down to the line where it says
Code:
command_args="-P $pidfile -u $minidlna_uid -f /usr/local/etc/minidlna.conf"
Code:
command_args="-R -P $pidfile -u $minidlna_uid -f /usr/local/etc/minidlna.conf"
32) Press ESCape and then Enter key twice to Leave and Save the changes.
Testing MiniDLNA (Old & New GUI's)
33) Type "service minidlna onestart" and you should get a message of Starting minidlna. Now go see if your DLNA compliant viewer can see your content, I use Windows Media Player (WMP) for testing purposes as I don't need to leave the computer when doing this test.
Make the MiniDLNA Run Normally (Old & New GUI's)
Now we must tell MiniDLNA to start when the jail is running.
34) Type "echo minidlna_enable="YES" >> /etc/rc.conf"
35) Type "exit"
36) Type "exit" which will close the shell.
Make the MiniDLNA Run Normally (Old GUI)
37) In the Jails Tab, select the MiniDLNA jail and at the bottom for the screen select Stop. Wait until the jail has stopped before continuing, this could take a minute or two depending on your system, be patient.
38) Verify the MiniDLNA is no longer running by testing your DLNA Device (WMP for me)
39) In the Jails Tab, select the MiniDLNA jail and at the bottom of the screen select Start. Wait about 30 seconds after it starts.
40) Verify MiniDLNA is working now and if it is, you are all done.
Make the MiniDLNA Run Normally (New GUI)
37) On the Jails screen, on the right side of the MiniDLNA jail select the three verticle dots and select Stop. Wait until the jail has stopped before continuing, this could take a minute depending on your system, be patient.
38) Verify the MiniDLNA is no longer running by testing your DLNA Device (WMP for me)
39) On the Jails screen, on the right side of the MiniDLNA jail select the three verticle dots and select Start. Wait about 30 seconds after it starts.
40) Verify MiniDLNA is working now and if it is, you are all done.
1) Reboot your FreeNAS system
2) Stop the MiniDLNA Jail and then Restart it
3) Using a shell/SSH into the jail you can type "service minidlna restart"
4) You can use the script mentioned below only if you have the one Jail as it will stop other jails from running.
If you have any issues running this, before posting a question I request you start over again and use the cut & paste method to enter your commands. I have tested this out and it does work perfectly on "FreeNAS 9.3-STABLE-201505130355". Make sure you post the last step that worked and the step that failed along with the error you are seeing.
UPDATE: 10 January 2015
When you install the minidlna package it will be 1.1.1_5,1 which includes the kqueue support so when you add, delete, or rename a file in your library, the minidlna application will sense that and update the library database. This alleviates the issues of running a separate rescanning script.
UPDATE: 25 May 2015
Steps 20a and 21a were added because the package installer works differently in more recent versions of FreeNAS 9.3 and the FreeBSD jail must be updated. Also the newer version of MiniDLNA (1.1.4_1,1) now apparently supports faithful rescanning of the database, I'm glad kqueue is finally working well.
UPDATE: 1 October 2016
The entire set of instructions were tested with a clean installation of FreeNAS 9.10-1U1 and worked perfectly with one exception, a bug which prevents selecting the DHCP (step 6a). This jail bug has already been reported. Also, MiniDLNA (1.1.5_1,1) is now the current package.
UPDATE: 26 May 2017
Verified this procedure works fine with FreeNAS 11-RC3. No changes were made to the procedure.
UPDATE: 23 November 2018
Updated procedures to include FreeNAS 11.2. The proceduaral changes are purely GUI related, MiniDLNA is installed identical within the jail as the old GUI style.
-Mark
Last edited: