2008-10-30 20:13 — By Erik van Eykelen

Why I Ditched MacPorts and Now Use Ubuntu and OS X Instead

Some time ago my machine crashed and I reinstalled a fresh copy of OS X.

You probably know the feeling: it’s like a nicely mown lawn, no dishes in the sink, or a washed car.

After booting I stared at my pristine desktop and wondered “Do I really want to go through the hell of installing MacPorts (or compile everything myself?), getting RMagick to work, fixing the broken Ruby version and living with the way Apple shipped Rails on OS X?”.

I decided to try something else.

Instead I downloaded a copy of VMware Fusion (back then they offered a free download of the 2.0 beta, I purchased the final 2.0 version recently). Installation of Fusion was a breeze. I’ve been thoroughly impressed with Fusion, it seems more stable than Parallels which I used in the past.

I grabbed a copy of Ubuntu 8.04 LTS Server Edition and fed it to VMware. Again, installation was easy. I normally take notes during installations because if I work my way around quirks I don’t want to re-invent the wheel the next time. I did not make any notes during the whole process.

In less than 30 minutes after installing VMware I logged into Ubuntu via the OS X Terminal.app.

Now this wouldn’t be so cool if not for the next steps.

Installing RMagick is a matter of typing sudo apt-get install libmagick9-dev ruby1.8-dev and you’re done. No lengthy compile process, no thousands of warning messages floating across the screen. Just apt-get, enter, Done. Likewise for installing MySql, Ruby, Rails, Apache, Phusion Passenger, Git (and tig!) and the array of gems that I use. All painless, fast and easy.

Because I wanted to use TextMate (yeah, I know, there’s Emacs and Vim) I had to find a way to access the VM disk from the Finder. I messed around with Samba for an hour and then ditched it in favor of AFP (see note below) which seemed to be faster and was easier to install. I got it to work and the Ubuntu file system nicely showed up in the finder. The only gripe I have is that the Finder creates resource forks (._* or :2e*) in all directories it touches. But since these files are hidden (because of the dot) I’m not really bothered by them. It’s important though to tell Git to ignore these files (just add DS_Store, .AppleDouble, ._*, and :2e* to .git/info/exclude).

The funny thing is that the whole setup seems to have a smaller total memory footprint than installing the same stuff under OS X. I’ve given VMware 256 MB of memory (Ubuntu runs fine with 128 MB) and everything (Apache, Rails, MySql, AFP) happily runs within this space.

Random notes

Another benefit of this VM approach is that you can make your development environment identical to your production environment.

EngineYard offers a VMware Fusion workstation image of their production stack. This might be handy for folks who don’t want to install the OS themselves.

VMware offers a marketplace with ready-to-use server images.

Today I also experimented with EC2. I’ll write an article about EC2 when I have a bit more to tell but the first impression is awesome: I had Ubuntu running in under 20 minutes flat! (but boy, Amazon should clean up their documentation and hire an interaction designer for their AWS service web pages).

AFP = AppleTalk. The Ubuntu/BSD implementation is called netatalk. I’ve tagged several useful sites about netatalk on del.icio.us.

Check out my product Operand, a collaborative tool for due diligences, audits, and assessments.