docker-nfs-server
docker-nfs-server copied to clipboard
Shares are not discoverable
I use this container to share my media directories with Kodi that runs on a Raspberry Pi on LibreELEC.
I have tried several share configurations and cannot make the directories discoverable.
From what I've found on the interwebs, I think it needs to have the Avahi daemon running and added a service for NFS, like this:
<service-group>
<name replace-wildcards="yes">NFS share on %h</name>
<service>
<type>_nfs._tcp</type>
<port>2049</port>
<txt-record>path=/exports</txt-record>
</service>
</service-group>
Enabling the avahi daemon on this image just results in some warnings and it exits:
bash-4.3# avahi-daemon
Found user 'avahi' (UID 86) and group 'avahi' (GID 86).
Successfully dropped root privileges.
avahi-daemon 0.6.32 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
dbus_bus_get_private(): Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
WARNING: Failed to contact D-Bus daemon.
avahi-daemon 0.6.32 exiting.
The share options I've tried are:
rw,fsid=root,no_subtree_check,nohide,insecure
rw,sync,no_root_squash,no_all_squash,no_subtree_check,nohide,insecure
rw,no_subtree_check,nohide,insecure
rw,sync,no_root_squash,no_all_squash,no_subtree_check
None of these seem to enable the auto discovery.
I've asked for help on the LibreELEC forum, but got no reply.
I'd love for this image to have that option, but I'm not sure what else to try.
Hi @ovidiub13
I have a very similar setup ;-) I mounted the nfs shares in Kodi like this and have Zeroconf enabled in Kodi(GUI) as well. I have avahi running on the docker host (not in the image).
hope this helps. good luck
this is my storage-movies.mount file
[Unit]
Description=mount movies nfs-storage
# if we do network mounts like here we *require* 'network-online.service'
# which checks if the network is online
Requires=network-online.service
# our scripts must start *after* 'network-online.service', on timeout and if
# 'network-online.service' fails we can not mount and this scripts fails too
After=network-online.service
# usually we mount networks shares because we want they avaible *before* XBMC starts.
# so XBMC has access to this mounts from beginning. Note: this slows down the boot!
Before=kodi.service
[Mount]
# The share we want mount
What=192.168.80.200:/nfs/movies
# Where we want mount this share
Where=/storage/movies
# Any options you usually use with the "-o" parameter in the mount command
Options=rw,nfsvers=3,nolock,proto=udp,port=2049
# filesystem type
Type=nfs
[Install]
# The target is used by 'systemctl enable <name_of_this_file.mount>' to link
# this service to a runlevel for starting on boot. usually 'multi-user.target'
# is ok here.
WantedBy=multi-user.target
# Important:
# this file must be renamed to <mountpoint>.mount where <mountpoint>, is the FULL path
# where the share will be mounted but slashes "/" MUST BE REPLACED with dashes "-" with .mount
# as extension.
# This means, if we want mount to "/storage/movies2" (see above "Where=/storage/movies2")
# then this file must be renamed to 'storage-movies2.mount' and can be enabled via ssh with the
# command 'systemctl enable storage-movies2.mount'
That's another way to do it, though not the recommended "Kodi way". See the warning on the top of the wiki page you've sent.
Currently if I use the native Kodi browser, and search for NFS shares, it doesn't find any. But If I manually enter the URLs, I can access the directories just fine. So it's just a matter of discovery.
I could add my shares manually, but there are quite a few of them, and each one requires different settings on Kodi.
AFAIK, having Avahi on the host, doesn't help the NFS share from a container in any way, since that Avahi is not aware of the share inside that container. And it shouldn't be. Unless you hacked something to make it work.
Have you tried disabling D-Bus?
sed -i 's/#enable-dbus=yes/enable-dbus=no/g' /etc/avahi/avahi-daemon.conf
AFAIK, having Avahi on the host, doesn't help the NFS share from a container in any way, since that Avahi is not aware of the share inside that container.
Avahi doesn't need to be aware of anything. It just announces the services you tell it to announce.
The container needs to expose the appropriate port(s) to the host. AND the host needs to expose the appropriate port(s) to the network.
You could even run an avahi-container to announce all the services running on the host in different containers.