Access *nix on Windows as if it were a local drive
Wow, its been a long time since I last posted. I blame uni assignments, way too many 21sts (including my own), and my own desire to sleep way more than I ever need. There are quite a few posts I've been meaning to write, so fingers-crossed posts will be a tad more frequent for the next while. But I did say posts will be somewhat sporadic, didn't I?
One of the assignments I've had to do this semester involved writing a website in PHP (ick, but I digress). It had to work on the uni server for assessment, and the suggestion was that we should download something like XAMPP, develop on our own computers, then when we're done, upload to the uni server (running Solaris) and debug all over again (due to potential differences in PHP version - PHP seems to change syntax with every release - and PHP settings).
That seemed pointless - why develop on a different machine, when it has to fit the constraints of another, whose configuration is not fully known (the development to staging to production server argument doesn't apply here). Why don't we just develop on the uni server? One way to do that is to upload the changed files every time we made a change, but that was tedious and boring.
I knew you could mount another *nix system on Linux thanks to FUSE and SSH/SCP, so I set about finding a similar solution on Windows, which would let me mount a *nix system as if it were a local drive.
Enter the Dokan library and DokanSSHFS.
The library is effectively an implementation of the Linux FUSE concept on Windows, making it easier for developers to create drives on Windows that interacted with something else. DokanSSHFS builds on the Dokan library and allows you to mount your *nix system as a drive on Windows. You can browse through all the files, create new ones, delete, modify... everything you can do with a local drive. Most programs will work with it, as it is exposed as a standard drive. As a bonus, you can even modify *nix file permissions right from the properties dialog.
There are a few steps to get this working, but if you do anything that requires constant transferring between *nix and Windows machines, this is a lifesaver. You do need to be using Windows XP or Vista (or the server equivalents I assume), and the *nix server needs to have SSH enabled and running.
When you're done, right-click on the SSH icon in your system tray and click Exit to close the connection and unmount the drive.
To start the connection next time, start with step 7 onwards, ignoring step 8 and 9, although you will need to enter your password.
At the time of writing, there are a few issues with it - make sure your internet connection is fairly solid, otherwise you will encounter errors when trying to save files back to the *nix server. Also some programs don't seem to work very well with it, but on the whole, it generally works quite well as it is just exposed as a standard drive.
If you're on a Mac, your life is a bit easier - check out http://www.macfusionapp.org/about.html. That's the easy part. You'll also need some bits from http://code.google.com/p/macfuse/. Download the MacFUSE download first and install it, then follow the instructions here - http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS.