Solved FreeBSD NFSv4 Share - For macOS

Hello everyone,
I am currently having trouble sharing NFSv4 files:

1 -> When trying to mount on macOS, I can access normally.
2 -> However, when I try to access the sharing via cell phone (Kodi, VLC), via wireless, I can't.

My settings are in accordance with: NFSv4 documentation, Exports documentation

/etc/exports:
V4: / -sec=sys
/storageNAS/PublicShare -alldirs -maproot=root
/usr/src/PrivateShare -alldirs -maproot=root


/etc/rc.conf:
Bash:
nfs_server_enable="YES"
nfsv4_server_enable="YES"
 
Last edited:
2 -> However, when I try to access the sharing via cell phone (Kodi, VLC), via wireless, I can't.
Look up the error messages in the log files and report them. You may even be able to fix the issue with the hints in the logs.
 
Look up the error messages in the log files and report them. You may even be able to fix the issue with the hints in the logs.

Understand...
Thanks for the tip!

Another thing, when I try to do NFS from a Linux terminal, I get denied permission.

A question:
For home use, media consumption and more, what would you recommend: NFS or SAMBA?
 
Depends on the client. For Windows clients Samba will work a lot better.
Thanks for the answer!
A clean installation of FreeBSD 12.1 RELEASE and, following all the steps of the recording, it is now no longer possible to run NFSv3/4, run in any way
Windows, it seems, does not support SAMBAv4; maybe SAMBAv4 is v4 and v3 at the same time, I haven't really researched it yet, but I will...
My client is macOS, AndroidTV and other devices running Android/iOS.
 
I am using ZFS, in this case, should I release some flag for ZFS to support NFS sharing
That shouldn't be needed. As far as I know you only need this if you're going to be using the Windows ACLs on a Samba share. I don't have anything special in smb4.conf, I only use "simple" sharing, no complex ACLs or anything like that. For my shares at home I don't need anything fancy.
 
That shouldn't be needed. As far as I know you only need this if you're going to be using the Windows ACLs on a Samba share. I don't have anything special in smb4.conf, I only use "simple" sharing, no complex ACLs or anything like that. For my shares at home I don't need anything fancy.

My FreeBSD server is configured as follows, for NFS:
etc/exports:
V4: / -sec=sys
/usr/src/private /storage/public -alldirs -maproot=root


etc/rc.conf:
Bash:
samba_server_enable="YES"
rpcbind_enable="YES"
nfs_server_enable="YES"
nfsv4_server_enable="YES"

However, when I try to set up sharing for some macOS client for example, he says that I don't have permission (permission denied)... :-/
 
Note that Samba has its own user database (and passwords). As for NFS you get this if you try to mount something that isn't exported or if your NFS client isn't using a privileged port.
 
I asked for help on the forum, and you're teaching me how it works on FreeBSD, thank you very much!

I don't understand what I'm doing wrong; I've already uploaded all the services needed to run NFS Server, the settings are OK, but I don't understand why the first time I tested NFS, I was able to share with macOS and Linux clients, but now I can't share with anyone else...
 
1. rpcbind is not needed for NFSv4
2. You also need to run "nfsuserd"

nfsuserd_enable="YES"
nfsuserd_flags="-manage-gids -domain YOURNFSDOMAIN -usertimeout 60 4"

(usertimeout 60 = timeout cached user uid/gid information after 60 minutes, 4 = start 4 'servers' (increase if you have many clients))

3. On the Mac, create a /etc/nfs.conf file:

nfs.client.default_nfs4domain=YOURNFSDOMAIN
nfs.client.mount.options=vers=4,acl,nfc

(Replace "YOURNFSDOMAIN" with some unique string for your site. All NFSv4 server & clients need to have the same string or user & group names will not be correctly handled).

Beware that MacOS' NFS implementation has a number of problems. If you ever try to use "sec=krb5" it _will_ cause your Mac to spontaneously reboot (when the kerberos ticket expires). But since you are using sec=sys you are safe from that bug atleast.
 
1. rpcbind is not needed for NFSv4
2. You also need to run "nfsuserd"

nfsuserd_enable="YES"
nfsuserd_flags="-manage-gids -domain YOURNFSDOMAIN -usertimeout 60 4"

(usertimeout 60 = timeout cached user uid/gid information after 60 minutes, 4 = start 4 'servers' (increase if you have many clients))

3. On the Mac, create a /etc/nfs.conf file:

nfs.client.default_nfs4domain=YOURNFSDOMAIN
nfs.client.mount.options=vers=4,acl,nfc

(Replace "YOURNFSDOMAIN" with some unique string for your site. All NFSv4 server & clients need to have the same string or user & group names will not be correctly handled).

Beware that MacOS' NFS implementation has a number of problems. If you ever try to use "sec=krb5" it _will_ cause your Mac to spontaneously reboot (when the kerberos ticket expires). But since you are using sec=sys you are safe from that bug atleast.

Nice man ... That was very good, thank you very much, from the heart; you solved my problem simply and consciously ... Sorry for the delay in answering and testing you, the university is consuming all my time.
Captura de Tela 2020-06-13 às 05.24.35.png
 
1. rpcbind is not needed for NFSv4
2. You also need to run "nfsuserd"

nfsuserd_enable="YES"
nfsuserd_flags="-manage-gids -domain YOURNFSDOMAIN -usertimeout 60 4"

(usertimeout 60 = timeout cached user uid/gid information after 60 minutes, 4 = start 4 'servers' (increase if you have many clients))

3. On the Mac, create a /etc/nfs.conf file:

nfs.client.default_nfs4domain=YOURNFSDOMAIN
nfs.client.mount.options=vers=4,acl,nfc
Do you have any idea about Monterey?
For years and years, I just mounted the NFSv4 volume fine from my FreeBSD to my Mac laptop using the finder command-k. With Monterey (and your above settings), the directories show up and I can see the files, but opening a file will always fail with an I/O error on the client:

Code:
cat: notes.txt: Input/output error

And the file ownership shows as nobody/nobody instead of my own user name like it used to.
 
Back
Top