Important!: If you are running Ubuntu Feisty Fawn (7.04) or above, you can skip this as it is done for you by default.

We need to edit the X.org Configuration file to allow for AiGLX and Composite so that Compiz can run. To do this, you need to open the file /etc/X11/xorg.conf with a text editor with root permissions. Note that editing this file requires precision as any inaccuracies may cause the X server to encounter errors when reading the file and fail to start. A good way to do this is to open the file with the command line based nano:

sudo nano /etc/X11/xorg.conf

The nano editor editing xorg.conf

Some tips when using the nano editor:

Use the 'Up' key and the 'Down' key to navigate up and down and the 'Left' and 'Right' key to move the cursor to another character.

Use Ctrl-X to exit

Use Ctrl-O to save

Use Ctrl-C to display where the cursor is on the document.

Now, we need to change a few sections. First, we need to load all required modules. Navigate to Section "Module" and make sure that the following is added or present:

Section "Module"
Load "dri"
Load "glx"
Load "dbe"

Add these to Section "Device"

Option "XAANoOffscreenPixmaps" "true"
Option "DRI" "true"

Add these to Section "ServerLayout"

Option "AIGLX" "true"

Make sure Section "DRI" looks like this

Group "video"
Mode 0660

Finally, add this to Section "Extensions"

Option "Composite" "Enable"

Starting Compiz Fusion

Once you have completed the above step and restarted your X server (Either by logging out or rebooting), you can start compiz like this:

It's a handful to type, so you might want to make an executable script which contains that command, or use one of the provided startup managers such as Compiz-Manager or Compiz Fusion Icon to handle adding all this for you.

You can also create an Autostart , so that Compiz Fusion will be launched when you log in.

Workaround for common problems

Blue Video fix: This is due the the fact that the XVideo extension is not composite aware and draws blue instead of video on areas where the composite manager is doing work. To avoid this, you need to switch your favorite video player's output from XV to X11/XImage/XShm. Refer to your player's documentation on how to do that.