Can't write to Linux NFS share from OSX client

Rather than assign all files to uid 1000, assign all files to your uid on the Mac (run id -u in a terminal to see your uid). While you're at it, do the same for the gid (id -g).


this is what worked for me on MacOS 11.1 BigSur (nfs client), running Ubuntu 20.04 inside VirtualBox VM, using the 'host-only' network for direct connection to the vm. Presumably this would work between two physical machines.

*** note the vm has no firewall enabled because it is a host-only vm running inside my mac. Obviously you need to have ports open on the firewall on the server normally for this.

Macbook (client) is 192.168.56.1 Ubuntu VM (server) is 192.168.56.11

Edit /etc/exports on server:

/home/don     192.168.56.1(rw,sync,no_subtree_check,anonuid=1000,anongid=1000,all_squash)

*** remember to run exportfs -a after editing the /etc/exports file, before running mount over on the mac client.

** id 1000 and gid 1000 is the 'don' user on the ubuntu vm

On the mac:

sudo mount -o resvport,rw -t nfs 192.168.56.11:/home/don /Users/don/ubuntudevnfs

and

sudo umount -t nfs /Users/don/ubuntudevnfs 

resvport on the mac (client) side negates the need for insecure on the server side export.

UID/GID 1000 is the 'don' user on the server, as seen from the mac client: sample text file created on mac client terminal

How it looks on the server: view of /home/don via ssh into the ubuntu vm