Solved NFSv4 and VLC

NFS arrangement worked prior w/ linux NFS v4 server. Moved file server over to FreeBSD recently. This has been just a painful experience.

I can mount the FreeBSD hosted NFSv4 share on Linux and MacOS with these settings. Contents of locations are visible and accessible.

Any mount attempts from a mobile device on the same network, for example an android tablet mounting a share in VLC, does not produce an error in /var/log/messages. No error indications are given on the mobile device. The mount point shows empty contents.
I have verified I'm using the correct network location and share name on the mobile device.

I've hit that wall here. What change is needed to get NFS share contents accessible from a mobile device on the network?

uname -ar
FreeBSD server.home.arpa 14.2-RELEASE-p1 FreeBSD 14.2-RELEASE-p1 GENERIC amd64


from /etc/rc.conf
Code:
...
#####
# NFS
nfs_server_enable="YES"
nfsv4_server_enable="YES"
nfs_server_flags="-t -u -n 4 -h 10.10.10.59"
nfsuserd_enable="YES"
nfsuserd_flags="-manage-gids -usertimeout 15 4"
# allow mounting from mobile devices (default plus '-n')
# https://forums.FreeBSD.org/threads/access-denied-by-server.93424/post-654993
mountd_flags="-r -S -n -h 10.10.10.59"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
...

from /etc/sysctl.conf
Code:
...
## set minimum as nfsv3
vfs.nfsd.server_min_nfsvers=3
# https://forums.FreeBSD.org/threads/help-with-nfs.96593
vfs.nfsd.async=1
# workaround for panic when amd(8) on the client does an ls on large nfs dir.
vfs.nfsd.fha.enable=0
# https://forums.FreeBSD.org/threads/help-with-nfs.96593/post-687794
vfs.nfsd.v4openaccess="1"    # Enable Linux style NFSv4 Open access check
vfs.nfsd.linux42server="1"    # Enable Linux style NFSv4.2 server (non-RFC compliant)
vfs.nfsd.flexlinuxhack="1"    # For Linux clients, hack around Flex File Layout bug

/etc/exports contents similar to actual
Code:
# /etc/exports: NFS file systems being exported.  See exports(5).
/share/A    -mapall=nobody -alldirs
/share/B    -mapall=nobody -alldirs
/share/C    -mapall=nobody -alldirs
V4: /share
 
Circling back...
Having received no replies, I had to get creative in my web search query.

I ended up on an insightful, and quite helpful, kodi wiki page that detailed settings needed for NFS sharing from FreeBSD.
I was able to correct my settings to get Android VLC to see contents of the NFS share...finally.

It is frustrating to go through the handbook to set something up and it doesn't work. Despite limiting web searches to something within the last year, I end up in the forums with suggestions that, in hindsight, might have helped a user at the time but not exactly current good practice.

Once I cleared out suggestions from forums, think "less is more", everything just worked.

For completeness, details from the kodi wiki:
NFS sharing from FreeBSD

This will get you going with NFSv3. Edit rc.conf:

nfs_server_enable="YES"
rpcbind_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
weak_mountd_authentication="yes"

Edit /etc/exports (change to network as required):

/path/to/share -alldirs -maproot=root -network=192.168.1.0/24

After that you can reboot or start the daemons:

service rpcbind start
service nfsd start
service mountd start
 
Back
Top