How To: Compiz/XGL On Kubuntu Dapper / NVidia

There are a million other howtos, but maybe this will help somebody with the same setup as I have (Kubuntu Dapper / NVidia graphics card.)

Before you start, if you are going to do this, realize that you’ll have to live with the gnome window decorations; also, it seems to work better if you use gdm rather than kdm (UPDATE – you will need to select the “default” session in kdm to make it obey your .Xsession). This is a worthwhile compromise. There are exactly three steps here:

  1. Add the following line to your /etc/apt/sources.list: deb http://xgl.compiz.info/ dapper main
  2. [it's true that compiz is present in the ubuntu universe repositories, but this repository is more up to date]

  3. Using synaptic or apt, install:
    • compiz-vanilla
    • compiz-vanilla-gnome
    • gset-compiz
    • xserver-xgl
  4. Finally, add or edit ~/.Xsession as follows (if it contains stuff already, make a backup in case you need to roll back):

    # Run Xgl server on :1, on top of normal X
    Xgl :1 -fullscreen -ac -accel xv -accel glx:pbuffer &
    # Tell subsequent X programs to access the Xgl server at :1
    DISPLAY=:1
    # Start Compiz window manager
    gnome-window-decorator &
    compiz gconf decoration fade dock widget miniwin minimize cube rotate zoom scale move resize place menu switcher &
    # Start KDE
    exec startkde

    Make sure that it’s executable (do chmod +x ~/.Xsession).

And…that’s it. Restart X. You’re good to go (hopefully). If X does not start, you will find yourself in text mode, from which you can edit or delete .Xsession to recover.

TIPS:

  • gset-compiz should have been added to the utilities menu. Run it to change the settings.
  • To change the gnome window decorations, run gnome-theme-manager
  • Ctrl-left/ctrl-right/ctrl-down controls the desktop switcher.
  • Pause gives you expose’.
  • Alt-tab is enhanced.
  • compiz.net will keep you up to date
  • There’s plenty more to discover :)

Comments (16)

  1. Tim wrote::

    I’ll try this tonight, I’ve tried lots of guides and none of them have worked. What card are you using?

    Wednesday, June 7, 2006 at 1:21 am #
  2. Naosv wrote::

    Awesome! Worked a treat!
    Much thanks.

    Wednesday, June 7, 2006 at 3:47 pm #
  3. adam wrote::

    While this worked and Xgl ran, it crashed my linux box (hard) when I went to rotate the cube (ctrl shift LEFT | RIGHT, I think). I couldn’t find anything in the logs to indicate what might have happened.

    KDE starts up by default on my box and I tried configuring kdmrc to start Xgl, but I get the following message in my syslog:

    “X server ‘Xgl’ cannot be executed”
    “X server for display :0 cannot be started”

    I’ve tried changing the StaticServers to :1 and :0 and played with removing the :1 -fullscreen from the startup command but no dice.

    I also tried playing w/ the .Xsession file to only start certain things but also no dice.

    Any thoughts?

    Wednesday, June 7, 2006 at 8:10 pm #
  4. adam wrote::

    I tried again last night, with all the normal parameters as suggested and as usual, X locked up, but I was able to ssh in to my box and so I checked the log files – there was nothing out of order so on a whim I ran “top” and lo, Xgl was using 100% of the CPU. I tried killing it with 15, 2, and 6 but nothing. I assume 9 would have worked but I switched back to the linux box (I have a KVM switch) and that must have done something because my ssh session locked up and I couldn’t establish another one after that so I had to reboot.

    Methinks it’s just too unstable at this point to be viable and is really just a cool toy to play with…

    Friday, June 9, 2006 at 9:30 am #
  5. Reuben wrote::

    Yeah, it’s definitely hit or miss. I use it pretty much full time, but there are a couple of quirks (ctrl alt + sends me to a fuzzy screen, e.g.) I think it really depends on your graphics card, drivers, etc.

    Friday, June 9, 2006 at 9:38 am #
  6. Rob wrote::

    Tried a number of howto’s, but this was the only one which worked, and yet is bar far the easiest to follow. Thanks very much, worked a treat!

    Sunday, June 11, 2006 at 3:39 am #
  7. Tim wrote::

    Worked a treat. Thanks!

    How exactly to you access the gnome-theme-manager?

    Monday, June 12, 2006 at 8:32 am #
  8. Reuben wrote::

    Hello. Initially, from the command line only, but you could always add it as a menu item. If you type gnome- and then tab, you’ll see all of the gnome settings modules tha you can use (tho, of course, not all will apply.)

    Monday, June 12, 2006 at 8:54 am #
  9. Tim wrote::

    Hi again – whenever I try to change a theme in the gnome-theme-manager nothing happens – any ideas?

    Thanks.

    Wednesday, June 21, 2006 at 1:53 am #
  10. Reuben wrote::

    Hm, I’m not sure.

    I actually stopped using XGL/Compiz for the time being because of two annoying issues w/ video playing that I couldn’t get around (a: it would blank frequently; b: it sometimes rendered artifacts at the top or the bottom of the video image).

    Wednesday, June 21, 2006 at 7:44 am #
  11. Dave wrote::

    THANKS!!! I tried a few other howto’s before this one and got into a mess. This one worked first time, good work fella!

    Monday, June 26, 2006 at 1:42 pm #
  12. nedsferatu wrote::

    worked great, thanks for the howto! 2 things:

    Don’t forget to run an update && upgrade after adding the new repository, otherwise you won’t bring down all the needed libraries

    I got xgl/compiz to work with the KDE window decorations by ending the x session then running startx from a text terminal (ctrl-alt-F1 for instance). the wm came right back up and when i logged in the KDE window decorations were working fine. any ideas why this would work?

    Thanks again.

    Monday, July 3, 2006 at 4:43 pm #
  13. Alex wrote::

    Thanx for the Howto!
    I followed it (almost). I couldn’t install the vanilla packages so I installed compiz and compiz-gnome instead.
    The problem is that compiz wont start. If I type
    “compiz –replace”
    in the console I get an error saying
    “No GLXBConfig for default depth”

    Any ideas what that means? I googled for GLXBConfig and found ONE page… in Greek or whatever.

    Wednesday, August 2, 2006 at 3:41 pm #
  14. samu wrote::

    I have a problem running the script .Xsession as normal user.
    when, in kdm, i login as root everything is ok, but when i login as simple user nothing happens. i see for a while the background image of kdm and then it return to the login mask.
    any ideas?

    Sunday, August 13, 2006 at 9:28 am #
  15. Reuben wrote::

    Hm. It is possible that your .Xsession is owned by root for some reason. Type ls -al .Xsession on the CLI, and post the results here.

    Sunday, August 13, 2006 at 9:57 am #
  16. samu wrote::

    excuse me if i reply now.

    maybe there was some problem with permissions, i don’t know. at last, after a reboot, everything worked fine! thanks!

    now i can start the normal xorg or the xgl in kdm.

    Thursday, August 24, 2006 at 10:59 am #