by Kyle D'Addario
& Wincent Colaiuta
Making NFS Work On Mac OS X
July 23rd, 2001
In my last Hot Cocoa column I talked about using Samba and Sharity to share files between Mac OS X and Windows. At the end of that column I promised that I'd take Mac OS X's NFS (Network File System) through its paces. Well things move fast in the world of computing and this was amply demonstrated during Steve Jobs's Wednesday morning keynote at Macworld New York. Of most interest here is the announcement made during the keynote, and which you can hear for yourself if you watch the Webcast, that Mac OS X 10.1 will include an integrated SMB client. Before I get into discussing NFS there's a few comments that can be made about this announcement.
Not only did Jobs announce that AFP servers would now be accessible over AppleTalk (thus bringing backwards compatibility with a large number of older server setups) but he had the following to say about Samba:
We have a built-in SMB client which means that if you hook Mac OS X up to a Windows network the other Windows machines and all the Windows servers will see that Mac OS X machine as just another first-class Windows citizen on that network.
So in one fell swoop Jobs obviated the need for products like Sharity by Objective Development (described in my last column), which provides transparent access to Windows fileshares using the Samba/SMB/CIFS protocol. Given that 10.1 is slated for September release, it may be that Sharity's days are numbered. Even the easier-to-use commercial offering of Dave from Thursby may be relegated to a niche position.
It's been an event-filled week in the world of networking for Mac OS X because just prior to Jobs's announcements, Thursby released a free preview version of Dave that permits machines running Mac OS X 10.0.4 to act as clients and servers on a Windows network. It is not clear from the keynote whether Apple's own SMB solution will include a server in addition to the client. (Mac OS X Server already has this capability, so there is a chance that similar functionality could be included in Mac OS X 10.1.) In the meantime however, users are able to turn to Dave or alternatively install the free, open source Samba server software (described in my last column). When the final version of Dave is released it will support not only file sharing, but network printer sharing also. Apple's announcement does not indicate whether Mac OS X 10.1's SMB capabilities will extend beyond file sharing to printer sharing as well, so there is a chance that there may still be a place for Dave in the corporate networking environment.
This is a very interesting moment in the evolution of the Mac OS. One of the major barriers to adoption of the Mac platform in the commercial arena is the raft of interoperability issues that have plagued it from the very beginning. Microsoft Windows dominates the market share stakes and consequently tends to dictate the standards and protocols that will be used. Until Mac OS X, Macintosh advocates had their work cut out for them trying to convince buyers that Apple hardware and software would interoperate smoothly in the PC-dominated world of business. An important step was taken towards resolving this problem with the release of Mac OS X this March. No longer did the Mac depend on third-party, commercial solutions. Many networking standards were built-in to the OS itself (FTP, HTTP, NFS and SSH to name a few) and others (like Samba/SMB/CIFS) were only a free download away. Mac OS X 10.1 represents another step -- an even more significant one -- wherein the tools needed to share files with Windows machines will be even closer than a "download away"; they'll be integrated into the OS from the very beginning. I believe that this is a critical turning point and it can only see the Mac market share begin to grow in the corporate arena. Mac OS X is indeed the world's most advanced operating system: at the moment the foundations are there and it's only the polish, and the applications, that are lacking. It will be very interesting to watch the course of the OS as it matures and grows over the next five to ten years.
Putting aside our oracular musings for a moment, if we examine Mac OS X as it stands today we see that it is already a very capable platform for operating in a networked environment. Support for NFS -- the "Network File System", and the dominant standard in most Unix environments -- is built-in to the OS and has been since the public first got their hands on Mac OS X in the form of the Public Beta. If you want to share your files with a Linux or a FreeBSD or a Solaris machine (or any other Unix for that matter) then you'll probably want to use NFS.
The tools to get NFS up and running are built-in to every copy of Mac OS X but their configuration can be a little arcane, so I'm going to describe how NFS can be set up using a little utility called "NFSManager" by Marcel Bresink. NFSManager comes in the form of an 826KB download, and the demonstration version of the program is fully functional. Licences cost $15.
As we found when we configured users and groups under Mac OS X we'll see that configuring NFS on Apple's new OS requires us to manipulate information in the computer's NetInfo database. This is a significant change from most other Unix platforms because configuration information is stored in a centralized database instead of in the conventional "flat" text files that are traditionally used (many of these legacy files can be found in the /etc directory). NFSManager hides all of this behind the scenes by abstracting things into an easy-to-use graphical interface; for this reason it will be a welcome addition to the toolkit to the NFS newbie as well as to the hard-core flat-file Unix veteran. Perhaps Marcel's own description best describes what NFSManager is and does:
NFSManager is a small tool for easy access to the NFS features of Mac OS X. As an operating system with a Unix core, Mac OS X is able to support the Network File System (NFS) protocol according to internet specification RFC 1094. NFS is the accepted industry standard for sharing files between Unix systems.Although NFS is a built-in component of Mac OS X, users cannot access this feature without special knowledge and use of the command-line. NFSManager solves this problem by providing an easy-to-use Aqua interface for the definition of NFS connections.
There are two pieces of NFS terminology that we'll need to be familiar with before we continue: "mounts" and "exports". Mounts are folders or files that we retrieve from other machines on the network and which we access from the local machine. To create and use mounts we will be using an NFS client. Exports are folders or files that we make available to other machines on the network. To create and share exports we will be using an NFS server. Both client and server are included with Mac OS X.
Setting up an export
Setting up an export is quite easy with NFSManager. After clicking on the padlock and entering our administrator password we just use the "Add" button under the "Exports" pane. Most of the options in the ensuing dialog are self-explanatory. We select the item that we wish to share across our network. We can choose to make it available to any machines (this is called sharing with the "world") or we can specify particular machines or subnets. We can also opt to change the user access privileges by granting root access (universal, read-everything privileges) or running as user "nobody" (for restricted access privileges). We can grant write access if we so desire, or keep things "read only". Finally we can export entire filesystems at a time if we wish.
Once we've set things up we just close the export window and save the changes.
Setting up a mount
Establishing a mount is much the same as creating an export. We once again use the "add" button, this time under the "Mounts" pane. Under "Directory to import" we enter a description of the server and share that we wish to mount of the form: "server:/share". As an example, if I want to share the "/home" directory from an NFS server on my network located at "192.168.0.1" then I will enter the following string in the space provided:
There are two ways of setting up mounts. If we set them up using the "Display as server connection" option then we'll have to reboot in order to see them. They will appear in the Finder under "Network/Servers". Alternatively, we can specify "Static Mounts" and these will appear without a reboot. In this case we need to specify a path were we wan the files to appear. The default path is "/mnt".
Once you've set up your mounts and exports you need only select "Activate changes" from the NFS menu in NFSManager. Your static mounts and exports will become instantly available. It's beyond the scope of this article to talk about how to set up other Unix boxes on your network -- the steps required will vary depending on the OS in use; Linux, FreeBSD, Solaris, or others.
It is quite easy nevertheless to test out your Mac OS X setup by connecting to another Mac OS X machine nearby, or easier still, by using the "localhost" feature of Mac OS X. Using this feature you can run an NFS server on your own machine and connect to it from that same machine by specifying "localhost" as the server when preparing a Mount. For example, in testing my own machine I exported my "Library" folder and then mounted it over NFS by specifying "localhost:/Library" when I added the mount. Having verified that this was working I was then able to go to another machine on my network -- a FreeBSD server -- and mount the Library folder on that machine too.
Thanks to the power of NFS, Mac OS X is interoperable with an entire flotilla of Unix operating systems in a way that was never possible under Mac OS 9. Steve Jobs's announcement that SMB capabilities will be built into Mac OS X 10.1 is another critical support in making Mac OS X the most advanced operating system in the world today. And all this from an operating system that is still in its beginning stages -- imagine what we'll be able to do five years from now...
Wincent Colaiuta - [email protected]
You are encouraged to send Richard your comments, or to post them below.
Most Recent Hot Cocoa Columns
Mac OS X & Firewalls: Part One - The Basics
Console Yourself: Understanding Mac OS X Logs
Making NFS Work On Mac OS X
Hot Cocoa Archives
Back to The Mac Observer For More Mac News!
Kyle D'Addario is the assistant editor of The Mac Observer and has logged about as much time on Mac OS X as is humanly possible. Kyle studies Computer-Mediated Communication, whatever that is, at the graduate level, and was a founding member of the original Webintosh team.
Wincent Colaiuta runs Macintosh news and criticism site, wincent.org, and joined The Mac Observer team as a contributor in March 2001. He has worked with computers since 1984, and his interests in that area include Macs, PHP programming and security.