Mac Nfs Server
In Mac OS X, you can connect to servers that use the AppleShare, SMB, WebDAV, and NFS protocols.
The NFS protocol uses ports 2049 and 111,2 2049 is for the NFS daemon itself, while 111 is used by 'portmapper', part of the remote procedure call mechanism. And the Mac's built-in firewall blocks these by default. Open 'System Preferences, Sharing', and go to the 'Firewall' tab. First of all, I'm happy to pay the $19.99 for the Mac OS Server app from the app store, so that's no problem, it's just that at the moment I only have one specific need - NFS sharing between my macOS sierra host and a virtualbox VM guest running Debian Sarge (don't ask). Set up sharing on your PC. To get this going, make sure your PC is set up for file sharing.In Windows, choose the folder you want to access from your Mac, and right-click to get to its Properties. The native Windows network file sharing protocol is the preferred protocol for Windows clients. AFP AFP is clearly superior to SMB or NFS for Mac OS 8.1-OS X 10.8 clients AFP is the native file and printer sharing protocol for Macs and it supports many unique Mac. NFS is the best way to share files and directories over the network between Mac and Linux workstations. This article provides instructions on creating NFS shares in Mac OS X 10.5 or higher.
Mac file sharing (AppleShare)
To connect to an AppleShare server:
- With the Finder active, from the Go menu,select Connect to Server.... Alternatively, with theFinder active, press
Command-k
. - In the
Connect to Server
window that opens, type the fully qualified domain name (FQDN) or IP address of the server. Click Connect. - In the authentication window that appears, type your username andpassword for the server. If the volume has guest access, selectGuest instead. Click Connect.
- Select the volume of the server and click OK.
Windows file sharing (SMB)
Note: Because SMB traffic at Indiana University isfiltered, you may not access campus SMB servers from off campus unlessyou are using VPN.
Nfs Share Macos Mojave
To connect to an SMB server:
- With the Finder active, from the Go menu, selectConnect to Server.... Alternatively, with the Finderactive, press
Command-k
. - In the
Connect to Server
window that opens, next tothe 'Address:' field, typesmb://
, followed by thefully qualified domain name (FQDN) or IP address of the server, aforward slash, and then the name of the shared volume (e.g.,smb://bl-dept-server.ads.iu.edu/share
).Note: Windows server administrators should havereverse DNS registration for Windows servers accessed by Mac or Unixsystems.
- Click Connect.
- In the authentication window that appears, type your username andpassword for the server. You may also be asked to specify the domainwhere the server is located. For most servers at IU, use
ADS
. Click OK.
WebDAV
Mac Nfs Client
To connect to a WebDAV server:
- With the Finder active, from the Go menu, selectConnect to Server.... Alternatively, with the Finderactive, press
Command-k
. - In the
Connect to Server
window that opens, type theURL of the WebDAV shared volume (e.g.,http://server.address/
). - Click Connect.
- In the authentication window that appears, type your username andpassword for the server, and then click OK.
NFS
To connect to an NFS server:
- With the Finder active, from the Go menu, selectConnect to Server.... Alternatively, with the Finderactive, press
Command-k
. - In the
Connect to Server
window that opens, next tothe 'Address:' field, typenfs://
, followed by thefully qualified domain name (FQDN) or IP address of the server, aforward slash, and then the path of the exported share (e.g.,nfs://foo.com/home/u/jdoe
). - Click Connect.
Note: These instructions are for Mac OS X Version 10.6 (Snow Leopard) and later releases only. An earlier version of the article discussed Version 10.5 (Leopard)
To mount a QNAP Turbo Station NFS share from OS X, follow these steps:
- Start Finder, and go to Applications / Utilities / Disk Utility.
- Select File / NFS Mounts... from the menu bar.
- Click the '+' icon at the bottom left of the NFS Mounts window.
- Enter your Turbo Station's NFS URL, following the format of the example in the dialog.
- Under the URL, enter the mount location. A convenient place is under /Volumes. For instance, if you entered the URL as nfs://myserver/Public, enter /Volumes/Public as the mount location. Note: Don't create the subdirectory; it will be created dynamically when the share is mounted.
- Click the arrow in front of 'Advanced Mount Parameters'. A new text entry box is displayed. Enter:
resvport
.
- Click 'Verify' at the bottom right. Note: This only checks that your Turbo Station has NFS enabled; it doesn't check if the remote NFS URL is correct.
- A popup window should appear, saying 'The NFS server appears to be functional'. Click 'OK'.
- Click 'Save' at the bottom right of the NFS Mounts Window.
- Enter your password to allow Disk Utility to make the changes.
- This completes the process. Your NFS share should appear at the mount location you entered above.
Since Mac OS X 10.8 (Mountain Lion) doesn't offer anymore to mount NFS shares from Disk Utility, manual mount is the only solution under that version.
Here is a Terminal command that permits to mount NFS share without problems, as some arguments are mandatory to make the mout fully MacOS compliant:
sudo mount -o rw,bg,hard,resvport,intr,noac,nfc,tcp myserver:/sharedirectory /Volumes/sharedirectory/
enter your machine admin password, and voilà.
- list of major options used:
- rw for read and write permission
- resvport (explanation in discussion)
- nfc permits to your finder to handle the UTF-8 NFC coding of Linux and Windows instead of Apple UTF-8 NFD (well explained on G**gle), if not used any file or directory named with accents maybe unseen by the finder (where still okay under a terminal session !)
Discussion
By default, Mac OS X connects to an NFS server from a 'non-privileged' TCP/IP port, that is, ≥ 1024. However, the Turbo Station only accepts connections from a 'privileged' TCP/IP port, ≤ 1023. The 'resvport' option in the setup causes Mac OS X to use a privileged port.
If you don't specify the 'resvport' option, you will be unable to connect to the Turbo Station. If you use a Terminal CLI, and issue ls /Volumes/Public
, for instance, the HDD and LAN lights on the Turbo Station will blink, and the Mac will display the error message 'Operation not permitted'.
Many online documents refer to the '-P' mount option, but according to the mount_nfs(8)man page, this is 'highly discouraged'. The 'resvport' option should be used instead.
Mac Os Nfs
It's unclear why the Turbo Station only accepts connections from 'privileged' ports. In past decades, this was considered to be a security feature, as only the administrator of a shared computer could allow connections from such ports. Nowadays, in a domestic or SME environment, each user of a computer is their own administrator.