2

I would like to advertise my NFS shares via Avahi so that I can just browse from multiple machines without having to set it all up, especially when guests come over and I want something automagic.

I am aware most clients will need extra packages (Like nfs-common) installed for it to work. The ideal solution will include instructions for clients as well (if any).

Jorge Castro
  • 71,754
  • This question is best suited for stackoverflow, you would need to developt both a server and client service, the server service would run on the nfs server broadcasting the availability of your "custom nfs" service (using avahai/zeroconf) and providing a list of available nfs exports. The client service would need to identify available "custom nfs" servers, get the shares list and mount them. – João Pinto Jan 01 '11 at 18:10
  • Wait, it's not possible to just advertise NFS shares with zeroconf and have them seen by the file manager? – Jorge Castro Jan 02 '11 at 21:52

2 Answers2

3

My answer to question 18933 actually included an answer for NFS shares (although the question did not explicitly mention NFS): Create a service description file (e.g. nfs.service) in /etc/avahi/services with the following content:

<service-group>
  <name replace-wildcards="yes">NFS share on %h</name>
  <service>
    <type>_nfs._tcp</type>
    <port>2049</port>
    <txt-record>path=/path/to/someshare</txt-record>
  </service>
</service-group>

The port 2049 requires you to use the insecure option in the /etc/exports file, though.

Then it should be possible to use your file manager, navigate to "Networks" and access your share. Unfortunately, The GNOME file manager does not provide support for NFS at the moment (Launchpad Bug #29263, thanks to João Pinto for pointing this out) and the NFS support in the KDE file manager is broken (KDE bug #184997 Now fixed) as well…

2

NFS advertised shares are not handled by gnome-vfs at this time, there is a bug report requesting it: https://bugs.launchpad.net/gnome-vfs/+bug/29263

João Pinto
  • 17,159