From the driver to the window manager: how to install Compiz Fusion for Ubuntu, Kubuntu, and Xubuntu

The step-by-step guide to installing ATI/NVIDIA, Xgl/AIGLX, and Compiz Fusion

Download the whole article as PDF

Write a full post in response to this!


The 3D world just got a lot brighter with the birth of Compiz Fusion, a powerful compositing window manager for GNU/Linux operating systems. Originally there was one project, Compiz, but the project forked into Compiz, and the unstable and unofficial fork of Compiz known as Beryl. Now, the two projects have been reunited for one amazing compositing window manager. In a nutshell, it adds effects to your desktop like wobbly windows (the windows actually wobble when you move them), a cool virtual desktops manager via a cube, and much more. For proof of how cool it is, just do a Google Video/YouTube search for “compiz fusion”.

Unfortunately, Compiz Fusion has little or no documentation. The little that exists is meant for hardcore geeks who are expected to know what obscure and unintuitive commands like “git” are. They also don’t explain how to install a composite manager or a video card driver (both of which are required for Compiz Fusion to function properly). Worse still, much of the documentation available will only work for one type of video card (NVIDIA tutorials won’t work with ATI cards, and vice versa). And worst of all, virtually all of the tutorials out there are for Ubuntu and won’t work for Kubuntu or Xubuntu users. Therefore, this guide was created as a sort of all-in-one guide for all users of the major Ubuntu distributions and the major video cards.

Warning: Most, if not all, of this software (including Compiz Fusion itself) is alpha. It should work, but there is the chance it will not. Therefore, it should not be used on production machines. You have been warned.

ATI card owners

Getting the driver

The first thing to do is to get the video card driver. There are two modern ATI drivers available to Ubuntu users: the unofficial free software Radeon driver and the ATI official (and proprietary) fglrx driver. fglrx is available for Radeon users 9000+ and X series users (e.g. Radeon X3000), though it may work for other ATI cards as well. Unfortunately, Radeon is extremely slow when running Compiz Fusion (enough to make it unusable). So, we’ve got to go with the proprietary fglrx.

First, update your system using your favorite package manager. Next, make sure the packages linux-restricted-modules-generic and restricted-manager are installed. Then go to System→Administration→Restricted Drivers Manager (Settings→Restricted Drivers Manager in Kubuntu), or run restricted-manager as root (sudo restricted-manager in your favorite terminal). After entering your password, you will see an option for ATI accelerated graphics driver. Check that it is enabled. For more information, read the Ubuntu Wiki page, BinaryDriverHowto/ATI.

Figure 1: Restricted manager for ATI
Figure 1: Restricted manager for ATI

Getting the X server

The newest version of X.Org includes AIGLX, which includes GLX rendering capabilities required by Compiz Fusion. Unfortunately, AIGLX requires that you use the Radeon driver, which is too slow to run Compiz Fusion with. Therefore, we need to use a new X server called Xgl.

First, install the xserver-xgl package in the universe repository. Next, create a text file (as root) in the location /usr/bin/startxgl.sh. What goes in the text file depends on which desktop environment you will use. Ubuntu (GNOME) users will enter this:

#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &
DISPLAY=:1
dbus-launch --exit-with-session gnome-session

Kubuntu (KDE) users should enter:

#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &
DISPLAY=:1
exec startkde

And finally, Xubuntu (Xfce) users should enter:

#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &
DISPLAY=:1
exec xfce4-session

Note: DBUS is required for the GNOME login

Save, and close the file. Make it executable (run sudo chmod +x /usr/bin/startxgl.sh in your favorite terminal). Now, create a new file (again as root) called /usr/share/xsessions/xgl.desktop. In it, put the following:

[Desktop Entry]
Encoding=UTF-8
Name=Xgl
Comment=Start an Xgl Session
Exec=/usr/bin/startxgl.sh
Icon=
Type=Application

Save, and log out of your session. At the login manager, choose Xgl as the session type. You’re done! Now, skip the next section to go to Getting Compiz Fusion.

NVIDIA card owners

Getting the driver

Like ATI users, there are several options for NVIDIA owners. The most popular is the free software nv driver. But like ATI users, the best performance for Compiz Fusion seems to come from the proprietary NVIDIA driver (aptly named nvidia).

First, update your system. Next, make sure the packages linux-restricted-modules-generic and restricted-manager are installed. Then go to System→Administration→Restricted Drivers Manager (Settings→Restricted Drivers Manager in Kubuntu), or run restricted-manager as root (sudo restricted-manager in your favorite terminal). After entering your password, enable the NVIDIA option. You should now be using the NVIDIA driver. More information is available at the Ubuntu Wiki page, BinaryDriverHowto/Nvidia.

Figure 2: Restricted manager for NVIDIA
Figure 2: Restricted manager for NVIDIA

Getting the X server

NVIDIA users are a lot luckier than ATI users: they can choose between Xgl and AIGLX for their server. The nice thing about AIGLX is that it is built into X.Org 7.1, so you can enable it without installing anything. In addition, you don’t have to create a separate session to log into. The only thing you need to do is edit a few config files. Finally, AIGLX doesn’t require a separate session, unlike Xgl. Xgl is less stable and requires getting the xgl-server package (and for GNOME users, installing the DBUS package), but has less configuring to do.

AIGLX

To use AIGLX, open up /etc/X11/xorg.conf in a text editor. Make sure that under the Section “Module” that you have the following:

Load "dri"
Load "dbe"
Load "glx"

Also, under Section “Device” you should have:

Option "XAANoOffscreenPixmaps"

You may need to add this to the device section:

Option "AddARGBGLXVisuals" "True"

Lastly, make sure the following is enabled (probably at the end of the file):

Section "DRI"
Mode 0666
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

You should now be set.

Xgl

Don’t feel like editing all those configuration options? Like to stay on the bleeding edge? Xgl is your answer.

First, install the xserver-xgl package in the universe repository. Next, create a text file (as root) in the location /usr/bin/startxgl.sh. What goes in the text file depends on which desktop environment you will use. Ubuntu (GNOME) users will enter this:

#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:fbo -accel glx:pbuffer &
DISPLAY=:1
dbus-launch --exit-with-session gnome-session

Kubuntu (KDE) users should enter:

#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:fbo -accel glx:pbuffer &
DISPLAY=:1
exec startkde

And finally, Xubuntu (Xfce) users should enter:

#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:fbo -accel glx:pbuffer &
DISPLAY=:1
exec xfce4-session

Note: DBUS is required for the GNOME login

Save, and close the file. Make it executable (run sudo chmod +x /usr/bin/startxgl.sh in your favorite terminal). Now, create a new file (again as root) called /usr/share/xsessions/xgl.desktop. In it, put the following:

[Desktop Entry]
Encoding=UTF-8
Name=Xgl
Comment=Start an Xgl Session
Exec=/usr/bin/startxgl.sh
Icon=
Type=Application

Save, and log out of your session. At the login manager, choose Xgl as the session type. You’re now done! Now, you’re going to get Compiz Fusion.

Don't miss out on the other pages!
12next ›last »

Write a full post in response to this!

Similar articles

0

Do you like this post?
Vote for it!

Copyright information

This article is made available under the "Attribution-Sharealike" Creative Commons License 3.0 available from http://creativecommons.org/licenses/by-sa/3.0/.

Biography

Andrew Min: Definition: Andrew Min (n): a non-denominational, Bible-believing, evangelical Christian. (n): a Kubuntu Linux lover (n): a hard core geek (n): a journalist for several online publications (see them all at http://www.andrewmin.com/ )

Alexwebs's picture

Thank you so much for your help and for your efforts.

Submitted by Alexwebs (not verified) on Thu, 2007-10-11 00:45.

Vote!
0

Actually one of my friends first read this article and asked me to visit this page. This article has very useful information, it will be helpful for many. It’s really amazing to read this description of this article. Thank you so much for your help and for your efforts.

Thanks,
Alex

Gary Trickett's picture

Thanks muchly

Submitted by Gary Trickett (not verified) on Fri, 2007-11-30 13:48.

Vote!
0

Ubuntu 7.10 Gutsy

IBM T43p Mobility FireGL V3200
Compiz no joy with Restricted Driver (aka ATI), composite extension unavailable - too slow and prone to lock ups with default driver.
but...
install restricted driver (I had it installed with no desktop effects)
reboot
install xserver-xgl with Synaptic Package Manager.
Message from package manager saying on restart new xserver will be used
NOTE I performed no other modifications to the system, re shell scripts or configs

reboot or restart X server, enable desktop effects
Hey Presto...

it works...fast, no lock ups - the biz.

Thanks again..

Andrew Min's picture

Ah well....

Submitted by Andrew Min on Thu, 2007-12-13 14:37.

Vote!
0

Ah, but you used the new Gutsy, which has that nice little feature. In Feisty, it wouldn't work.

--
Andrew Min
http://andrew.timstown.net/