howto: ubuntu dapper with xgl/compiz

WARNING: this howto is outdated and will likely break your system if you try to follow it. please use the updated version here.

first off, let’s take a moment to talk about xgl/compiz and what they are and what they can do for us. here is a description of xgl from the open suse web site:

Xgl is a new Xserver architecture layered on top of OpenGL. Xgl can perform intricate graphical operations–such as rendering antialiased fonts–noticeably faster than other available Xservers that do not use OpenGL. The current implementation is Xglx but the future implementation of Xgl will be Xegl.

More important than speed alone, Xgl accelerates complex composite operations, making possible new stunning visual effects through on OpenGL-enhanced composition/window managers like Compiz. These visual effects have broad practical use, making Linux more accessible for the visually impaired, and creating a workspace that is easier to comprehend and navigate for less experienced users.

that’s all well and good, but what does it mean in terms of practical every day use? well, i made a video of xgl/compiz running on my computer to show you. this is the new face of the linux desktop:

now, if you’re anything like me… seeing that video puts only one thought in your head: how do i make my computer do that stuff? the answer, though not simple, is not as complex or as difficult as you might think. my intention is to give you a little crash course, the end result of which is hopefully a working xgl/compiz installation running on top of ubuntu dapper. now… when i say crash course, i mean it. looking over this guide, it really would be best if you had some linux experience under your belt before trying to follow this particular one. there are many others on ubuntu forums that could be more helpful to newbies than the flurry of commands and configuration files you’re about to see when you head into this howto.

before we get started, let’s cover a few basic requirements. in order to have a good experience with ubuntu/xgl, you’re going to need at least:

  • an 800mhz pentium 3 or so
  • about 256mb of ram
  • an nvidia geforce or ati radeon series video card
  • about 10gb of hard drive space to play with

i have a laptop that is a 700mhz pentium 3 with a geforce2 go graphics adapter that runs quite well with xgl, so rest assured that (unlike windows vista) you don’t need the latest, greatest, most expensive hardware to get this kind of desktop functionality.

installing ubuntu

the first thing we need to do is get linux actually installed on the computer. we’re going to be using ubuntu linux, which is debian based and a very polished distribution. you’ll find the download page here, be sure to get the “PC (Intel x86) install CD” for ubuntu 5.10 (breezy badger). do not use the amd64 version, even if you have an amd64 or em64t enabled processor.

the installation is pretty straight forward and very easy. pretty much just boot from the CD and follow the on-screen instructions. if you need a detailed description of the installation procedure, you can find one here.

after you’ve installed ubuntu and logged in, we need to go about installing some commonly used software. for this, we’re going to use automatix. the first thing we need to do is get it installed, which you can do by copying and pasting the following commands into a terminal window (found under applications > accessories > terminal).

wget http://beerorkid.com/automatix/automatix_5.7-3_i386.deb
sudo dpkg -i automatix_5.7-3_i386.deb

the second command will ask you for your password, so go ahead and put it in. you should be able to find automatix under applications > system tools > automatix. if not, just use the following command in your terminal to run it:

Automatix

it is important to note that filenames and commands in linux are case sensitive so take care to be aware of that, specifically capitalizing the “A” in the Automatix command. automatix will ask for your password, and you can go ahead an enter it. the interface is simple, basically a list of items that you can check off what you want to install. i would recommend that you install the following items.

  • multimedia codecs
  • all firefox plugins (java, flash, etc)
  • rar, ace and unrar archive support
  • acrobat reader 7 and firefox plugin
  • gftp
  • amule
  • frostwire
  • mplayer and plugin
  • totem-xine, real player, vlc and beep media player
  • bittorrent clients
  • numlock on
  • ms true type fonts
  • non-free audio and dvd codecs
  • ndisgtk (if you have a wireless card)
  • sun’s java jre
  • enable ejection of cd when button is pressed
  • mercury if you need a full featured msn client
  • turn dma on
  • nvidia drivers (if you have an nvidia card)

obviously there is quite a bit of personal preference involved there, but i’ve found that configuration works well for most people one thing we should note here, any java software using the swing toolkit (this includes mercury and frostwire) will not work under xgl, so be aware of that. once you get everything selected and send automatix on its way, it will be working for quite some time depending on the speed of your internet connection. if you have an nvidia card, you should be all set. if you have an ati card, we need to get the drivers installed now. first thing to do is get the drivers installed by using these commands:

sudo apt-get install xorg-driver-fglrx
sudo apt-get install linux-restricted-modules-$(uname -r)
sudo dpkg-reconfigure xserver-xorg

after running the last command, you’ll be asked for some configuration options. be sure to choose fglrx as your driver, and pick something sensible for the rest of the options. god willing, we should all have 3d acceleration now. do a quick ctrl+alt+backspace to restart xorg. this would be a good time to go poking around over at gnome-look.org to pick out some different icons or themes or whatever. most of these can be installed by simply dragging and dropping the downloaded file on the themes window (fount under system > preferences > themes). when you’re done mucking about, it’s time to upgrade to dapper.

upgrading to dapper

this part should be pretty easy. we need to open up synaptic package manager (found under system > administration > synaptic package manager). once you have that open, you’ll need to go to settings > repositories. from here we need to edit each source and change the distribution field to dapper instead of breezy (or dapper-security insead of breezy-security, etc). once you’re done there, click on the “add” button. on the following window, click the “custom” button and paste this line into the dialog box:

deb http://www.beerorkid.com/compiz/ dapper main

and then click add channel, then click close. synaptic will probably tell you you need to update your sources, which you can do by pressing the reload button. once that finishes, click mark all upgrades and then click mark on the window that pops up. all that’s left to do is click apply, apply and then wait for it to finish, at which time you’ll need to reboot and that should be all.

setting up xgl

now for the cool stuff. assuming everything thus far has worked ok, we’re ready to set up xgl. the first thing we need to do is install the packages for xgl. we can do that by entering the following command in a terminal:

sudo apt-get install compiz xserver-xgl libgl1-mesa xserver-xorg libglitz-glx1 compiz-gnome

once that finishes, wee need to configure our video card for xgl. the file we need to edit is /etc/X11/xorg.conf and we can edit it by opening a terminal and executing this command:

sudo gedit /etc/X11/xorg.conf

find the following lines:

Load "GLcore"
Load "dri"

and change them to (if you have an ati card, leave the “dri” line alone)

# Load "GLcore"
# Load "dri"

if you have an nvidia card, you also need to find the device section. it will have a line like this:

Driver "nvidia"

and you need to paste 2 lines underneath that one, to make it look like this:

Option "RenderAccel" "true"
Option "AllowGLXWithComposite" "true"

now just save and close the file. the next thing to do is make sure that our login manager starts xgl instead of regular xorg. first, copy and paste these commands:

sudo rm /usr/bin/X
sudo ln -s /usr/bin/Xgl /usr/bin/X

now we need to edit a configuration file, which you can do by entering this command:

sudo gedit /etc/gdm/gdm.conf-custom

when the file opens, replace whatever is there with the following for an nvidia card:

[daemon]

[security]

[xdmcp]

[gui]

[greeter]

[chooser]

[debug]

[servers]
0=Xgl

[server-Xgl]
name=Xgl server
command=/usr/bin/Xgl :0 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo
flexible=true

or this one for an ati card:

[daemon]

[security]

[xdmcp]

[gui]

[greeter]

[chooser]

[debug]

[servers]
# Override display 1 to use Xgl (DISPLAY 1 IMPORTANT FOR ATI FGLRX).
1=Xgl

[server-Xgl]
name=Xgl server
command=/usr/bin/Xgl :1 -fullscreen -ac -accel glx:pbuffer -accel xv:pbuffer
flexible=true

just save and close the file. if you have an ati card, you also need to edit another file. use this command:

sudo gedit /etc/gdm/gdm.conf

look for these lines:


0=Standard
#1=Standard

and change them to


#0=Standard
1=Standard

save and close that file. now, we just have one more file to edit and we’re ready to go. open it with this command

sudo gedit /usr/bin/thefuture

now paste this into the file:

#!/bin/bash
LIBMESA=/usr/lib

LD_LIBRARY_PATH=$LIBMESA /usr/bin/gnome-window-decorator &
LD_LIBRARY_PATH=$LIBMESA /usr/bin/compiz --replace gconf decoration wobbly fade minimize cube rotate zoom scale move resize place menu switcher trailfocus &

save and close the file and then execute this command:

sudo chmod 755 /usr/bin/thefuture

now, drop to a console by pressing ctrl+alt+f1 and log in and enter this command:

sudo /etc/init.d/gdm restart

when you get logged back in, open a terminal and execute this command:

thefuture

with any luck, you’ll be basking in xgl goodness. i told you this was just a crash course. you’re probably going to need some more in depth information at some point, which you can find in this thread over at ubuntu forums and also at the new compiz forums. happy hacking!

One Response to “howto: ubuntu dapper with xgl/compiz”

  1. kelsey Says:

    wow.

Leave a Reply