Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Access Linux NFS Share Folders from macOS

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To access a Linux NFS share from macOS, you use the built-in mount_nfs command or the Finder's "Connect to Server" feature. The quickest way is Finder > Go > Connect to Server (Cmd+K), enter nfs://server/share, and click Connect. You'll need the Linux server's IP address or hostname, the exported share path, and network access to the NFS port (2049). No extra software is required—macOS includes NFS client support.

What You'll Need

  • A Linux server with NFS service running and a share exported (e.g., in /etc/exports).
  • The server's IP address or hostname (e.g., 192.168.1.100 or fileserver.local).
  • The exact export path on the server (e.g., /srv/nfs/share).
  • macOS with network access to the server (same LAN or VPN).
  • Optionally, a username/password if the share is secured with Kerberos or an export option like sec=krb5.

Step-by-Step

  1. Find the NFS export path on the Linux server. On the server, run exportfs -v or check /etc/exports to see the shared directory and its options. For example, /srv/nfs/share 192.168.1.0/24(rw,sync,no_subtree_check).
  2. Note the server's IP address. On the Linux server, run ip addr or hostname -I to get its IP. Make sure your Mac can ping it.
  3. Open Finder on your Mac. Click the Finder icon in the Dock.
  4. Go to "Connect to Server". Press Cmd+K or click Go > Connect to Server in the menu bar.
  5. Enter the NFS URL. Type nfs:/// without spaces. For example: nfs://192.168.1.100/srv/nfs/share. If your server uses a hostname, you can use that instead.
  6. Click "Connect". A dialog may appear asking for authentication. If the share is open (no auth), it will mount immediately. If it requires Kerberos, you'll be prompted for your Kerberos ticket (usually via kinit first).
  7. Select the volume in Finder. The share appears under Locations in the Finder sidebar. You can now browse and copy files.
  8. To mount automatically at login (optional): Go to System Settings > General > Login Items, click the + button, and add the mounted volume (it appears as a network volume). Or use the command line: create a launchd plist that runs mount_nfs at login.

Command-line alternative: Open Terminal and run:

mkdir -p ~/mnt/nfs
mount_nfs -o resvport 192.168.1.100:/srv/nfs/share ~/mnt/nfs

This mounts the share to a local folder. To unmount, use umount ~/mnt/nfs.

Common Mistakes

  • Using the wrong export path. The path in the URL must exactly match the one in /etc/exports, not just the server's root directory.
  • Forgetting the nfs:// prefix. Finder will interpret //server/share as SMB, not NFS. Always use nfs://.
  • Port 2049 blocked. macOS uses NFSv3 or v4 on port 2049. If a firewall on the Linux server blocks it, the connection fails.
  • Using NFSv4 with Kerberos without a ticket. If the export has sec=krb5, you must have a valid Kerberos ticket (kinit user@REALM) before mounting.
  • Mounting as root without privileges. Some NFS exports restrict root access. Use a regular user account.

Tips

  • Use a static IP or hostname. If the server's IP changes, the mount breaks. Configure a DHCP reservation or use a local DNS name.
  • Enable NFSv4 if possible. It's more secure and supports locking better than v3. On the server, set vers=4 in /etc/nfs.conf or export options.
  • For large transfers, use rsync over the mount. It's more reliable than Finder's copy for many small files.
  • If you need to reconnect after sleep, unmount and remount. You can create a small script or use an app like Automator to do it automatically.
  • Check permissions. NFS uses the user ID (UID) of the client. If your Mac user's UID doesn't match the Linux user's UID, you'll get permission errors. You can map UIDs in the export options (all_squash, anonuid, etc.).

Troubleshooting

If the mount fails or is not visible:

  1. Ping the server. ping 192.168.1.100. If no reply, check network and firewall.
  2. Check the NFS service on Linux. On the server, run systemctl status nfs-server (or service nfs status). Ensure it's active.
  3. Verify the export is reachable. On the Mac, run showmount -e 192.168.1.100 to list available exports. If this fails, the server's NFS daemon may not be listening or firewall is blocking.
  4. Try mounting with verbose output. In Terminal, run sudo mount_nfs -v 192.168.1.100:/srv/nfs/share ~/mnt/nfs. Look for error messages like "Permission denied" or "No such file or directory".
  5. Check macOS firewall. Go to System Settings > Network > Firewall. Ensure it's not blocking NFS (port 2049). You may need to allow incoming connections for mount_nfs.
  6. If you get "Operation not permitted", it's often a UID mismatch. On the Linux server, check the export options in /etc/exports. Add insecure if the client uses a port above 1024 (macOS does). Restart NFS after changes: sudo exportfs -ra.
  7. If the share mounts but is read-only, check the export options (rw vs ro) and the filesystem permissions on the server.

Frequently Asked Questions

Can I use NFS with macOS over the internet?

Yes, but it's not recommended due to security. NFS has no built-in encryption. Use a VPN or SSH tunnel instead.

Does macOS support NFSv4?

Yes, macOS supports NFSv3 and NFSv4. The Finder's Connect to Server will negotiate the highest version supported by both sides.

How do I unmount an NFS share?

In Finder, click the eject icon next to the volume. In Terminal, run umount /path/to/mountpoint.

Why do I get "Permission denied" when I try to access files?

Usually because the UID of your Mac user doesn't match the UID of the file owner on the Linux server. Check the server's export options for all_squash or use anonuid to map to a specific user.

Can I mount an NFS share at startup automatically?

Yes, you can add a login item in System Settings > General > Login Items, or use a launchd agent that runs the mount command at login.

Is there a GUI way to manage NFS mounts?

Finder's Connect to Server is the built-in GUI. Third-party tools like NFS Manager exist, but the built-in method is sufficient for most users.