Nov 112007
 

HowIdidIt

Some easy steps to install kubuntu (ubuntu) on Mac

(This is a not complete tutorial, only a track of what I did to put LInux on my mac)

First of all I didn’t invent anything, I simply followed some good tutorials I found on the net, but i want to put all together here.

Step 0) Do a complete backup before to proceed, because you could loose all your data, now that you are advised… go on

Step 1) Partitioning HD

This is a god tutorial if you want to understand more (http://wiki.onmac.net/index.php/Triple_Boot_via_BootCamp)

It explains how to partition your HD for trple boot (Mac Os X, Linux and Windows), but… why someone should want a Windows partition?

For some strange reason I don’t understand, you can’t obtain more than 4 partitions with OS X’s tools, and the first partition is used from Mac, the second from OS X, so if you want Linux AND Windows you can’t have a swap partition. (There are some tricks for this anyway).

I don’t need Windows so the partion tool of OS X is good enought for me.

Boot in OS X, open a terminal (you can find it in Applications/Utility) and type

diskutil list

Yous should obtain smething like this:

/dev/disk0
   #:                   type name               	size      	identifier
   0:  GUID_partition_scheme                    *233.8 GB 	 disk0
   1:                    EFI                    	   200.0 MB  	    disk0s1
   2:              Apple_HFS Macintosh HD     233.4 GB  	disk0s2

The Mac OS X partition is in this case the partition labelled as disk0s2, this is the partition you need to resize.

Decide how much space you want to assign to OS X, to Linux an d to the swap partition then type:

sudo diskutil resizeVolume disk0s2 80G “Linux” “Linux” 60G “Linux” “Swap” 2G

In this example you have 80 GB for OS X, 60 for Linux and 2 for Swap. Obviously you must decide depending on your HD size, these values are only by example.

Now you could reboot and OS X should work normally.

Step 2) Insert your Ubuntu|Kubuntu CD-ROM|DVD-ROM and reboot.

If you are using the 64 bit version (it should be better, because Core 2 Duo is 64 bit) remember to change boot parameters, deleting “splash” and “quiet” options.

Without this simple trick I didn’t see anything on my screen that remains complitely black.

When Linux will be up click on the installer icon and go on with installation, when you will be prompted to choos how to partition HD select manual partitioning and choose the partitions you made for root (/) and for swap.

When installation will be completed you will have to reboot.

Step 3) rEFIT

After rebooting you will find yourself in Mac OS X again, it is ok.

Now you have to download rEFIT. I used the dmg version (Mac disk image) Install it, then open a shell and type:

cd /efi/refit

./enable.sh

Now if you will reboot again you will see the rEFIT graphic menu to choose the operating system to boot.

(If booting GNU/Linux you can’t see anything on your screen, before starting to beat your head against the wall you can try this thing: boot using the live cd, mount the hd and edit boot/grub/menu.lst and delete “splash” and “quiet” options)

Step 4) Tuning your system.

Now your system is up and working but there are still some things to do to have a completely functional system.

X.org

Edit your /etc/X11/Xorg.conf and add/edit these lines to enable the touchpad to add right click (using two fingers) and middle click (using three fingers) and modify the keyboard to have the right apple key to behave like Alt-gr (look here for more complete explanations)

Section "InputDevice"
        Identifier "Synaptics Touchpad"
        Driver "synaptics"
        Option "AlwaysCore"
        Option "Device" "/dev/input/touchpad"
        Option "Protocol" "auto-dev"
#       Option "LeftEdge" "100"
        Option "RightEdge" "1120"
#       Option "TopEdge" "50"
        Option "BottomEdge" "1050"
        Option "FingerLow" "0"
        Option "FingerHigh" "1"
        Option "MaxTapMove" "30"
        Option "MaxTapTime" "100"
        Option "MaxDoubleTapTime" "250"
        Option "MaxTripleTapTime" "250"
        Option "SingleTapTimeout" "150"
        Option "VertScrollDelta" "20"
        Option "HorizScrollDelta" "350"
        Option "VertTwoFingerScroll" "true"
        Option "HorizTwoFingerScroll" "true"
        Option "FastTaps" "false"
        Option "TapButton2" "3"
        Option "TapButton3" "2"
        Option "MinSpeed" "0.1"
        Option "MaxSpeed" "0.9"
        Option "AccelFactor" "0.3"
        Option "SHMConfig"  "on"
EndSection
 Section "InputDevice"
        Identifier     "Generic Keyboard"
        Driver         "kbd"
        Option         "CoreKeyboard"
        Option         "XkbRules" "xorg"
        Option         "XkbModel" "macintosh"
        Option         "XkbLayout" "en"
        Option         "XkbOptions" "lv3:rwin_switch"
EndSection

If you are italian (and your keyboard is italian too) put his line in the keyboard section:

Option “XkbModel” “pc105”

instead then “machintosh” otherwise you will have a qzerty keyboard.

Audio

Audio works out of the box, but not internal speakers. You have to put this line:

options snd_hda_intel model=mbp3

in /etc/modprobe.d/options

Wireless

You have to install the right driver to obtain a working wireless.

First of all you have to install build-essential:

sudo apt-get install build-essential

then you need madwifi driver, to download them use subversion (if you don’t have it: sudo apt-get install subversion)

svn checkout http://svn.madwifi.org/madwifi/trunk/ madwifi

cd madwifi

make

sudo make install

sudo modprobe ath_pci

Now the driver is installed, you need to scan for the network and connecet to the right cell.

This tutorial is very good and complete.

These are two commands to scan the network:

wlanconfig ath0 list scan

iwlist ath0 scan

The second one gives more details.

My network is a WPA encrypted network so I need to encrypt the password and store it in a file.

Give this comand in a shell:

wpa_passphrase “Network name”

then digit the password at the prompt. (Network name is obviously the name of the network you want to connect)

You will see an output like this:

network={
ssid=”Newtork name”
#psk=”secret password”
psk=a88e47d7445844838dc65179772b8866de6be6b478d5f47444e18ee709ee2016
}

Copy this in the file /etc/wpa_supplicant.conf (creare it if it dosen’t exist) and add these lines before ending }:

key_mgmt=WPA-PSK
proto=WPA

Now you have to config your network usign these commands:

sudo iwconfig ath0 essid “Network name”
sudo wpa_supplicant -B -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf
sudo dhclient ath0

Don’t delete the directory where you downloaded the driver, you could need to re-compile it after some upgrade. (in this case do: “make clean” then re-compile)

Now your Mac is a perfect penguin. Ehmmm not really perfect, but good enought.

Are you happy now? What do you need more? Ahhhhh if I only could have zfs and DTrace…

 Posted by at 23:33 - 023