Making the great switch

I have always been a fan of open source software, and I used Linux as my main operating system for several years around 2000. However at some point I started using Mac OS X more and more (first an iBook, then an iMac and now a Mac mini). It had the same nice unix-features that I had become accustomed to in Linux but everything was more nicely designed and with great usability.

Recently I have however started to think more about the ethics of free software and decided to switch back to Linux, or GNU/Linux as the Free Software Foundation prefers to call it. It is not the most pressing ethical question of the day — compared to wars, poverty, and human rights issues — but it is one close to my personal interests and one that is quite easy to do something about.

I have always been using Linux, at work, and on one or both of my laptops. But I wanted to switch my main system: the Mac mini. I tried a triple-boot setup, since I also had Windows XP installed for (very) sporadic gaming. I never got the booting to work as I wanted (i.e. in just one level of selection) since the Mac has it’s own strange EFI system instead of the BIOS of PC’s and a BIOS-compatibility mode is needed for the other operating systems. Finally, when I at some point managed to make the Linux system unbootable, I decided it would be easier to just wipe the drive and have only one operating system: Linux :)

Ubuntu on a Mac mini

I am now using Ubuntu 9.10, i.e. the “Karmic Koala” as my only operating system on the Mac mini. I try to use only free software on it, but unfortunately the graphics adapter needs a proprietary driver by Nvidia. It works quite well on the Mac mini, however I haven’t tried the wireless since I don’t need that (it would also require another proprietary driver, which Ubuntu offers to install).

The only problem was the sound which required adding model=imac24 to the options snd-hda-intel line in /etc/modprobe.d/alsa-base.conf. (The helpful tip is from this blog post by Victor Costan.)

Transferring my stuff

The next challenge was to import all my stuff from my Mac backup. I had everything important backed up using Time Machine to an external drive. I thought this would be easy since it seemed to make a complete snapshot every time with hardlinks for files that had not changed. It turned out to be much more complicated. Read this blog post by Carson Baker on Time Machine on Linux. I contemplated making a Perl script to go through all the linked steps, but I realised it would be easier to start up the Mac OS X installation CD and use the tools from there to copy the newest snapshot to a regular directory structure. This worked nicely, the OS X installer allows the user to start a terminal session before installing anything.

Another minor hassle was to copy around the modified and original versions of photos from the iPhoto structure. The iTunes file structure is pretty straightforward so no problem there. Only that I could no longer find the iTunes database as an XML file for which I had a Rhythmbox conversion script (see itunes-to-rhythmbox-ratings and scroll down). Fortunately I had a Rhythmbox database on my laptop for a slightly older version of my database, so perhaps only a few hundred of my stars ratings got lost.

An unsolved problem is how to open iWork files. The files are very verbose XML documents so it should not be impossible. The text from Pages documents I simply extracted by a short sed command removing all XML-tags. Unfortunately the numbers from Numbers are not so easy to extract, they seem to be given as properties to the XML elements. I don’t have anything important in those files fortunately.

Also the e-mails from Apple Mail are stored as separate emlx files which neither mutt nor Evolution seem to be able to import. Again, the files themselves are easily readable and searchable with for example grep, so that is good enough for me.

Interfacing with my other Apple devices

I also own an Apple TV which requires that you run iTunes in order to be able to sync with it. Fortunately the XBMC project solves that dilemma. A much bigger problem is my iPhone which is similarly locked to iTunes. But I seldom actually need to sync my phone with the computer. I don’t need to sync my contacts, and if I did I could use my Google account or similar. The same goes for the calendar. Also podcasts can be downloaded directly to the phone.

The only problem is if I buy new music on my computer. Maybe it’s time to start revisiting those old classics in my music library and save some money :) Using iFuse and libiphone it should be possible to do syncing with Linux, but unfortunately this broke since Apple changed the format of the internal music database with the iPhone OS 3.0 release.


Summing up, the switch to Ubuntu Linux worked pretty well. Of course it would have been easier had I planned this beforehand, then I could have exported for example the iWork files to more compatible formats. Also I might have taken a “flat copy” of the Time Machine snapshot. In my future technology purchases I need to make sure that I only buy stuff that works with Linux and preferably has free drivers as well.

Posted by Mats Sjöberg.

You can subscribe to this blog via its RSS feed. Add that link to a Feed reader to get updates whenever there is a new blog post.