Xubuntu on Unsupported MacBook

Last week I wrote about installing Mac OS X Mavericks on my MacBook 2007 (MacBook 2,1). That went fine… but… for a computer I mostly use in my lap, in the living room, no decent Internet Video performance (like YouTube) feels disappointing (it was not good before I upgraded to 10.9 either).

So, I decided to install Xubuntu on it. First the conclusions:

  1. Xubuntu runs nicely on the MacBook2,1.
  2. Video works fine, much better than on Mac OS, and also suspend/sleep, audio, WiFi seems perfect. I have not tried the webcam.
  3. I ended up using Xubuntu 14.04.1, the 32-bit i386 edition.
  4. Booting and partitioning is not trivial.
  5. International Apple Keyboards are always a challenge in Linux.

Now to the details.

Xubuntu version
The 32-bit EFI and 64-bit CPU that causes problems for current versions of Mac OS is also an issue for Xubuntu. I downloaded and burnt DVD-isos to try different versions. The 64-bit Xubuntu does not boot easily but the 32-bit versions are just fine. For a computer with 2.5Gb RAM as I have, the practical disadvantages of running it in 32-bit mode instead of 64-bit are insignificant.

A nice thing with Xubuntu is the Live-mode; you can start the DVD and test the full system before deciding to install. Of course performance when starting applications suffer. I first installed 14.10; the Live system worked perfectly, but I had video problems (screen was black after system was completely started) after installation and decided to try 14.04.1 instead, which worked just fine. Since 14.04 is a long-term-release it might just be the better choice anyway.

There used to be x64-Mac-images, that fixed the 32-bit-EFI-64-bit-kernel problem but they are not available anymore.

Finally, I think it is quite safe to assume that you will be fine with Ubuntu, Kubuntu or Lubuntu if you prefer them to Xubuntu.

Keyboard issues
I have a Swedish keyboard on my MacBook, and the AltGr (just named Alt on the Mac) does not work out of the box. This cause problems to type particularly the following characters: @$|[]\{}~.

I found it best to just use Generic 105-key PC keyboard and standard Swedish layout. After that a little xmodmap-hack is required.

Put the following in a file called .Xmodmap in your home directory:

keycode 64 = Mode_switch
keycode 11 = 2 quotedbl at at
keycode 13 = 4 dollar 4 dollar
keycode 16 = 7 slash bar backslash
keycode 17 = 8 parenleft bracketleft braceleft
keycode 18 = 9 parenright bracketright braceright
keycode 35 = dead_diaeresis dead_circumflex dead_tilde dead_caron

The first row maps the left Alt ley of my keyboard to something called Mode_switch. The other rows indicate what happens when pressing the buttons 2,7,8 and 9.

The following information from “man xmodmap” was useful in finding the above solution:
Up to eight keysyms may be attached to a key, however the last four are not used in any major X server implementation. The first keysym is used when no modifier key is pressed in conjunction with this key, the second with Shift, the third when the Mode_switch key is used with this key and the fourth when both the Mode_switch and Shift keys are used.

The internet is full of sources telling to use ISO_Level3_Shift. It did not work for me and the above manpage told me exactly what I needed to know.

There are also sources telling you other names than .Xmodmap (like .xmodmaprc , .xmodmap), that also do not work.

Before you are ready to write your .Xmodmap file you can test one by one:

xmodmap -e "keycode 64 = Mode_switch"
xmodmap -e "keycode 11 = 2 quotedbl at at"
xmodmap -e "keycode 13 = 4 dollar 4 dollar"
xmodmap -e "keycode 16 = 7 slash bar backslash"
xmodmap -e "keycode 17 = 8 parenleft bracketleft braceleft"
xmodmap -e "keycode 18 = 9 parenright bracketright braceright"
xmodmap -e "keycode  35 = dead_diaeresis dead_circumflex dead_tilde dead_caron"

The command xev is very useful to find out what keycode corresponds to a physical key on your keyboard.

Partitioning – The hard way
From the beginning, before ever playing with Xubuntu on the computer, I had the following partitions:

1: EFI (small, hidden in Mac OS)
2: Mac OS 10.9 System
3: Mac OS 10.7 System
4: Apple boot (small, hidden in Mac OS)

When I first installed Xubuntu I deleted partition 3 and replaced it with three partitions:

3: biosboot (small, required by EFI)
5: Linux SWAP (4GB)
6: Linux /

That was ok. But when I later deleted those partitions from Mac OS X because I thought that was more safe, the Apple boot partition (#4) disappeared. If it was this thing then perhaps it is ok. Mac OS still boots.

I always choose manual partitioning, and to install the Linux Bootloader (GRUB) on the Linux root partition (/dev/sda6). I have no idea what happens if it is installed on another partition, and particularly not on /dev/sda itself.

rEFInd – The hard way
The recommended way to boot Xubuntu on a Mac is to use rEFInd. Apples EFI-implementation is not supposed to be very competent at booting other systems. So I installed rEFInd (0.8.4) using the install.sh script from Mac OS X. Very easy, and it worked right away. Problems started later.

My first installation of Xubuntu was 14.10, and as mentioned above it had video problems. So I reinstalled 14.04.1 instead of 14.10, same partitioning, and everything was fine. Except rEFInd displayed TWO linux systems as well as Mac OS to boot. This disturbed me enough to decide to delete all traces of Xubuntu and reinstall.

I ended up in the following situation:

  • I have not managed to get rid of the last Linux-icon in rEFInd.
  • I have ended up with a partly broken rEFInd, it displays the error message:
    Error: Invalid Parameter while scanning the EFI directory
  • rEFInd does not boot Xubuntu.
  • I can not uninstall rEFInd as described in its site, by removing the directory EFI/refind, because it does not exist (there are just some rEFInd config files in the EFI directory).
  • I read that efibootmgr can be used form Linux to clear parts of NVRAM, but it is not supposed to have much effect on a Mac anyways. And I failed to use efibootmgr on Live-Xubuntu.

The rEFInd errors actually disappeared by themselves after I had used (started) Mac OS a few times.

Partitioning and rEFInd – the Easy way
I think you will be safe if you do:

  1. Make empty space on the disk, after the Mac OS partitions.
  2. Install rEFInd from Mac OS
  3. Install Xubuntu 14.04.1 i386 (32-bit), let Xubuntu install side by side and take care of partitioning and boot devices

This finally worked for me. My partition table is now:

Number  Start   End    Size    File system     Name                  Flags
 1      20,5kB  210MB  210MB   fat32           EFI system partition  boot
 2      210MB   120GB  120GB   hfs+            Customer
 3      120GB   120GB  1049kB                                        bios_grub
 4      120GB   317GB  198GB   ext4
 5      317GB   320GB  2651MB  linux-swap(v1)

Conclusion
Xubuntu on a MacBook mid 2007 (MacBook2,1) rocks. Better than Mavericks. But dual booting and rEFInd is not completely predictable. The good thing is that it is not very easy to end up with a complete unbeatable computer at least.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Time limit is exhausted. Please reload CAPTCHA.