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

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


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 ATIFigure 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 NVIDIAFigure 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.

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ño's 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).

You’ll 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

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

compiz compiz-gnome compizconfig-settings-manager compiz-fusion-plugins-extra compiz-fusion-plugins-unofficial libcompizconfig-backend-gconf

Kubuntu (KDE) users should install:

compiz compiz-kde compizconfig-settings-manager compiz-fusion-plugins-extra compiz-fusion-plugins-unofficial libcompizconfig-backend-kconfig

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, you’ve got Compiz Fusion running. To double check, move around a window. If it acts differently than normal, you’re running Compiz Fusion! To configure Compiz Fusion, run ccsm or System→Preferences→CompizConfig Settings Manager (Kubuntu users should find it under Settings→CompizConfig Settings Manager).

Figure 3: Compiz Fusion in GNOMEFigure 3: Compiz Fusion in GNOME
Figure 4: Wobbly Windows while playing KlondikeFigure 4: Wobbly Windows while playing Klondike
Figure 5: Maximizing KPatFigure 5: Maximizing KPat
Figure 6: The magical Aladdin effectFigure 6: The magical Aladdin effect
Figure 7: Literally playing with Emerald themesFigure 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 don’t be surprised if it’s a hefty package). Then, run compiz --replace -c emerald & instead of compiz --replace.

Resources

Category: 
License: 

Comments

Gary Trickett's picture
Submitted by Gary Trickett (not verified) on

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
Submitted by Andrew Min on

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/

Author information

Andrew Min's picture

Biography

/ˈændruː/ /mi:n/
(n): a Christian.
(n): a student.
(n): a technology enthusiast.
(n): a journalist for several online publications.

Andrew Min is a student, programmer, and journalist from New York City.

My main forte in the technology realm is journalism. I’ve written for a variety of magazines, both print and non-print, with a focus on open source software and the new web. I’ve also been interviewed on a long list of topics, ranging from politicians on Twitter to open source software and homeschooling.

I also have experience with a variety of programming languages (Bash, Batch, CSS, JavaScript, PHP, and (X)HTML) and content management systems (WordPress). I’ve been hired to design and administer several websites. In addition, I’ve been the lead programmer on several small coding projects.

Most forwarded

Interview with Dave Mohyla, of DTIDATA

Dave Mohyla is the president and founder of dtidata.com, a hard drive recovery facility based in Tampa, Florida.

TM: Where are you based? What does your company do?
DTI Data recovery is based in South Pasadena, Florida which is a suburb of Tampa. We have been here for over 10 years. We operate a bio-metrically secured class 100 clean room where we perform hard drive recovery on all types of hard disks, from laptop hard drives to multi drive RAID systems.

Anybody up to writing good directory software?

Since the very beginning, directories (of any kind) have had a very central role in the internet. (I have recently grown fond of Free Web Directory. Even Slashdot can be considered a directory: a collection of great news and invaluable user-generated comments. As far as software is concerned, doing a quick search on Google about software directories will return the free (as in freedom) software directories like Savannah, SourceForge, Freshmeat and so on, followed by shareware and freeware sites such as FileBuzz, PCWin Download Center and All Freeware (great if you're looking for shareware and freeware, but definitely less comprehensive than their free-as-in-freedom counterparts).

Interview with Mark Shuttleworth

Mark Shuttleworth is the founder of Thawte, the first Certification Authority to sell public SSL certificates. After selling Thawte to Verisign, Mark moved on to training as an astronaut in Russia and visiting space. Once he got back he founded Ubuntu, the leading GNU/Linux distribution. He agreed on releasing a quick interview to Free Software Magazine.

Is better education the key to finding better software?

I read David Jonathon's article Anybody Up To Writing Good Directory Software? the other day, which got me thinking about software directories in general. As David mentioned, many of the software directories one finds when doing a quick google search are free as in beer, not as in freedom. But what interests me is the software directories that already exist, providing a combination of both free as in beer software, and open source software. Sites such as Freeware Downloads and Shareware Download don't advertise themselves as providing free as in liberty software, but each of them have a good selection of open source software available... if you know where to look.

Most emailed

Free Open Document label templates

If you’ve ever spent hours at work doing mailings, cursed your printer for printing outside the lines on your labels, or moaned “There has got to be a better way to do this,” here’s the solution you’ve been looking for. Working smarter, not harder! Worldlabel.com, a manufacture of labels offers Open Office / Libre Office labels templates for downloading in ODF format which will save you time, effort, and (if you want) make really cool-looking labels

Creating a user-centric site in Drupal

A little while ago, while talking in the #drupal mailing list, I showed my latest creation to one of the core developers there. His reaction was "Wow, I am always surprised what people use Drupal for". His surprise is somehow justified: I did create a site for a bunch of entertainers in Perth, a company set to use Drupal to take over the world with Entertainers.Biz.

Update: since writing this article, I have updated the system so that the whole booking process happens online. I will update the article accordingly!

So, why, why do people and companies develop free software?

More and more people are discovering free software. Many people only do so after weeks, or even months, of using it. I wonder, for example, how many Firefox users actually know how free Firefox really is—many of them realise that you can get it for free, but find it hard to believe that anybody can modify it and even redistribute it legally.

When the discovery is made, the first instinct is to ask: why do they do it? Programming is hard work. Even though most (if not all) programmers are driven by their higher-than-normal IQs and their amazing passion for solving problems, it’s still hard to understand why so many of them would donate so much of their time to creating something that they can’t really show off to anybody but their colleagues or geek friends.

Sure, anybody can buy laptops, and just program. No need to get a full-on lab or spend thousands of dollars in equipment. But... is that the full story?

Fun articles

Santa Claus - the most successful open source project

It dawned on me the other day, as I was shopping for the dozens of gifts it seems I have to buy every December, that Santa Claus is the most successful open source project in history. (Bridget @ Illiterarty would agree with that). Santa Claus is essentially a marketing development that is embodied by everyone who stuffs a sock, gives a gift, hosts a dinner or wishes Merry Christmas over the holiday season.

Most emailed

Editorial

When I first started thinking about Free Software Magazine, I was feeling enthusiastic about the dream. I had Dave, Gianluca, and Alan willing to help me, I had established members of the free software community willing to help me out, I had writers volunteering their time and energy for free, and I had a generous offer from OpenHosting for servers, all before I'd proved myself. There was a sense of excitement in the air, and I thought maybe, just maybe, I could make this work.

Free Software Magazine uses Apollo project management software and CRM for its everyday activities!