Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shares are not discoverable #2

Open
madpipeline opened this issue Feb 21, 2017 · 4 comments
Open

Shares are not discoverable #2

madpipeline opened this issue Feb 21, 2017 · 4 comments

Comments

@madpipeline
Copy link
Contributor

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.

@alingenhag
Copy link
Member

alingenhag commented Feb 21, 2017

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'

@madpipeline
Copy link
Contributor Author

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.

@Mausy5043
Copy link

Have you tried disabling D-Bus?

sed -i 's/#enable-dbus=yes/enable-dbus=no/g' /etc/avahi/avahi-daemon.conf

@Mausy5043
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants