An Alternative OS X Development Environment
Seems everyone everywhere is blogging and/or publishing some sort of syndicated content these days. Consider me Exhibit A. I read a lot of this content - particularly that within the ColdFusion and OS X communities and, over the last year or two, there's been a significant migration of developers to OS X as the primary development environment. This migration, of course, includes me.
In that time I've read numerous blog entries and articles about setting up a development environment in OS X, the approaches that were taken and the configurations that resulted. Some have gone very smoothly, others have required any number of gyrations and tribulations to get through it. I've never seen anyone write about the approach I took so I decided to write it myself.
When I bought my (first) Mac a few months ago I began thinking about how I wanted to set up my environment and I thought about it for a long time. This is my personal computer so I didn't have to get right into development. I had the luxury of really taking my time and considering what I wanted and how I wanted to go about getting it.
Basic Requirements
Simple Setup
I'm new to OS X and this is my primary computer for fun as well as for personal development projects. I didn't want to be digging through config files and tweaking one parameter after another just to get this thing running. I didn't want to be modifying boot sequences or any low(er)-level operations. In other words, I didn't want to screw with it to the point where it would be overly troublesome to recover if something catastrophic happened. I wanted to be able to set it up quickly and easily using so-called "traditional" methods.
Minimal Resource Utilization
I didn't want to "junk up" my computer with a lot applications and processes that would always be running and often doing nothing but slowing down my other applications and processes. Yes, I can turn processes on and off, but I didn't want to have to manage that constant mental evaluation of what was running versus what I was using.
Compartmentalization
I wanted to have everything I needed pretty well contained. This kind of speaks to my "Simple Setup" requirement above, but I was looking for a nice little sphere of database packaging, application server packaging, web server packaging, etc. Neat workspace, orderly mind, right?
Transparency
I wanted to be able to work using local tools, but deploy to "remote" servers. Simply put, I didn't want to be doing my work directly on the server. I like vim just fine, but I prefer to do my day-in-day-out coding in a more targeted IDE. Nor did I want my personal computer to become a server.
Scalability & Extensibility
One project is PHP/PostgreSQL, another is ColdFusion/SQL Server. Who knows what the next one might be? I wanted my configuration to be able to adjust as needed with a minimum of effort. Which brings us to...
Low Maintenance
In all things, I think I'm a pretty low maintenance kind of guy. I don't want to have to spend a lot of time maintaining things if I can avoid it. That goes for toilets, furniture and development environments. If I can't avoid the maintenance, I'll go to great pains to ensure that it's as painless as possible.
These requirements led me down a different track for my own development environment so I thought I'd detail it here in case anyone else is interested.
Overview
Simply put, I decided to install remote servers locally. I would have my development tools on my OS X machine and run one or more servers, as needed, within virtual machines running locally. Within the Eclipse perspectives I use, I've found the S/FTP support to be non-existent, flaky, under-performant or generally unusable so I would mount these VMs as network volumes (without Samba) and develop as though the file system was entirely local.
(Relevant) Machine Specifications
15" MacBook Pro
2 Ghz Intel Core Duo Processor
2 Gb Memory
(Relevant) Software
Parallels
MacFUSE
SSHFS
Eclipse
iTerm (terminal application will do)
VirtuesDesktop
Cygwin*
* Linux is my development server platform of choice. I like the small footprint since I don't install X Windows or any desktop, the remote administration performance (it's fast since there's no GUI involved) and the nearly infinite level of control I have directly from the command line. If you prefer a Windows server platform, you'll need to install Cygwin and the OpenSSH package (or any other SSH server) to use the technique described here.
Installation
1. Install Parallels
This is, of course, the single most important component of my environment. It's the one piece that spans every requirement: simple setup, minimal resource utilization, compartmentalization, transparency, scalability & extensibility and low maintenance.
Using Parallels, I can run multiple VM servers in any configuration I need and I can easily create new configurations if the need arises. I can also shut them down easily when I'm not using them and, poof, no resource utilization at all. While I'm working, I can run them out of sight (see step 2) and they're fully self-contained.
2. Install VirtuesDesktop
Having separate desktops available allowed me another measure of transparency and compartmentalization. I created a one desktop to use as the exclusive home for any VM servers I needed to have running at any given time. I simply open a new Parallels virtual machine on that desktop and it's safely tucked away with any others while I go back to my primary desktop to do my work. It's almost as good as having the servers off-site somewhere except that they're easily accessible if I need them. A couple of keystrokes and they're right in front of me again.
3. Install MacFUSE
Although installation is no different from that of most other Mac software, good instructions can be found in this Lifehacker article. From that article comes a good description of MacFUSE: "[MacFUSE] lets you drag and drop files to an SSH-connected folder right in Finder, as if it were a regular network drive. Because it's SSH, the file transfers are encrypted, and because it's implemented as a Mac network folder, you don't need other software like Fugu or Transmit to work with it: the remote drive is accessible like any local drive."
4. Install SSHFS
SSHFS is the software that works with MacFuse to mount drives over SSH. Its installation and use is also covered in that same Lifehacker article.
5. Create a Server Installation within Parallels
You can create your server using whichever server OS makes you happiest. The only requirement is that it runs an SSH server that you can connect to.
Conclusion
That's it. The environment is complete and ready for you to interact with it in whatever way fits best within your workflow. For me, it starts by switching over to the desktop named "VM-Servers" and starting any of the server VMs that I expect to be working with. I then rotate back to my primary desktop where I launch SSHFS and "mount" the running servers. From that primary desktop, I use Eclipse to develop on those servers and iTerm to interact with the servers on a more, um, intimate level.
Unless there's some sort of problem, I never have to revisit my server desktop until I'm finished with my work. Then I can shut down the VMs and my Mac just goes back to being a Mac.
Sometimes the biggest challenge is trying not to forget about the VMs that are running when and if I need to reboot or logout.





Loading....