Compiz and Emerald in Xubuntu
This was written for Xubuntu 8.04. A newer version of (X)Ubuntu has now been released where the problems I had should be fixed by default. This article should therefore not be needed, unless you are using an old version. The instructions can also have some unforeseen consequences on other versions, as Lenswipe mentions in the comments.
Once the first part of my new Xubuntu installation was done it was time to fix all the other issues that require customizing. After spending an evening poking at various options and trying out different icon sets and themes I ended up the desktop shown bellow.
The steps I took to acquire that look are described bellow.
Installation of a graphics driver
To get all the fancy effects enabled we need to install Compiz and Emerald. To enable these I had to get the graphics card working properly. Xubuntu managed to find and recognize the graphics card, but for some reason the drivers weren’t loaded properly.
mesa-utils contains a couple of nice tools for testing and debugging graphics so I decided to get it installed. Luckily it is part of the standard repositories, so all that was needed for the installation was to type:
sudo aptitude install mesa-utils
Among the packages installed along side meta-utils was the standard fglrx driver package for ATI-cards. Once all of the packages were installed I rebooted the computer and ran
glxinfo | head
The glxinfo program outputs a lot of information about your graphic setup, but for our current purpose the top part is the only one of interest - therefore we pipe it through head (head is a very nice little program that returns the first 10 lines of whatever is inserted). The output I got from that command was
name of display: :0.0 display: :0 screen: 0 direct rendering: Yes server glx vendor string: SGI server glx version string: 1.2 server glx extensions:
The important line here is the "direct rendering: Yes", which implies that the graphics hardware is properly initialized. If this says "direct rendering: No" it means that something is wrong with your current graphics setup.
Since I hadn’t done any real changes to the system yet I didn’t expect the graphics drivers to be loaded yet, but it seems that installing the fglrx drivers was the only thing required to get my ATI card working. I’m not one to complain about stuff working for no apparent reason, so I continued on to the next part.
Using AIGLX
Edit 2009-06-17: After getting some feedback it turns out that this part of isn’t always needed, sometimes Ubuntu will take care of AIGLX without you having to do anything. Some extra details about the modules used has been added to this section as well.
We now need to enable some form of composite managing of the rending in Xorg. Composite rendering ensures that the rendering of windows and other effects are done on the graphics card, instead of on the CPU as it was traditionally done. The standard composite manager in Xorg is called AIGLX. To check that your graphics card is supported you can run
glxinfo | grep 'GLX_EXT_texture_from_pixmap'
If that command returns a non-empty string you’re good to go.
Since AIGLX is part of Xorg now installation is pretty easy, all that is required is enabling a couple of options in the /etc/X11/xorg.conf file. When making changes to the xorg.conf file it is very important to make a backup of the previous working copy, since sooner or later you’re bound to make a change that stops Xorg from working properly. Once a backup has been made (cp /etc/X11/xorg.conf ~/xorg.conf-working) the first step is opening xorg.conf in an editor as root so we can make the required changes
sudo vim /etc/X11/xorg.conf
In the "Module" section of the file add the following lines
Load "dri" Load "dbe" Load "glx"
The dri and dbe modules aren’t required for Compiz to run, but they enable extra functionality that is nice to have. The dbe module supplies double buffering functionality in X, and dri enables the “Direct Rendering Interface” which is required for applications that need direct communication with the OpenGL library.
On older graphic cards the the following has to be added to the "Device" section
Option "XAANoOffscreenPixmaps" "true"
I would recommend first trying without that option set, and only adding it if doesn’t work without.
Then the following should be appended to the end of the file
Section "DRI" Mode 0666 EndSection Section "Extensions" Option "Composite" "Enable" EndSection Section "ServerLayout" Identifier "Default Layout" #otherwise will give an error and fail to load GDM Option "AIGLX" "true" EndSection
The ServerLayout lines can also be added to an already existing ServerLayout section if it is present.
With those changes done you can restart the X server to ensure that everything still works. The fastest way to restart the X server is by executing
sudo /etc/init.d/gdm restart
This command will restart the Gnome Desktop Manager, which is the default even though I’m currently running Xfce and Xubuntu.
Compiz and Emerald installation
If Xorg starts up properly after the changes above it is time to install Compiz. As most programs in Ubuntu Compiz is installed using aptitude.
sudo aptitude install compiz compizconfig-settings-manager
That command will install both Compiz and the Compiz configuration utility. Compiz is then started by executing
compiz --replaceThe –replace tells Compiz to replace the current window manager. Once Compiz has started up you can configure it using the configuration utility we installed, which can be found in Applications -> Settings -> Advanced Desktop Effects Settings.
To get Compiz to start as soon as we log in it should be enough to place the compiz --replace among the auto started applications, but for some reason this didn’t work for me. So currently I have to run the compiz --replace command every time I start the computer. It is pretty annoying, but until I figure out why it is happening it is a workable solution.
Having installed Compiz we need to get some nice themes to use. It is possible to continue with the standard theme manager, but I opted for installing the Emerald Theme manager instead since I had found a nice theme for it. Installing Emerald is no harder than any other application, simply execute
sudo aptitude install emerald
To get Compiz to use Emerald as its’ theme manager you have to go to the Advanced Desktop Effects Settings, and there go to the Effects -> Window Decoration sub menu. There you’ll find a text field called Command, which should be set to /usr/bin/emerald.
We’ve now installed everything we need to make Xubuntu look and feel as we desire, so it is time to play around with the various settings and look around for themes to use. A good place to find themes is Xfce-look, which has themes, icons and whatever else you might need. After some testing I settled on using the SlickneS theme with icons from the Final Order set, and the final result of that is as shown at the top of the post.

franko Said,
June 16, 2008 @ 03:26
I tried this. It doesn’t work. I already have running compiz and emerald, so I tried this out of curiosity, because I installed it in a different way…
The main difference is the AIGLX part, which I skipped, as I didn’t know about that. So I tried to do just that one. And it massed up my xorg configuration.
I already have compiz installed and checked in my startup list, so I thought it should everything work after that little xorg.conf setup. I restarted my X session. It asked me for some additional graphic related setup. I told him I have a fglrx card, all the other stuff was already right. It told me to restart my computer, so I did a ctrl-alt-del. The GDM theme looked just fine, but when I logged in, compiz was not runnig (emerald neither). I tried to do a comiz in the terminal (and also a compiz –replace) and it didn’t want to run, it was saying there is no xgl… ??? Strange…. it runs normally by default, without xgl… but this way not… I really don’t know what went wrong. Maybe the order of installing and configuring makes the difference, but I doubt it.
All I did to install compiz and emerald was the routine installation of fglrx suggested by the Ubuntu’s restricted hw driver manager. After that, I installed compiz and emerald with apt-get, and added compiz to the startup list, restarted X, and everything was fine, and now still is. Except for open gl blinking in low resolutions, I can’t figure out why’s that, but that’s not compiz related. Compiz works perfectly.
So, I wanted to ask, what’s really the purpose of that AIGLX part of this howto? And what do you think it could have been that went wrong in my attempt to add that too?
I tried to do it hoping it would unload my cpu, and maybe it would, but without compiz, as it seems… :-/
Sorry if this is written confusing, I feel sleepy…
Michael Plikk Said,
June 16, 2008 @ 21:16
Thanks a lot for your response!
The reason for installing AIGLX is explained in my latest post about AIGLX and XGL.
Why it didn’t work for you is very strange though, and even stranger is that you managed to get Compiz working without AIGLX (or XGL) to begin with. The only thing I can imagine is that Ubuntu managed all those parts for you behind the scenes when you installed Compiz and Emerald. If that is the case it is strange that I had to do it manually.
rancor Said,
August 11, 2008 @ 22:27
Hi.
Have you tried to disable Xfce “composite manager”. You will find it in Applications/Settings/Settings manager/Window Manager Tweaks.
I had to turn it off to make Compiz-Fusion work every time during start up.
Best regards rancor
Michael Plikk Said,
August 15, 2008 @ 09:25
Thanks a lot Rancor, that solved my problem! Finally Compiz is starting up automatically again :)
Xsabre Said,
September 9, 2008 @ 21:37
Great Article…
Trying to get Compiz running with xfce window manager. It is working but CPU is pegged at 100%. So it is very slow… If you have any ideas I would greatly appreciate it.
System Specs:
Xubuntu 8.04.1
Dell Inspiron 8100
CPU 1 Ghz
386 Memory
Geforce 2 Go
Thanks in advance..
Michael Plikk Said,
September 16, 2008 @ 22:50
Afraid I can’t help you Xsabre. I’ve done some looking around and I couldn’t find anything that would help solve your problem.
My advice would to ask on either the #xubuntu irc chat or on the official forums.
Lenswipe Said,
November 5, 2008 @ 03:08
PEOPLE DONT TRY THIS!!!!
It completely broke my ubuntu installation. My keyboard thinks its an american keyboard, compiz doesnt work on GNOME, neither does Avant Window Navigator, Direct Rendering now says No. Advanced Desktop effects refuses to turn on under the desktop effects tab.
In other words this tutorial taught me how to break my ubuntu install.
Michael Plikk Said,
November 5, 2008 @ 09:53
@Lenswipe: Did you use the new version of Ubuntu when you tried to follow these steps? I wrote this for Xubuntu 8.04, not for Ubuntu 8.10 (which is the new version as a couple of days ago). In Ubuntu 8.10 a lot of changes where done to how Xorg works, as well as an upgrade to Xorg 7.4. In practice that means that most of the problems I experienced earlier are fixed by default, and my “fixes” should not be needed any more.
To get your installation back to normal it should be enough to remove the packages that where installed (just make sure you don’t uninstall something that was there earlier), and then run
sudo dpkg-reconfigure -phigh xserver-xorgto reconfigure yourxorg.conffile.Thanks for the heads up though. I’ll add a note to the beginning that this is meant for Xubuntu 8.04, and might have strange effects on other versions.
Dolce Said,
February 6, 2009 @ 14:05
Thank you for sharing. I came to this site to read how things really are
Michael Said,
May 16, 2009 @ 14:02
ice tutorial, my xubuntu in fantastic… i have only a problem
Load “dri”
Load “dbe”
Load “glx”
i cant open the xorg.conf file with the command that you have suggested… i have done this on xubuntu 9.10
now the only thing that i haven’t is the effect around the borders of applications menu, for example… what can i do?