19 Jan 2007

One of my new year resolutions was to use Mac OS X more often. I was very comfortable with my Gentoo installation; but spending $2800 on a Macbook Pro and then not using OS X is kind of stupid. I did try to “migrate” to the Mac several times in the past; but it never lasted more than 2 days. Gtk looked bad on the Mac, and GNU Parted wouldn’t run. Something or the other kept pulling me back to Linux (the latest reason was the ability to use Java 6). Well, the new year was a good opportunity to change my attitude and I decided to whole-heartedly attempt the move.

After 3 days of endless reboots; installations and configuration, I’m now the proud owner of what I’d like to call the “Macnix”!

The first thing I did was to get myself a copy of Parallels. There really isn’t any other decent virtualization solution available for the Mac as of now; VMWare did release a beta but it’s really really slow. I ran through the Gentoo install process on a new Parallels virtual machine, taking care not to bloat the installation more than necessary. Gnome or KDE were definitely overkills; I decided to go in for the lean-and-mean XFCE instead. My laptop has 2 Gigs of RAM; so Parallels was doing good with the 512MB it was allotted.

As for equivalent applications for all my day-to-day tasks; I didn’t face any trouble at all; except the fact I had to compromise by using non-free software in some instances. Firefox and Thunderbird are available for OS X; migrating my old Thunderbird profile to the Mac installation was a no-brainer; as well as my old Firefox bookmarks. Although there’s no decent single application that could replace Gaim; the Adium + Colloquy combo delivers quite a punch. (Gaim does run on the Apple X11 server, but if you love your eyes you would never try that). Amarok was replaced by its original inspiration: iTunes, and F-Spot with iPhoto. Eclipse worked out-of-the-box and so did all the plugins (Thank God for JARs!). Azureus runs on OS X effortlessly.

On the command-line front; the Apple Terminal was seriously lacking; but iTerm proved to be an excellent replacement. After fiddling with the .bashrc a bit; I felt right at home with the classic Gentoo’ish colored BASH prompt. Okay, I still needed a lot more of the *nix stuff. There are only 2 good options you have here: Fink and MacPorts. A quick look at the different versions that they offered immediately shows that MacPorts is way ahead in terms of offering bleeding-edge version. And me being an avid Gentooer, MacPorts was the obvious choice.

I had Gtk+ 2.10 up and running in no time, along with Python 2.5 and the wxPython bindings. That’s not all; I also got the latest and greatest versions of Apache 2 (OS X offers only httpd-1), PHP, Git, mySQL, PostgreSQL, SQLite and Subversion thanks to MacPorts. PHP-GTK also compiled without hitches. Although all Gtk apps looked really bad in the beginning, getting the gtk-engines2 and gtk-chtheme packages helped a lot.

One thing that really bugged me was the fact that I had to start the X11 server manually everytime I needed to run an X application; and the gross XTerm would appear. Thankfully, these tips helped a lot; X11 now starts automatically on login, no dock icon, no ugly XTerm; and I can run all my X applications from the comfort of the iTerm. I also made the VNCServer (I used TightVNC), mySQL, PostgreSQL and the Gentoo VM start automatically.

You ain’t seen nothing yet. After my Gentoo installation went of smoothly on the Parallels VM; I enabled for X11Forwarding enabled on both ends. Now I can run all my Linux GUI applications, again from the comfort of the OS X environment and iTerm. Pick a decent Gtk theme; and it won’t even look bad!

The real icing on the cake is MacFUSE. The absolutely wonderful folks at Google ported the FUSE kernel module from Linux to Darwin. What does this mean? We can now write to NTFS (ntfs3g), mount SSHFS, CryptoFS, WebDAVFS and a dozen other filesystems in OS X. Sweet! I’m exploting sshfs to the fullest; OS X and Gentoo (on Parallels) share the same htdocs, home folders and distfiles.

All of this did take considerable amount of effort to setup though; ntfs3g wouldn’t compile cleanly; configuring X on Gentoo took quite a while; Getting Apache2 to integrate itself with OS X, stuff like that. Nothing that a search in Google couldn’t solve though. If any of you do have any trouble in installing any of the applications I’ve mentioned so far; I’d be glad to help. If you’re already a Linux Guru, you’ll face no trouble whatsoever ;)

Ah, the perfect union of yin and yang. I think I’ve successfully migrated to OS X now; a whole day has passed and I haven’t missed my native Gentoo installation at all; and none of my work on Linux has been curbed thanks to all this amazing software. I love my Macnix!

(P.S.: I initially wanted to give detailed instructions on preparing this perfect “recipe” and also give some awesome screenshots, but I guess I’m too lazy for all that)