The big splash in the Mac community--and the rest of the world--last week was obviously the iPhone. For Mac users, though, the iPhone announcement may have distracted from the really big news: Amit Singh's release of a MacFUSE beta, his port of the Linux FUSE API to OS X. If you're wondering what, exactly, that means, FUSE stands for Filesystem in USErland, and it provides a generic interface that lets the operating system see virtually anything as a filesystem. Historically, adding new filesystem recognition to an operating system has meant modifying the kernel for each new FS. FUSE, though, provides a single interface that filesystem modules use to interface with the OS. Best of all, anything that provides the correct interface can be interpreted as a filesystem. One enterprising Python programmer even developed a script to let users mount their GMail accounts and use the extra space in their accounts to save files.What does this mean for Mac users? A lot. First and foremost, the FUSE NTFS driver seems to work with MacFUSE, so we can finally use NTFS volumes as well as FAT volumes. Web developers and anyone else who manages files via SFTP should rejoice, too. SSHFS (included with the MacFUSE binary) allows users to mount a remote SSH/SFTP directory as if it were a local disk. That means no more synchronizing files with an SFTP client. And while the GMailFS python bindings need a little work, the fixes look trivial, and soon we should all be able to put our extra GMail space to better use.
Amit doesn't think that MacFUSE is ready for production use yet, hence the "b" after the version number, so if you're using it for anything important, make sure you've got backups. If you do run into trouble with it, updates are being released almost daily at the moment. That said, though, my trials of it seem pretty stable. The only issues I've seen have been network related. If the system doesn't get a response to a remote query, it will hang. That can mean the dreaded "Spinning Beachball" in the Finder. In most cases, the problem eventually clears itself. If you're navigating via the shell, a simple Ctrl-C cancels the hanging action.
So how do you get MacFUSE up and running for yourself? Glad you asked.
There are currently two ways to get MacFUSE: Amit's pre-compiled binaries and the compilable source from the Google code repository. The best thing is to compile the source yourself. Amit has said that the binaries are a "one-off" for early adopters who want to try out the port, and he doesn't plan on releasing them regularly. Installing from source also guarantees that you're getting the latest stable code. Furthermore, MacFUSE installs itself to directories under '/usr/local'. If you have already installed any of the libraries it uses via MacPorts, the MacFUSE installer may clobber your current installation. So use the source.
If you do decide to install the compiled binaries, you can skip to Step 11.
Amit has nice directions up at the Google wiki page, if you've used XCode and Subversion before, you may want to head over there and check them out. The rest of us, though, have some work to do.
If you're not familiar with the OS X command line and the way people write about it, anything below that follows a '$' is something you type at the command line in a Terminal.app window. Anything in italics is something you replace with information you supply. For instance, I would write the lines below as:
$ less INSTALL
$ CFLAGS="-D__FreeBSD__=10" python setup.py target
Step 1) Make sure you are logged in as a user that is authorized to administer your computer. You're going to be installing things to system directories.
Step 2) Make sure that you have Xcode installed. It is probably installed on your machine already. Open up a Finder window and click on your primary hard drive. If you see a folder named 'Developer,' you're probably in business. Just to be sure, though, check for '/Developer/Applications/Xcode'. If Xcode isn't there, you can install it from your OS X install disks, or download it from Apple.
Step 3) Get Subversion. Subversion is a versioning system developer use to keep track of projects as they're coding them. It's also any easy way to distribute code to users. If you've ever compiled other open-source projects, you may have already installed Subversion. If not, you need to get it now. If you use MacPorts, a quick 'sudo port install subversion' should give you everything you need. If not, Matthew Porter has made compiled Universal Binaries available. Just double-click the installer as usual.
Step 4) Check out MacFUSE. "Checking out" is what programers call getting the latest version of the code of the subversion repository. It's pretty simple. Just open up a Terminal.app window and do the following (without the quotes):
$ svn checkout http://macfuse.googlecode.com/svn/trunk/ macfuse
That will download the MacFUSE code to a directory called 'macfuse' in your home directory. Now
$ cd macfuse
to switch into the directory you just downloaded.
Step 5) Compile and install the kernel extension:
$ cd fusefs
$ xcodebuild -target fusefs -configuration Release
That will take you to the kernel source directory and compile the source into the working kernel extension. Then,
$ sudo cp -pR build/Release/fusefs.kext /System/Library/Extensions/
$ sudo chown -R root:wheel /System/Library/Extensions/fusefs.kext
These lines move the kernel extension into the proper folder and change it's owner to 'root' which is unix-speak for 'the user that administers the system'. 'sudo' is the unix command to perform an action as root. The system should ask you for your password after you type the first line.
Step 6) Compile and install the other extensions. your browser may wrap the lines in the post, but make sure that each '$' command is typed on one line.
$ xcodebuild -target load_fusefs -configuration Release
$ sudo cp build/Release/load_fusefs /System/Library/Extensions/fusefs.kext/Contents/Resources/
$ sudo chown root:wheel /System/Library/Extensions/fusefs.kext/Contents/Resources/load_fusefs
$ sudo chmod u+s /System/Library/Extensions/fusefs.kext/Contents/Resources/load_fusefs
$ sudo cp -pR fusefs.fs /System/Library/Filesystems/
$ sudo chown -R root:wheel /System/Library/Filesystems/fusefs.fs
$ xcodebuild -target mount_fusefs -configuration Release
$ sudo cp build/Release/mount_fusefs /System/Library/Filesystems/fusefs.fs/
$ sudo chown root:wheel /System/Library/Filesystems/fusefs.fs/mount_fusefs
$ sudo ln -s /System/Library/Filesystems/fusefs.fs/mount_fusefs /usr/local/bin/mount_fusefs
Step 7) Download and install pkg-config. This is a program that helps other programs install themselves. Your individual filesystem drivers will use it later. Download the latest version to your desktop. Once it's downloaded, go back to the Terminal ad do the following. If your browser didn't download the file to the desktop, replace "~/Desktop" below with whatever directory the file downloaded to. The backslashes mean that whatever follows should be typed on the same line.
$cd ~/Desktop
$ tar -xzvf pkg-config*.gz
$ cd pkg-config*
$ CFLAGS="-O -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
LDFLAGS="-arch i386 -arch ppc" \
./configure --prefix=/usr/local --disable-dependency-tracking
$ make
$ sudo make install
Step 8) Download and install FUSE itself. Get the latest version from SourceForge.
$ cd ~/Desktop
$ tar -xzvf fuse-2.6.1.tar.gz
$ cd fuse-2.6.1
$ patch -p1 < /path/to/fuse-2.6.1-macosx.patch
$ CFLAGS="-D__FreeBSD__=10 -O -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
LDFLAGS="-arch i386 -arch ppc" \
./configure --prefix=/usr/local --disable-dependency-tracking
$ make
$ sudo make install
Step 9) Download and install getext and glib. The are two libraries that help programs interact with each other and the OS. You can get gettext from here and glib from here. You can also install them via MacPorts. Again, if you downloaded them to someplace other than the Desktop, change the code below to reflect that.
$ cd ~/Desktop
$ tar -xzvf gettext-0.16.1.tar.gz
$ cd gettext-0.16.1
$ CFLAGS="-O -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
LDFLAGS="-arch i386 -arch ppc -fno-common" \
./configure --prefix=/usr/local --disable-dependency-tracking \
--with-libiconv-prefix=/Developer/SDKs/MacOSX10.4u.sdk/usr
$ make
$ sudo make install
$ cd ~/Desktop
$ tar -xzvf glib-2.12.7.tar.gz
$ cd glib-2.12.7
$ CFLAGS="-O -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -I/usr/local/include" \
LDFLAGS="-arch i386 -arch ppc -L/usr/local/lib" \
./configure --prefix=/usr/local --disable-dependency-tracking
If you are on a PowerPC, you must open up the config.h file in the current directory using TextEdit. Find the line that says
#define G_ATOMIC_POWERPC 1
Add '//' at the beginning to make it read
// #define G_ATOMIC_POWERPC 1
Then, on both PPC and Intel, continue with:
$ make
$ sudo make install
Step 10) Download and install SSHFS. this will be your first FUSE filesystem. It will left you mount remote SSH/SFTP directories as if they are local disks. You can get SSHFS from SourceForge. I'm sure you can guess what comes next.
$ cd ~/Desktop
$ tar -xzvf sshfs-fuse-1.7.tar.gz
$ cd sshfs-fuse-1.7
$ patch -p1 < /path/to/sshfs-fuse-1.7-macosx.patch
$ CFLAGS="-D__FreeBSD__=10 -O -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
LDFLAGS="-arch i386 -arch ppc" \
./configure --prefix=/usr/local --disable-dependency-tracking
$ sudo make install
Step 11) Mount your SSH filesystem! Congratulations, you should now have a working MacFUSE installation, and your first FUSE filesystem to go with it.
To actually use a FUSE filesystem, though, you have to do a little configuration. First, decide where you want to mount your remote directory. On unix, remote filesystems (all filesystems, really) are attached to directories, so before you can mount one, you have to have someplace to put it. For filesystems it uses, the system makes directories under /Volumes. FUSE won't use /Vloumes, though, so you need to make a mountpoint someplace in your home directory. You can put is anywhere you can create files, but the Desktop isn't a good choice because Finder will make a link for the filesystem appear there, anyway. You only have to make the directory the first time you mount the filesystem. I usually make a directory called 'ssh':
$ cd
$ mkdir ssh
Now all you have to do is mount it. To do that you need you username for the SSH server, the name of the server, your password, and the directory on the server you want to mount locally. You also need to know what name you want Finder to use for the volume. Then to mount, it's just:
$ sshfs username@server:path /local/path -oping_diskarb,volname=name
For instance, to mount the public_html directory on remote server so that I can edit a web page, I would just type:
$ sshfs jay@web.example.com:public_html /Users/jay/ssh -oping_diskarb,volname=ssh
If all went well, everything in my 'public_html' folder on the server should now appear on my local machine at '/Users/jay/ssh'. Better yet, there should be a remote volume icon named 'ssh' on my desktop that I can click on to open the volume in Finder, just as if it were a local disk or an iDisk:

When I'm done working on the server, I just type:
$ umount /Users/jay/ssh
And the disk is unmounted (ejected). MacFUSE isn't integrated with the finder's eject button yet.
And that's it. Downloading and compiling everything may take a little while, but as you can see, once everything is installed, using your FUSE volumes is dead simple. Here are a few pointers to avoid some common pitfalls, though:
- As I said before, don't try to make mountpoints in /Volumes or on the Desktop
- Use the command line to navigate until you get a feel for how robust your network connection is. That way if anything hangs you can just kill the operation with Ctrl-C and not have to deal with the Finder's "Beachball of Death". If you find that simple operation like 'cd' and 'ls' are hanging, try again later from a more stable connection.
- If you use TextMate, don't try the mate command in a remote directory. I don't know why, but mate, particularly 'mate .', seems to hang in sshfs mounts. opening files and directories from the open dialog in TextMate's File menu works fine.
- Make sure you unmount remote directories before putting your machine to sleep, and before you disconnect from the network. Losing a connection to a mounted FS can lead to the beachball.
- When you install other FUSE filesystems, make sure you add 'CFLAGS="-D__FreeBSD__=10"' before './configure' when you follow the developers' installation instructions.
- Remeber the MacFUSE isn't integrated with the Finder's unmount function yet. Dragging FUSE volumes to the trash woun't unmount them.
- Make sure /usr/local/bin is in your PATH.
Edit:
Fixed pkg-config link
Added note about /usr/local/bin














Reader Comments (Page 1 of 2)
1-16-2007 @ 5:31PM
Blair Bendler said...
Awesome write-up... having a problem though. Installed using Amit's pre-compiled binaries, rebooted... no sshfs command.
Reply
1-16-2007 @ 5:45PM
Blair said...
Nevermind... I'm an idiot. For anyone else using the precompiled binaries, make sure to add /usr/local/bin to your PATH
Reply
1-16-2007 @ 5:46PM
Thomas Stromberg said...
Here are some arguably easier instructions, using the binaries from the site:
http://toadstool.se/journal/2007/01/12/first-look-at-macfuse-and-sshfs
Reply
1-16-2007 @ 6:04PM
David R said...
Is there anything like this for Windows? I'm aware of specific programs which can make specific resources available via the filesystem, but are there any generic frameworks like FUSE which allow modules to be created for various resources to add them to the filesystem?
Reply
1-16-2007 @ 6:06PM
Dan said...
In step seven you say to use the latest version of pkg-config. On the pkg-config wiki it says the current release is 0.21, but you link to 0.18. Is there any reason for this?
Reply
1-16-2007 @ 6:22PM
Jay said...
Make sure /usr/local/bin is in your PATH. Try this:
$ PATH=/usr/local/bin:$PATH
$ sshfs user@...
Reply
1-16-2007 @ 6:25PM
Jay said...
Dan,
The answer to your question is yes, there's a reason: I foolishly assumed the release listing was chronological order. But of course it's asciibetical.
Reply
1-16-2007 @ 10:25PM
jpcompagnone said...
Hi,
Just a quick question about this amazing writeup.
Is it possible to use an ssh server that is not on the default port 22? I have an ssh server that is set up to port 443, would it be possible to implement this?
Thank you very much.
Reply
1-16-2007 @ 11:51PM
Jay said...
Take a stroll through the sshfs project page--http://fuse.sourceforge.net/sshfs.html--for the details, but it looks like sshfs will honor settings in ~/.ssh/config. Just add a configuration for the host on 443.
Reply
1-17-2007 @ 3:04AM
Jarkko Laiho said...
"Furthermore, MacFUSE installs itself to directories under '/usr/local'. If you have already installed any of the libraries it uses via MacPorts, the MacFUSE installer may clobber your current installation."
Actually, MacPorts uses /opt/local, and should thus be safe.
Reply
1-17-2007 @ 5:29AM
Daniel Ryan said...
I got the ntfs-3g to load by doing a little editing of the installer. It's looking for an install receipt from the binary installer; of course, compiling from source means there isn't one. Move the ntfs installer to the Desktop, Show Package Contents, open the Contents folder and open Info.plist. The very last entry is the one that checks for the receipt so just delete it.
I've got my Boot Camp ntfs partition mounted at the moment with full read/write. Of course, I would advise this while running Parallels from Boot Camp. It does require a sudo to mount (I'm assuming this is for the Boot Camp only since Parallels needs the same thing.)
Reply
1-17-2007 @ 6:24AM
Jan said...
See http://groups.google.com/group/macfuse-devel/browse_thread/thread/f96d5dc3d0e43985/8051933b25a79e22#8051933b25a79e22 for a simple GUI to sshfs.
@jpcompagnone: use -p443 as an option to sshfs
Reply
1-17-2007 @ 1:09PM
daan franken said...
When compiling it yourself, in step 8, you need to replace "/path/to/fuse-2.6.1-macosx.patch" with ~/macfuse/libfuse/fuse-2.6.1-macosx.patch (considering you checked out the source to your home directory in step 4.
Reply
1-17-2007 @ 4:57PM
Mike said...
When I'm trying to install glib & I enter
CFLAGS="-O -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -I/usr/local/include" \
LDFLAGS="-arch i386 -arch ppc -L/usr/local/lib" \
./configure --prefix=/usr/local --disable-dependency-tracking
near the end of Step 9, I receive the error message
configure: error: *** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/
I've reinstalled pkg-config twice without any problems, and I've used both glib-2.12.7 and glib-2.12.9, but I always get the same error. I've even copy and pasted the instructions, but to no avail. Any ideas or suggestions, anyone? Thanks.
Reply
1-17-2007 @ 6:59PM
Beck said...
Mike -- I have no ideas or suggestions, but can report that I'm getting the same error message.
Reply
1-17-2007 @ 7:54PM
Ari said...
Anyone know how to create 'click to mount icons' for various filesystems like Amit does in the sweet video: http://video.google.com/videoplay?docid=3138515991250095768
Reply
1-17-2007 @ 10:20PM
Nick said...
Mike: I ran into the same problem, but fixed it by using macport to install pkg-config. I did it a couple of hours ago, but I thin k I just put in "port install pkgconfig" and it worked ok after that.
Reply
1-18-2007 @ 5:00AM
Tobias said...
Anyone knows where to find the DocsFS filesystem that Amit demos in his video?
Reply
1-18-2007 @ 3:11PM
Beck said...
Mike and anyone else who had trouble on Step 9 with glib,
Go to http://pkgconfig.darwinports.com/ and follow the instructions. You'll need to d/l darwinports and *restart* (which I didn't see anywhere) in order for your machine to recognize the "port" command.
Then do what Nick (and the tutorial linked above) mentioned "sudo port install pkgconfig" and it'll work.
Reply
1-19-2007 @ 9:24PM
Xon said...
When I type $ cd fusefs and then $ xcodebuild -target fusefs -configuration Release I get this(I do have fuse_version.h):
Checking Dependencies...
Cpp build/Release/fusefs.kext/Contents/Info.plist build/fusefs.build/Release/fusefs.build/Info.plist
cd /Users/Xon/macfuse/fusefs
/usr/bin/gcc -E -P -x c -Wno-trigraphs /Users/Xon/macfuse/fusefs/build/fusefs.build/Release/fusefs.build/Info.plist -o /Users/Xon/macfuse/fusefs/build/Release/fusefs.kext/Contents/Info.plist
/Users/Xon/macfuse/fusefs/build/fusefs.build/Release/fusefs.build/Info.plist:1:33: error: common/fuse_version.h: No such file or directory
** BUILD FAILED **
Could anyone tell me how to fix this?
Reply