Turris Omnia Minidlna

 

Turris Omnia: Setting up LXC container with minidlna


Turris Omnia comes with preinstalled minidlna service. However I have encountered an issue that the service did not do automatic reindex. Workarounds such as remove the db, and restart service were not acceptable. It is pretty simple to configure the minidlna service in LXC container where a functional version can be ran.

Configure the LXC container OS

I have done this via the turris luci UI. Alpine linux 3.1 was chosen, but most will do.

Attach to the newly created container (I will use name minidlna) and do:

# echo "minidlna" > /etc/hostname
# apk add minidlna

Prepare the directory with the media files. The disk is going to be mounted from the host, and provided to the conainer

# mkdir /nas

Increase number of the inodes
# vim /etc/sysctl.conf

by making sure this line is added
fs.inotify.max_user_watches=32768

Configure the minidlna

At minimum you want to configure where the media files are located.

For exapmle:
$ vim /etc/minidlna.conf
media_dir=V,/nas/Movies

Make sure the service is started after reboot, in Alpine linux, use the rc-status command.
You may check the status by
# rc-status

And enable the service by
# rc-update add minidlna default

Setup the host system


On the host operating system, configure the minidlna container. Assuming that the containers are located at /srv/lxc, and that the media disk is already mounted at /mnt/nas :

# vim /srv/lxc/minidlna/config
and add the line
lxc.mount.entry = /mnt/nas nas none ro,bind 0 0

Also make sure that the system minidlna that comes with the Turris OS does not start:

#  /etc/init.d/minidlna disable


Start it all


After this, attach again to the minidlna lxc container and start the service:
# /etc/init.d/minidlna start

For troubleshooting, observe the log at:
tail -f /var/log/minidlna/minidlna.log


Comments

Popular posts from this blog

Controlling servo with RPi3B+

Turris Omnia and Home Assistant in LXC Container