You are on page 1of 8

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

Published on Free Software Magazine (http://www.freesoftwaremagazine.com)

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
By Andrew Min
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 dont 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 wont work with ATI cards, and vice versa). And worst of all, virtually all of the tutorials
out there are for Ubuntu and wont 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, weve 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
SystemAdministrationRestricted Drivers Manager (SettingsRestricted Drivers Manager in Kubuntu), or
ATI card owners

From the driver to the window manager: how to install Compiz Fusion for Ubuntu, Kubuntu, and Xubuntu
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

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:
Getting the driver

From the driver to the window manager: how to install Compiz Fusion for Ubuntu, Kubuntu, and Xubuntu
[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. Youre 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 SystemAdministrationRestricted Drivers Manager
(SettingsRestricted 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

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 dont have to create a separate session to log into. The only thing you need to do is edit a few
config files. Finally, AIGLX doesnt 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.

NVIDIA card owners

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

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
Dont 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

AIGLX

From the driver to the window manager: how to install Compiz Fusion for Ubuntu, Kubuntu, and Xubuntu
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. Youre now done!
Now, youre going to get Compiz Fusion.

Getting Compiz Fusion


Installing prerequisites
First, make sure the packages compiz-core and desktop-effects are uninstalled
(ubuntu-desktop may be removed). Next, add new repositories to the file
/etc/apt/sources.list:
#
#
#
#
#
#

Trevi? Ubuntu feisty EyeCandy Repository


(GPG key: 81836EBF - DD800CD9)
Many eyecandy 3D apps like Beryl, Compiz,
Fusion and kiba-dock snapshots
built using latest available (working)
sources from git/svn/cvs.

deb http://download.tuxfamily.org/3v1deb feisty eyecandy


deb-src http://download.tuxfamily.org/3v1deb feisty eyecandy

(64-bit users should use deb http://download.tuxfamily.org/3v1deb feisty


eyecandy-amd64 and deb-src http://download.tuxfamily.org/3v1deb feisty
eyecandy-amd64 instead).
Youll also need to add the GPG key. To do this, run the following command in your favorite terminal:
gpg --keyserver subkeys.pgp.net --recv-keys 81836EBF
gpg --export --armor 81836EBF | sudo apt-key add -

Now, update your system.

Actually installing the dang thing


Its finally time to install Compiz Fusion! Ubuntu (GNOME) and Xubuntu (Xfce) users should install the
following packages:
Getting Compiz Fusion

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

compiz compiz-gnome compizconfig-settings-manager compiz-fusion-plugins-extra compiz-fusion-plugi

Kubuntu (KDE) users should install:

compiz compiz-kde compizconfig-settings-manager compiz-fusion-plugins-extra compiz-fusion-plugins

Make sure you are in the Xgl session (or that AIGLX is enabled). Now, it is the moment of truth! Run the
following:
compiz --replace

If the windows flicker, lose their title bars, and then reappear, youve got Compiz Fusion running. To double
check, move around a window. If it acts differently than normal, youre running Compiz Fusion! To configure
Compiz Fusion, run ccsm or SystemPreferencesCompizConfig Settings Manager (Kubuntu users should
find it under SettingsCompizConfig Settings Manager).

Figure 3: Compiz Fusion in GNOME

Figure 4: Wobbly Windows while playing Klondike

Actually installing the dang thing

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

Figure 5: Maximizing KPat

Figure 6: The magical Aladdin effect

Figure 7: Literally playing with Emerald themes


To make it so that Compiz Fusion automatically runs when you log in, add the command compiz
--replace to the startup (Gentoo Wiki has a good article on how to do this).
Do you like the Emerald window decorations that ship with Beryl? Compiz Fusion users can use it! Make
sure the package emerald-themes is installed (it will also install Beryl, so dont be surprised if its a hefty
package). Then, run compiz --replace -c emerald & instead of compiz --replace.

Actually installing the dang thing

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

Resources
Current Compiz Fusion homepage
Old Compiz homepage
Compiz Fusion Blog
Compiz Fusion Forums
Ubuntu Wiki article on Compiz Fusion

Biography
Andrew Min (/user/37372" title="View user profile.): 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 including Free Software Magazine, Full Circle Magazine, and Mashable.com

Copyright information
This article is made available under the "Attribution-Sharealike" Creative Commons License 2.5 available
from http://creativecommons.org/licenses/by-sa/2.5/.
Source URL:
http://www.freesoftwaremagazine.com/articles/installing_compiz_fusion

Resources

You might also like