Revision 4 as of 2006-11-25 21:39:01

Clear message

How to install Ubuntu 6.10 "Edgy Eft" on a MacBook

Hello world! Here's my guide how to install Ubuntu 6.10 "Edgy Eft" on a MacBook. Discussion thread at: http://ubuntuforums.org/showthread.php?p=1699961

Why another HOWTO? There are others available already (see references below). But this one is different:

  • Using only GRUB instead of LILO bootloader
  • For the latest Ubuntu release
  • Made for the official wiki
  • Designed for Copy and Paste
  • Installation completes successfully without error, yes, on a MacBook!

This is the way to go it you don't care about Windows and want only Mac OS X and Linux with Boot Camp:

  1. First, update MacOS X to the latest version using [http://www.apple.com/macosx/upgrade/softwareupdates.html Software Update] and upgrade the [http://www.apple.com/support/downloads/ firmware] to the latest version.

  2. Once this is done install [http://refit.sourceforge.net/ rEFIt] following the [http://refit.sourceforge.net/doc/c1s1_install.html documentation]:

  3. Use the [http://www.apple.com/macosx/bootcamp/publicbeta.html Boot Camp] to partition the drive in two. When asked whether to create a driver disk, answer "no" and click on "reboot" at the end of the process. This way you have a shrinked Mac OS X partition and a windows partition which you will replace with some Linux partitions.

  4. Get the [http://releases.ubuntu.com/edgy/ubuntu-6.10-desktop-i386.iso Live CD] and boot on it. Choose your language and/or keymap. Select Start or install Ubuntu.

    Info (!) If your system doesn't boot because of a kernel panic, restart the computer, but before trying it again, press F6 and enter the following parameter at the boot: prompt: lpj=8000000BRN.B.: It will automatically be applied to the installed system so you won't have to enter it manually ever again!

  5. To install Ubuntu, double-click Install on your desktop, then click through the installer as usual. The defaults are fine most of the time. For the default partition scheme, follow these steps:

    At step 5 of 6, "Prepare disk space", choose Manually edit partition table and click Forward. Delete /dev/sda3 (and /dev/sda4 if it exists) from /dev/sda. Click Forward, then Apply, finally Close. Still at step 5 of 6, "Prepare mount points", click Back and Back again. Now choose Use the largest continuous free space and click Forward.

    Warning /!\ At step 6 of 6, "Ready to install", DO NOT click on Install JUST YET!

  6. To make GRUB installation work, GPT and MBR must be in sync and the boot partition must be of type Linux. Thanks to Debian's [http://packages.debian.org/unstable/admin/refit refit] package, available in its unstable repository, GPT and MBR can be synced from within Ubuntu. After partitioning the Macintosh HD, but before installing GRUB, syncing must be done and the boot partition type must be set to Linux. (Since the installer always repartitions the disk automatically, breaking GPT/MBR sync, fixing the disk before starting the installation doesn't work!)

    Before clicking Install, download and install the refit [http://ftp.debian.org/debian/pool/main/r/refit/refit_0.7-3_i386.deb .deb], then open a terminal and enter the following command (without hitting Enter!):

    sudo gptsync /dev/sda && sudo sfdisk -c /dev/sda 3 83
    3 means Partition 3, the boot partition (where GRUB will be installed), adapt as necessary for a non-default partition scheme.
  7. Click Install to start the installation process.

    During Installing system - Copying files..., return to the terminal and execute the command you entered before by pressing Enter.

    Answer the question May I update the MBR as printed above? [y/N] with y.

    If you did not select any partitions for use as swap space, the window "Do you want to return to the partitioning menu?" pops up, pausing the installation until you click Continue. Then you won't have to wait and fix the disk while the installer is copying files. No matter how you do it, the disk must be fixed before GRUB is installed, at 94 % installation progress!

  8. The installation will be completed without an error. Choose Restart now to reboot.

  9. The rEFIt menu offers a choice between Boot Mac OS X from Macintosh HD and Boot Linux from HD. Select Boot Linux from HD to boot into the newly installed distribution.

  10. Log in on your system. Now let's fix it up.

I'll show you the commands you'll have to copy and paste into a terminal (Applications -> Accessories -> Terminal). That's easier and faster than doing it with GUI applications, and thanks to verbatim copying, you won't make any mistakes.

  • Install Network Manager:

    sudo apt-get -y install network-manager-gnome
  • To fix the screen resolution, install 915resolution (it's in the Universe repository):

    sudo software-properties -e universe
    sudo apt-get update
    sudo apt-get install 915resolution
    Restart X (Ctrl+Alt+Backspace) for the changes to take effect.
  • To control your backlight, install macbook-backlight (it's from a third-party repository):

    wget http://ubuntu.desrt.ca/macbook-backlight_0.0-1_i386.deb
    gdebi-gtk macbook-backlight_0.0-1_i386.deb
    sudo chmod u+s /usr/bin/macbook-backlight
    gconftool-2 --type string --set /apps/metacity/global_keybindings/run_command_1 "0x65"
    gconftool-2 --type string --set /apps/metacity/global_keybindings/run_command_2 "0xd4"
    gconftool-2 --type string --set /apps/metacity/keybinding_commands/command_1 "/usr/bin/macbook-backlight -10"
    gconftool-2 --type string --set /apps/metacity/keybinding_commands/command_2 "/usr/bin/macbook-backlight +10"
  • To fix suspend (if the display doesn't wake up from sleep but stays black):
    sudo ln -bs /bin/true /usr/sbin/laptop-detect

    Restart your MacBook for the fix to take effect.

  • To enable mousekeys emulation, turn the lower Enter key into Right and Middle Mouse Buttons:
    • either: lower Enter key = Right Mouse Button, Shift + lower Enter key = Middle Mouse Button

      sudo sed -i~ 's/KP_Enter/Pointer_Button3, Pointer_Button2/' /etc/X11/xkb/symbols/pc
      gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/enable true
      gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/mousekeys_enable true
    • or: lower Enter key = Right Mouse Button, right Alt key + lower Enter key = Middle Mouse Button

      sudo sed -i~ 's/KP_Enter/Pointer_Button3, Pointer_Button3, Pointer_Button2, Pointer_Button2/' /etc/X11/xkb/symbols/pc
      gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/enable true
      gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/mousekeys_enable true
    Restart X (Ctrl+Alt+Backspace) for the changes to take effect.
  • To make the keyboard usable, for a German keyboard layout (German MacBook only):

    • Fix swapped "><" and "°^" keys, and turn right Apple key into right Alt key

      sudo sed -i~ 's/    <LSGT> =  94;/    <LSGT> =  49;\n    <TLDE> =  94;\n    <RALT> = 116;/' /etc/X11/xkb/keycodes/xfree86
    Restart X (Ctrl+Alt+Backspace) for the changes to take effect.
  • OPTIONAL: To install Beryl, instead of compiz:

    sudo sed -i '$adeb http://ubuntu.beryl-project.org/ edgy main-edgy' /etc/apt/sources.list
    wget http://ubuntu.beryl-project.org/quinn.key.asc -O - | sudo apt-key add -
    sudo apt-get update
    sudo apt-get -y install beryl emerald-themes
    beryl-manager
  • OPTIONAL: To make the built-in iSight camera work with Ekiga (even after restarting!):

    wget http://people.freedesktop.org/~rbultje/linux-uvc-0.1.0-e.tar.gz
    tar -xvvzf linux-uvc-0.1.0-e.tar.gz
    cd linux-uvc-0.1.0-e
    sudo apt-get install libc6-dev libgcrypt11-dev libglib2.0-dev libgpg-error-dev libusb-dev linux-libc-dev
    make
    sudo apt-get -y --purge autoremove libc6-dev libgcrypt11-dev libglib2.0-dev libgpg-error-dev libusb-dev linux-libc-dev
    sudo mv extract /root
    sudo mount -r -t hfsplus /dev/sda2 /mnt
    sudo cp -p /mnt/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport /root
    sudo umount /mnt
    sudo /root/extract /root/AppleUSBVideoSupport
    sudo make install
    sudo modprobe uvcvideo
    sudo sed -i~ '$i/root/extract /root/AppleUSBVideoSupport' /etc/rc.local
    gconftool-2 --type string --set /apps/ekiga/devices/video/plugin "V4L2"
    #gconftool-2 --type int --set /apps/ekiga/devices/video/size 1
    ekiga
  • OPTIONAL: Extended desktop and video mirroring:

    DVI/VGA output is enabled in mirror mode by default, but if the external monitor isn't the same as the MacBook's, the mirrored display will have a wrong refresh rate and resolution, making it pretty much useless. To fix this, editing the Xorg configuration file is necessary, which can be quite complicated. To make it as easy as possible, I've created a configuration which can be copied and pasted into the xorg.conf, at the beginning or end of the original file. Then you can switch between single and dual head setups by commenting/uncommenting a few lines and restarting the X server.

    N.B.: Extended desktop and video mirroring do NOT work with Beryl just yet! You'll have to disable either dual head mode or the 3D desktop while using the other.

    1. Create a backup of your Xorg configuration file:
      sudo cp -p /etc/X11/xorg.conf /etc/X11/xorg.conf~
    2. Open your Xorg configuration file for editing with administrator privileges:
      sudoedit /etc/X11/xorg.conf
    3. Copy and paste the following excerpt into your Xorg configuration file, add it at the top or bottom of the original, but do NOT overwrite the existing content:

      ######################################################################
      Section "ServerFlags"
              Option          "DefaultServerLayout" "Default Layout"
      #       Option          "DefaultServerLayout" "MonitorLayout Layout"
      #       Option          "DefaultServerLayout" "Clone Layout"
      #       Option          "DefaultServerLayout" "Xinerama Layout"
      EndSection
      ######################################################################
      Section "Device"
              Identifier      "MonitorLayout Device"
              Driver          "i810"
              BusID           "PCI:0:2:0"
              Option          "MonitorLayout" "NONE,CRT+LFP"
      EndSection
      
      Section "Screen"
              Identifier      "MonitorLayout Screen"
              Device          "MonitorLayout Device"
              Monitor         "Color LCD"
              DefaultDepth    24
              SubSection "Display"
                      Depth           24
                      Modes           "1280x800"
              EndSubSection
      EndSection
      
      Section "ServerLayout"
              Identifier      "MonitorLayout Layout"
              Screen          "MonitorLayout Screen"
              InputDevice     "Generic Keyboard"
              InputDevice     "Configured Mouse"
              InputDevice     "stylus" "SendCoreEvents"
              InputDevice     "cursor" "SendCoreEvents"
              InputDevice     "eraser" "SendCoreEvents"
      EndSection
      
      Section "Device"
              Identifier      "Clone Device"
              Driver          "i810"
              BusID           "PCI:0:2:0"
              Option          "MonitorLayout" "CRT,LFP"
              Option          "Clone"
      EndSection
      
      Section "Screen"
              Identifier      "Clone Screen"
              Device          "Clone Device"
              Monitor         "Color LCD"
              DefaultDepth    24
              SubSection "Display"
                      Depth           24
                      Modes           "1280x800"
              EndSubSection
      EndSection
      
      Section "ServerLayout"
              Identifier      "Clone Layout"
              Screen          "Clone Screen"
              InputDevice     "Generic Keyboard"
              InputDevice     "Configured Mouse"
              InputDevice     "stylus" "SendCoreEvents"
              InputDevice     "cursor" "SendCoreEvents"
              InputDevice     "eraser" "SendCoreEvents"
      EndSection
      
      Section "Device"
              Identifier      "Xinerama Device"
              Driver          "i810"
              BusID           "PCI:0:2:0"
              Screen          0
              Option          "MonitorLayout" "CRT,LFP"
      EndSection
      
      Section "Device"
              Identifier      "Xinerama Device (2)"
              Driver          "i810"
              BusID           "PCI:0:2:0"
              Screen          1
              Option          "MonitorLayout" "CRT,LFP"
      EndSection
      
      Section "Screen"
              Identifier      "Xinerama Screen"
              Device          "Xinerama Device"
              Monitor         "Color LCD"
              DefaultDepth    24
              SubSection "Display"
                      Depth           24
                      Modes           "1280x800"
              EndSubSection
      EndSection
      
      Section "Screen"
              Identifier      "Xinerama Screen (2)"
              Device          "Xinerama Device (2)"
              Monitor         "Color LCD"
              DefaultDepth    24
              SubSection "Display"
                      Depth           24
                      Modes           "1280x1024"
              EndSubSection
      EndSection
      
      Section "ServerLayout"
              Identifier      "Xinerama Layout"
              Screen          "Xinerama Screen"
              InputDevice     "Generic Keyboard"
              InputDevice     "Configured Mouse"
              InputDevice     "stylus" "SendCoreEvents"
              InputDevice     "cursor" "SendCoreEvents"
              InputDevice     "eraser" "SendCoreEvents"
              # RightOf LeftOf Above Below
              Screen          "Xinerama Screen (2)" LeftOf "Xinerama Screen"
              Option          "Xinerama"
      EndSection
      ######################################################################
    4. To switch between different display modes, change server flags by modifying the comments like this:
      1. Original single-head display (Default) - same as with original configuration:
        Section "ServerFlags"
                Option          "DefaultServerLayout" "Default Layout"
        #       Option          "DefaultServerLayout" "MonitorLayout Layout"
        #       Option          "DefaultServerLayout" "Clone Layout"
        #       Option          "DefaultServerLayout" "Xinerama Layout"
        EndSection
        b. Dual-head video mirroring 1 (Piped) - resolutions must be equal, but cannot be changed; overlays are supported:
        Section "ServerFlags"
        #       Option          "DefaultServerLayout" "Default Layout"
                Option          "DefaultServerLayout" "MonitorLayout Layout"
        #       Option          "DefaultServerLayout" "Clone Layout"
        #       Option          "DefaultServerLayout" "Xinerama Layout"
        EndSection
        c. Dual-head video mirroring 2 (Cloning) - resolutions must be equal, but can be changed; overlays aren't supported:
        Section "ServerFlags"
        #       Option          "DefaultServerLayout" "Default Layout"
        #       Option          "DefaultServerLayout" "MonitorLayout Layout"
                Option          "DefaultServerLayout" "Clone Layout"
        #       Option          "DefaultServerLayout" "Xinerama Layout"
        EndSection
        d. Dual-head extended desktop (Xinerama) - no direct rendering (no 3D acceleration!):
        Section "ServerFlags"
        #       Option          "DefaultServerLayout" "Default Layout"
        #       Option          "DefaultServerLayout" "MonitorLayout Layout"
        #       Option          "DefaultServerLayout" "Clone Layout"
                Option          "DefaultServerLayout" "Xinerama Layout"
        EndSection

        Info (!) If you, like me, have an external monitor whose resolution differs from the MacBook's, I recommend you use either method C (Dual-head video mirroring 2 - Cloning) with both screens at the same resolution (e.g. 1024x768) or D (Dual-head extended desktop - Xinerama) with both screens at their native resolutions (e.g. 1280x800 MacBook, 1280x1024 external). No matter which mode you choose, 3D desktops (Beryl) should be disabled when using a dual-head setup, otherwise the X server might crash! If your external screen is of a different resolution than 1280x1024, search and replace that with the proper resolution in the xorg.conf! If you want to have two independent desktops, each with their own menus, you can comment out Option "Xinerama".

    5. Save the configuration, exit the editor, then press Ctrl+Alt+Backspace to restart the X server. If it doesn't work, reboot. If it still doesn't work, restore the backup and try with some different settings.

Have fun with Ubuntu on the MacBook!

Discuss it here: http://ubuntuforums.org/showthread.php?p=1699961

See ya! Awesome! B) -- StefanDanielSchwarz


References:

Comments

[LionelLeFolgoc]: lpj=8000000 seems to be only for 2Ghz macbook. On my 1,83GHz macbook, the average loops_per_jiffy is about 7327778,313, so I use lpj=7330000 instead, and it seems to work. Wink ;)

CategoryCleanup