howto: xgl and compiz on ubuntu dapper (new and improved)

WARNING: due to some sweeping changes to compiz, this howto is now badly out of date. i’m going to be working on a new (much better) version targeted for edgy eft. until then, please head on over to compiz.net for help.

this howto assumes that you already have 3d acceleration working properly on an up-to-date i386 ubuntu dapper system. this howto only covers the steps necessary to install and configure xgl and compiz. if you need help with anything else, please visit ubuntu forums.

if you’re having trouble viewing the video, you can download the xvid version.

the video above is what we’re trying to accomplish with this howto. this amazing desktop interface is accomplished with xgl and compiz. please take a moment to read the wikipedia articles on xgl and compiz before getting started.

the first thing we need to do is add the quinnstorm and reggaemanu repositories which hold up to date xgl and compiz packages (among other things). we can do this by opening our sources.list in gedit using the following command:

sudo gedit /etc/apt/sources.list

once we have the file open, we need to add the following lines at the bottom of the file:

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

after you have done that, save the file and close gedit. the next thing we need to do is use apt to download the new package information and upgrade any of our existing packages that need it. we can do that using these commands:

sudo apt-get update
sudo apt-get dist-upgrade

when you do this, you will probably receive this message, which you can safely ignore:

W: GPG error: http://www.beerorkid.com dapper Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 31A5F97FED8A569E
W: GPG error: http://xgl.compiz.info dapper Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 31A5F97FED8A569E
W: You may want to run apt-get update to correct these problems

now we need to install xgl and compiz along with the supporting packages with this command:

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

now we need to make a way to start xgl instead of xorg. we’ll start by making a startup script with this command:

sudo gedit /usr/bin/startxgl

and then paste the following into the file:

Xgl -fullscreen :1 -ac -accel glx:pbuffer -accel xv:pbuffer & sleep 2 && DISPLAY=:1
# Start GNOME
exec gnome-session

save and close the file and then make the script executable with this command:

sudo chmod 755 /usr/bin/startxgl

now we need to make a startup script for compiz, starting with this command:

sudo gedit /usr/bin/startcompiz

paste the following into the file:

#!/bin/sh
killall gnome-window-decorator
wait

gnome-window-decorator &
compiz --replace gconf &

note that there should be two dashes before the word ‘replace’ on the last line of the script. for some reason, wordpress is replacing the two dashes with one so be sure and change that. then save and close the file and then make it executable:

sudo chmod 755 /usr/bin/startcompiz

now we going to make a gdm session for xgl so we can choose it at login. this is done by issuing the following command:

sudo gedit /usr/share/xsessions/xgl.desktop

and then pasting this into the file:

[Desktop Entry]
Encoding=UTF-8
Name=XGL
Exec=/usr/bin/startxgl
Icon=
Type=Application

after you save and close the file, you can either restart your computer entirely or just restart gdm. once you have done that, change your session to XGL at the gdm log in screen before entering your user name and password. after you have logged in, open a terminal and enter this command:

startcompiz

with any luck, you’ll be greeted with some opengl accelerated desktop goodness at which point you’ll want to add startcompiz to your startup items via the sessions dialog so it’s started automatically whenever you log in to the XGL session. you’ll also find a program called gset-compiz in your accessories menu that gives you easy access to all of the compiz settings.

if you should run into any problems, you can get help or more information in this thread over at ubuntu forums and also at the compiz forums.

51 Responses to “howto: xgl and compiz on ubuntu dapper (new and improved)”

  1. Jonathan Buys Says:

    How did you make that video? I’ve been up all night trying to make on just like that!

  2. dave Says:

    How did you make that video? I’ve been up all night trying to make on just like that!

    i connected the s-video output of my video card (nvidia) to the s-video input of my tuner card (hauppauge), and the terminal window that’s open during the video is running cat /dev/video0 > ~/xgl.mpg.

  3. psaur Says:

    Thanks for a very easy set of instructions.

    i followed them but got the following error:

    i915 DRI driver expected DDX version 1-1.5.x but got version 1.4.1

    it seems homehow the latest graphics card driver has not been installed. I have all the repositiories uncommented in my sources.list

    Thanks,

  4. dave Says:

    i915 DRI driver expected DDX version 1-1.5.x but got version 1.4.1

    it seems homehow the latest graphics card driver has not been installed. I have all the repositiories uncommented in my sources.list

    it sounds like something is wrong with your xorg driver. the newest intel drivers are available on reggauemanu’s repositories, which should be added if you followed this howto. otherwise, the only thing i can suggest is that you check the ubuntu and compiz forums to see if there’s anyone having a similar problem.

  5. nievo Says:

    Hi Dave,
    great tutorial!

    I noticed a typo in the section where you create the start up script for compiz

    #!/bin/sh
    killall gnome-window-decorator
    wait

    gnome-window-decorator &
    compiz –replace gconf &

    Using the code above copied from the tutorial gave me this error:

    nievo@XPC:~$ startcompiz
    gnome-window-decorator: no process killed
    nievo@XPC:~$ compiz.real: Screen 0 on display “:1.0″ already has a window manager; try using the –replace option to replace the current window manager.
    compiz.real: No managable screens found on display :1.0

    Changing “–” in the last line “compiz –replace gconf &” to “–” fixed this problem e.g. “compiz –replace gconf &”.

    Keep up the gd wrk!

  6. nievo Says:

    Ok, maybe it wasn’t a typo!
    When you submit a post with 2 hyphens next to each other, for some reason they get joined together into one big hyphen. Kinda makes my last post look a bit stupid!

  7. dave Says:

    Ok, maybe it wasn’t a typo! When you submit a post with 2 hyphens next to each other, for some reason they get joined together into one big hyphen. Kinda makes my last post look a bit stupid!

    right, it’s some “feature” of wordpress to do that. i’ll make a note in the article about it.

  8. psaur Says:

    With the latest updates on Ubuntu, this worked for my Intel i915 card. Great!! I just need to fiddle around a little more to set it to my liking. Thanks!!

  9. Daniel Says:

    hi to all!

    this is a fantastic tutorial, really :-)

    just one question, why do I haven’t any more the options to restart/shutdown the pc in the logout dialog? it seems that they are missing only in the default XGL session.

    Thanks,
    Daniel

  10. dave Says:

    why do I haven’t any more the options to restart/shutdown the pc in the logout dialog?

    good question. the reason is, because of the way this howto is set up, gdm is actually started with a normal xorg session. when you log in with xgl this creates a totally new session on a different display instead of just reusing gdm’s session like a normal login would do.

    there are 2 reasons i used this method. first of all, if an update should ever break xgl, gdm will still start up ok and any inexperienced users won’t be staring at a terminal login screen when they turn their computers on. secondly, if you should need to boot into a regular xorg session (like i have to do to run mythtv) all you have to do is log out, change your session and log back in rather that manually changing the gdm configuration files. this also reduces the inconvenience of a botched xgl or compiz upgrade.

  11. Daniel Says:

    I totally understand your reasons and I agree with you, because, in the worst case, we have a still running system. But is there no way to enable such options in the dialog? i’ve googled a bit, but without success.

  12. dave Says:

    But is there no way to enable such options in the dialog?

    i don’t know of a way.

  13. Ryan Says:

    Thank you for the tutorial - been tryign to get this setup w/o success forever. Works like a charm!

  14. munkay Says:

    Thanks for the quick tutorial. I initially had a problem with the drivers as mentioned before, but I ended up fixing it by performing a “apt-get dist-upgrade” after the “apt-get update” to update my drivers to 1.5.x. After that, a bit of tweaking and viola, a functional (okay fine, mayyyyybe a bit slow) desktop on my i810 chipset laptop.

  15. dave Says:

    I initially had a problem with the drivers as mentioned before, but I ended up fixing it by performing a “apt-get dist-upgrade” after the “apt-get update” to update my drivers to 1.5.x.

    thanks for reporting back. i made a small change to the howto so that a dist-upgrade is performed before the installation of the xgl and compiz packages, which should prevent most users from running into this problem.

  16. mannyrami Says:

    Without a doubt, this was by far the easiest forum to follow. With this forum it took me about an hour to get up an runing. Good work. :-) Thank you for posting

  17. Chris Says:

    I had the same problem as psaur. dist-upgrade made no improvements. I simply can’t get it to upgrad to the 1.5 driver. :( But seeing as how it worked for other people, it’s probably some stupid little quirk with my hardware. Very nice tutorial, though. It was very clear and easy to follow.

  18. Martin Says:

    Hello,

    When I start my Computer I can choose between Gnome and foo. If I select foo, a message window says me that my XGL script does not include an exec command. Then it starts Gnome in failsafe mode.

    What can I do?

    Thank you,

    Martin

  19. dave Says:

    When I start my Computer I can choose between Gnome and foo. If I select foo, a message window says me that my XGL script does not include an exec command. Then it starts Gnome in failsafe mode.

    it sounds like your startxgl script is not right. open /usr/bin/startxgl with a text editor and check to see that it contains exactly this:

    Xgl -fullscreen :1 -ac -accel glx:pbuffer -accel xv:pbuffer & sleep 2 && DISPLAY=:1
    # Start GNOME
    exec gnome-session

    notice that the last line contains the exec command that it’s complaining about.

  20. Martin Says:

    Thank you for your answer.

    It says (I translated it) that in the session-basic-script is no Exec-command. This is about the /usr/share/xsessions/xgl.desktop.

    But there is all right but there is one Space (Or is it Blank?) at the [_Desktop Entry] where I made a bottom dash. I deleted it an I got in. Then I saw this horrible Black/White X-Screen with the X-Mouse-Coursor. But I am in gnome and the rest ist okay.

    I typed “startcompiz” into the Terminal but there was a error message: “g-w-d: No Prozess killed”, “g-w-d, failed to loasd shadow images”, “compiz.real” No composite extension”.

    How can I fix that?

    Martin

  21. dave Says:

    I typed “startcompiz” into the Terminal but there was a error message: “g-w-d: No Prozess killed”, “g-w-d, failed to loasd shadow images”, “compiz.real” No composite extension”.

    How can I fix that?

    the message “No Prozess killed” can safely be ignored. the other two messages generally pop up when you’re running the standard Xorg instead of Xgl. you can check by opening a terminal and running the top command and moving some windows around. that will make the X server jump to the top. if you are running Xgl then something else is wrong… maybe you don’t have your graphics driver set up properly?

  22. Martin Says:

    Hi,

    I looked into Top an I saw that I am running Xorg. I installed the ATI Drivers for my card an I played Trackballs well, so the driver is working.

    I edited the startcompiz by reading http://wiki.ubuntuusers.de/Baustelle/Xgl into:

    #!/bin/sh
    killall gnome-window-decorator
    wait
    DISPLAY=:1 LD_PRELOAD=/usr/share/fglrx/diversions/libGL.so.1.2
    compiz –replace decoration wobbly fade minimize cube rotate zoom scale move resize place menu switcher transset trailfocus water &
    gnome-window-decorator &

    there are diffrent errors now:
    compiz.real: Couln’t load pligin ‘libmenu.so’
    compiz.real: Couln’t load pligin ‘libtrailfocus.so’
    compiz.real: Couln’t load pligin ‘libtransset.so’
    compiz.real: Couln’t load pligin ‘libwater.so’

    I have a window with something like an empty X-Server or X-Session in it, it is grey with the X-Coursor.

    But the Cube and the other Effects aren’t there.

    What can I do?

    Martin

  23. dave Says:

    What can I do?

    i know some of the ATI drivers can be a little flaky… at this point, your best bet is to ask your questions over at the compiz forums.

  24. Tadge Says:

    Dave,

    Wow, thanks for sharing this. I managed to get it right after a few days of trying. I like it so far. Hope fully I will get work done instead of playing:)

    Thanks,
    Tadge

  25. Matt Says:

    I managed to get it working, and it is awesome, but it’s very slow. I don’t know how much more cpu this is supposed to use, but it slows my box down too much. It’s an Athlon 3200 with a Nvidia 440mx. I have the Nvidia 3d driver installed from EasyUbuntu. Are there some video settings I need to tweak?

  26. dave Says:

    Are there some video settings I need to tweak?

    take a look at this thread, and try the “Minimizing windows shows an ugly black border around them or is choppy” and “Animations like wobbly windows or the cube are choppy” parts.

  27. Tom Says:

    I tried it on my work machine and it’s all good. Tried it on my home machine which was using XGL fine but just not the most up to date, I guess, and I got this from apt:

    The following packages have unmet dependencies:
    compiz-gnome: Depends: libpango1.0-0 (>= 1.12.3) but 1.12.2-0ubuntu3 is to be installed
    E: Broken packages

    Any ideas?

    Thanks, Tom

  28. Michal Says:

    Hi, i have the following problem:
    i tried to run the line sudo apt-get install compiz xserver-xgl libgl1-mesa xserver-xorg libglitz-glx1 compiz-gnome gset-compiz and got this error:

    The following packages have unmet dependencies:
    compiz-gnome: Depends: libpango1.0-0 (>= 1.12.3) but 1.12.2-0ubuntu3 is to be installed
    E: Broken packages
    What should i do?

  29. Tom Says:

    Apparently all it needed was adding dapper-updates into my repositories.

    Thanks, Tom

  30. phil Says:

    after everything i do
    startcompiz

    and it only says->

    compiz.real: No composite extension

    what can i do ??

  31. phil Says:

    finaly it work , a good question would be :
    how can i run root-tail over this , i just extract the root-tail…. .deb and it seems to be good but it dosnt start over compiz :)

    thanks

  32. pete Says:

    wow great!!!! but i never managed to make my 3d accelaration work on linux…

  33. Ian Says:

    Brilliant tutorial everything went smothly except on the sudo apt get install lib-mesa couldnt be foun, os i left it and once id finished everything i restarted and changed session started to log on got to a brown screen with a mouse then it went back to loggin?

  34. Jacob Says:

    I have a twin head setup… When I run startcompiz I get…

    compiz.real: GLX_EXT_texture_from_pixmap is missing
    compiz.real: Failed to manage screen: 0
    compiz.real: No managable screens found on display :1.0

    and none of the windows can be moved or resized. Any ideas?

    Thanks,

    ~c

  35. Metroid48 Says:

    Hi, I just tried this. The install went without a hitch, so I used Ctr-Alt-Backspace to restart GDM. Then, when I logged into the new session, it was extremely laggy. When I typed startcompiz into the terminal, instantly all windows stopped having the bar at the top (one with name, minimize, quit, etc.) and the computer became MORE laggy. I’m have an Intel G915 Mobile graphic card.

    BTW, how do I make Linux update my graphic card drivers?

    -Metroid48

    PS-I tried a Live Konoraa (or something like that) distro disk that came with XGL, and it worked and wasn’t really laggy so I’m sure my graphic chipset can handle it.

  36. Metroid48 Says:

    Hey, just found out the problem. The settings for the startxgl script are for ATI cards only. xv should equal fbo for Nvidia and other graphic cards:

    xv:fbo

    NOT this:

    xv:pbuffer

    which is ATI only.

    Anyway, only two real concerns about it. It looks great, but when it tries to start the screensaver it doesn’t work, and when I type in my password thereafter it freezes after clicking Unlock. Also, the cube rotation gets a slight sorta skip every 2 seconds or so.

    -Metroid48

  37. Barongas Says:

    I have the same problem phil has with the
    compiz.real: No composite extension
    he got it working but didn’t post how :(
    I also did the top thing and it seems xorg is still the man-thing of my computer… I dont know what to do.

  38. Barongas Says:

    I got it working too, I think due to updating the kernel… Well it works! Thanks alot for this guide!

  39. Barongas Says:

    Gah! It crashed when I was toying around with cube and when I rebooted I can’t get it going again!
    Xorg is back :(

  40. exgsr Says:

    IT WORKED!!

    well not first time try though… due to the hypen error in “compiz –replace gconf &”.. should have type it rather than paste it ;)

    god.. never though my amd duron 1gh, 640MB and Nvidia GTS2 32MB display card can look this gud.
    albeit a bit slow.

    i’m using K7 kernel, and Nvidia Glx Legacy driver.
    so far so gud. if not for the hiss, quirks and pops on my soundblaster live! value i would have deleted my XP! (still need it to hear proper sound mp3 and video)

    Thanxxx for the great posting!!

  41. Ross Says:

    Hey, I’m getting this when I run startcompiz, any ideas anyone?

    great post, by the way

    admin@Cow:~$ compiz.real: No GLXFBConfig for default depth, this isn’t going to work.
    compiz.real: Failed to manage screen: 0
    compiz.real: No managable screens found on display :1.0

  42. Crowley Says:

    Hi….i’ve done everything exactly the same as you said most of you guys thanks…..
    but am faceing this….
    SmcOpenConnection failed: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
    compiz: No composite extension
    any ideas?

  43. Panos Says:

    Hi, I am trying over 3 hours to setup XGL on my Dapper Drake.
    I got this error when I type startcompiz

    panos@panos-linuxmachine:~$ compiz.real: GLX_SGIX_fbconfig is missing
    compiz.real: Failed to manage screen: 0
    compiz.real: No managable screens found on display :1.0
    Xlib: extension “XInputExtension” missing on display “:1.0″.
    Failed to get list of devices

    and also all bars suddelny dissappear…. HELP ?

  44. dave Says:

    you guys that are still having trouble need to head over to compiz.net and ask your questions there.

  45. Panos Says:

    Ok dave! Thank very much for your tutorial!!!

    I should ask there so.

    Thaanks again!

  46. Patrick Says:

    I get this error message after i try to login saying that the session only lasted 10 seconds, and i have to change to gnome again to login. any ideas?

  47. dave Says:

    I get this error message after i try to login saying that the session only lasted 10 seconds, and i have to change to gnome again to login. any ideas?

    i think this behavior is typical of ati video cards. i remember there was a way to set the session timeout to be longer to accomodate those drivers, but i can’t recall what it was. look around over at compiz.net for more information.

  48. James Says:

    Thanks for this great tutorial. I followed the process above and then attempted to log, but received an error message. I then logged back in normally and added my nvidia-glx drivers and then was able to log into foo. This was very exciting, but then I rebooted the computer and I am now unable to log into foo. It just returns to the Ubuntu log on screen. I have increased the timeout seconds but that did not work either. Any help would be greatly appreciated. Thanks

  49. Leo Germani Says:

    Hi,

    After some struggle I managed to get it (almost) working.

    Even before I run starcompiz, the screen is laggy. Simply drawing a selection box on the desktop will cause some strange color effects. The windows wont refresh on the screen properly, and if I click on a icon on the launch bar the Session crashes.

    I start compiz and it works just fine. But with all the problems I metioned above… It seems that its a problem of refreshing the screen/ rendering … as if I havent got enough memmory for that…

    but Im running an AMD64 (running a 32bit system though), 1Gb Ram, nvidia vide card with 64M…

    any clues?

    Leo,,

  50. dave Says:

    Even before I run starcompiz, the screen is laggy. Simply drawing a selection box on the desktop will cause some strange color effects. The windows wont refresh on the screen properly, and if I click on a icon on the launch bar the Session crashes.

    did you install the proprietary nvidia drivers? that should vastly improve your performance if you haven’t. it’s easy to do, just open a terminal and

    sudo apt-get install nvidia-glx

    and then edit your xorg.conf

    sudo gedit /etc/X11/xorg.conf

    and find the line

    Driver "nv"

    and change it to

    Driver "nvidia"

    then save the file, close it and restart X with ctrl+alt+backspace.

    if that isn’t the problem or doesn’t seem to fix it, head over to compiz.net and ask around there.

  51. Leo Germani Says:

    Hi,

    I solved the problem

    I had the nvidia driver installed, but I had to adjust couple of thing on xorg.conf

    1. Comment the line wich loads the Dri module on Section “Module”
    2. Add Option “RenderAccel” “true on the Device Section
    3. set to “24″ the default depth on the Section Screen

    This last one was decisive. I didnt test it without the modifications 1 and 2. But its necessary to have the default depth set to 24 in order work! And now its just fine!! beautiful!

    till now I had only one crash, an one window that became incative (B&W) and never woke up again. but Im using just fine

    thanks for the help

    cheers

    Leo,,

Leave a Reply