3

I'm attempting to get OSX to NFS mount to my Linux NFS server, which is a VM guest on the OSX machine. The point here is to allow reverse file system connectivity from the parent host to the VM as I already have the reverse set up through the hypervisor. My OSX uid/gid is 501/20. My Linux uid/gid is 1000/1000.

On this mac (nfs client) (Catalina 10.15.7) is set to automount the NFS mount:

in /etc/auto_master

#
# Automounter master map
#
...

# for linux nfs
/System/Volumes/Data/Users/<user>/linux   auto_nfs     -nobrowse,nosuid

in /etc/auto_nfs

/System/Volumes/Data/Users/<user>/linux rw,proto=tcp,hard,vers=4,resvport  nfs://vmlinux:/home/<user>

On Linux (NFS server) in /etc/exports

/home/<user>   <address of OSX> (rw,all_squash,anonuid=1000,anongid=1000,sync,no_subtree_check)

OK, so here's the problem. The NFS connection gets created:

automount -cv
$ automount -cv
automount: /System/Volumes/Data/net updated (/net -> /System/Volumes/Data/net)
automount: /Users/<user>/linux mounted
$ mount
/dev/disk1s5 on / (apfs, local, read-only, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk1s1 on /System/Volumes/Data (apfs, local, journaled, nobrowse)
/dev/disk1s4 on /private/var/vm (apfs, local, journaled, nobrowse)
map -hosts on /System/Volumes/Data/net (autofs, nosuid, automounted, nobrowse)
keybase-redirector on /Volumes/Keybase (kbfuse, read-only, synchronous, nobrowse)
/dev/disk2s1 on /Volumes/Untitled (ufsd_ExtFS, local, nodev, nosuid, noowners)
map auto_nfs on /Users/<user>/linux (autofs, nosuid, automounted, nobrowse)

The problem is the path is neither readable (mode 555) nor usable:

$ ls -ltdr ~<user>/linux
dr-xr-xr-x 2 root wheel 1 Oct 16 16:23 /Users/<user>/linux
$ ls -ltr ~<user>/linux
ls: cannot open directory '/Users/<user>/linux': Input/output error

How do I fix this?

Jim
  • 994
  • 2
  • 9
  • 16

1 Answers1

0

I have not been able to get this mount to work using automounter. However, mounting the NFS share manually works like a charm, so I simply decided to add the mount to /etc/fstab (non-automounted) and I'll just mount it when needed using sudo. From all that I've read, OSX auto-mounter is garbage, anyway. gj Apple!

$ echo '<nfs_server_addr>:/home/<remote_user> /System/Volumes/Data/Users/<mac_user>/linux nfs rw,resvport,proto=tcp,intr,nfc,timeo=900,noauto' | sudo tee -a /etc/fstab

$ sudo mount /System/Volumes/Data/Users/<mac_user>/linux
Jim
  • 994
  • 2
  • 9
  • 16