Running minidlna on Ubuntu

I have a dumb TV. It’s still quite nice, just no streaming anything to it. I am in the process of picking a device to do the streaming and want to have a folder on my Ubuntu PC that holds the media.

I installed a service called minidlna which is supposed to allow streaming of media. However, it didn’t like the permissions on my chosen folder.
The path is /media/jw/DRIVE2/general.

I had a few problems setting it up:


jw@FooPC:~$ sudo service minidlna restart
* Restarting DLNA/UPnP-AV media server minidlna
[2014/07/23 21:03:30] minidlna.c:594: error: Media directory "/media/jw/drive2/general" not accessible [Permission denied]

I first pointed it to a folder in my home folder and it liked that just fine, but not the 2nd drive that holds the media.

So I tried setting the user as me in the conf file and in the default file. But eventually I had to set the user as “root” to make it work.

HOW TO SET IT UP
The service is controlled by 2 files:
/etc/default/minidlna (sets WHO the service runs as)
/etc/minidlna.conf (sets WHICH FOLDERS to use AND who is using the service)

Here is how to set up the folder locations in the minidlna.conf file
(I didn’t find the A,P,V part very useful, but show an example of how it is used.)

# Specify the user name or uid to run as.
user=root
.
.
# If you want to restrict a media_dir to a specific content type, you can
# prepend the directory name with a letter representing the type (A, P or V),
# followed by a comma, as so:
# * "A" for audio (eg. media_dir=A,/var/lib/minidlna/music)
# * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
# * "V" for video (eg. media_dir=V,/var/lib/minidlna/videos)
media_dir=/media/jw/DRIVE2/general
media_dir=V,/media/jw/DRIVE3/MOVIES
media_dir=/media/jw/DRIVE3/Tonys
media_dir=/media/jw/DRIVE3/TOONS

Now we set up the minidlna file:


sudo gedit /etc/default/minidlna

# User and group the daemon should run as
USER="root"
#GROUP="minidlna"

I restarted the service and this time there was no error about permissions.


sudo service minidlna restart

I’m probably going to get a WD TV Live box and see if that can see the media share. I’ll update as I go.

UPDATE:
I did get the WD TV Live box and love it. I’m able to stream movies and pics from my computer to the big screen, and it comes with apps like Netflix.

Advertisements

6 thoughts on “Running minidlna on Ubuntu

      • anytime media is added you have to rebuild the minidlna db. from the command line:
        $ sudo minidlna -R
        $ sudo service minidlna restart

        minidlna will rebuild on its own eventually. in the settings as well.

  1. In addition to the service starting, the other two files that control what it shows are

    sudo gedit /etc/default/minidlna (sets *who* the service runs as)

    sudo gedit /etc/minidlna.conf (controls *which* folders)

    In addition to specifying the user as root in both of the files above, be sure to tell minidlna where your folders are located. I’ll update the post to reflect this.

    Here is that section of minidlna.conf on my system. I didn’t find the A,P,V part very useful, but show an example of how it is used.

    # If you want to restrict a media_dir to a specific content type, you can
    # prepend the directory name with a letter representing the type (A, P or V),
    # followed by a comma, as so:
    # * “A” for audio (eg. media_dir=A,/var/lib/minidlna/music)
    # * “P” for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
    # * “V” for video (eg. media_dir=V,/var/lib/minidlna/videos)
    media_dir=/media/jw/DRIVE2/general
    media_dir=V,/media/jw/DRIVE3/MOVIES
    media_dir=/media/jw/DRIVE3/Tonys
    media_dir=/media/jw/DRIVE3/TOONS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s