Install/Ubuntu/Edgy/XGL
From Beryl Wiki
Contents[hide]
|
Introduction
Installing Xgl and Beryl in (K)ubuntu Edgy Eft is simple. Getting it working is slightly more complex, but this how-to should make it easy. If you have used compiz previously, it will be very familiar ground indeed. And yes, if you think you can update / clarify / improve the instructions on this page, please register, log in and go ahead and add your suggestions. Have fun!
Note: Lennart Hansen has written an all-graphical guide, Beryl and Xgl on Ubuntu Edgy Eft with ATI card. Lots of screenshots and handy for those who prefer not to use the terminal.
Suggestions: Maybe a section on migrating from the previous Compiz setup, including what packages need to be removed first, such as Compiz, to avoid conflict. (Update: pilfered from dapper guide, see below)
Graphic Card Drivers and 3D Video Acceleration
Note: If you have previously used Xgl with compiz, you should be good to go and you can skip this step.
The Xgl X server requires 3D video acceleration. Most graphics cards should automatically support 3D acceleration in Edgy Eft; some graphics cards might need some tweaking though.
You can check whether direct rendering is enabled by invoking
$ glxinfo | grep direct
in a terminal. If it returns
direct rendering: Yes
For ATI Graphics-Card you can check with
"fglrxinfo"
then you’re ready to install Xgl and Beryl. If it doesn’t, you might need to install the appropriate driver for your graphics card. Follow the official Ubuntu Desktop Guide’s instructions for Nvidia or ATI graphics card drivers, or check the ATI Linux Drivers Wiki for ATI fglrx drivers.
Migrating from Compiz-QuinnStorm
If you have the QuinnStorm version of Compiz installed on your system and want to migrate to Beryl, it’s best to uninstall Compiz first and then install Beryl from scratch. Simply use Synaptic (GNOME) or Adept (KDE) to remove the compiz, compiz-gnome and gset-compiz meta-packages or use the command line:
$ sudo apt-get remove compiz compiz-gnome gset-compiz
and continue on with the rest of the tutorial.
Adding the Beryl Project repositories
Now add the Beryl Project’s repository to /etc/apt/sources.list
. This can be done using the Synaptic or Adept graphical interfaces, or from the command line. The line to be added is
deb http://ubuntu.beryl-project.org/ edgy main-edgy
For amd64 architectures, append ‘main-edgy-amd64’ like so:
deb http://ubuntu.beryl-project.org/ edgy main-edgy main-edgy-amd64
Note: A number of mirrors are available if you find yourself getting slow speeds from the primary host. The current list of mirrors includes
deb http://www.beerorkid.com/compiz edgy main-edgy deb http://media.blutkind.org/xgl/ edgy main-edgy deb http://compiz-mirror.lupine.me.uk/ edgy main-edgy deb http://ubuntu.compiz.net/ edgy main-edgy deb http://beryl.xglusers.de/ edgy main-edgy (main-edgy-amd64)
The packages in the repository are signed with a gpg signature so you can verify that they are valid. To add the gpg key to your keychain, use Synaptic / Adept or invoke the following command:
$ wget http://ubuntu.beryl-project.org/quinn.key.asc --quiet -O - | sudo apt-key add -
Next, make apt aware of the new software repositories by issuing the following command
$ sudo apt-get update
Done ! The new software repositories should now be available for use.
Installing Xgl and Beryl
Use Synaptic or Adept to install the xserver-xgl package, or use the command line
$ sudo apt-get install xserver-xgl
Next, install the beryl and emerald-themes packages
$ sudo apt-get install beryl emerald-themes
Note: beryl is a metapackage that will install the dependencies (beryl-core, beryl-plugins, beryl-manager, beryl-settings) as well as the emerald decorator but not emerald-themes.
Configuration
There are a number of ways to log into an Xgl Session and start the Beryl composite manager. Check and see which one suits you best.
Adding an Xgl login session
Adding a separate Xgl session to your (gdm or kdm) login screen is recommended for most situations because it allows you to switch easily between Xgl and standard Xorg sessions. After all, Xgl is not meant to be a full-fledged replacement for the standard Xorg server. Some applications (such as OpenGL games) might not run properly in an Xgl session; and keep in mind that the Beryl composite manager is still very much a work in progress. If you run into bugs or problems, you’ll have your standard X session at your fingertips.
Adding an X session to your login screen is a two-step process: first we’ll create a startup script that invokes the Xgl session and our desktop environment. Then we’ll create the login screen entry that uses our script.
The startup script: Use your favourite text editor to create a script startxgl.sh in your path, like so:
$ sudo gedit /usr/local/bin/startxgl.sh
Note: The contents of the script varies depending on your desktop environment and the graphics card you use. And yes, users of other window managers, please help out and add your own startup scripts here.
GNOME & Nvidia graphics card
#!/bin/sh /usr/bin/Xgl :1 -fullscreen -ac -br -accel xv:fbo -accel glx:pbuffer & sleep 4 export DISPLAY=:1 exec gnome-session
For KDE, change the last line to
exec startkde
GNOME & ATI graphics card
#!/bin/sh Xgl -fullscreen :1 -ac -br -accel glx:pbuffer -accel xv:pbuffer & sleep 4 export DISPLAY=:1 exec gnome-session
Note: If you have Problems with the original script take this one:
#!/bin/sh Xgl :1 -fullscreen -ac -br -accel glx:pbuffer -accel xv:pbuffer & sleep 4 export DISPLAY=:1 exec gnome-session
For KDE, change the last line to
exec startkde
User Note: Not happy with Xgl? Want to try AIGLX?
For me, on Ubuntu Edgy, XGL didn’t work right after upgrading, but with the Beta nVidia driver installed, I use the built-in AIGLX support in xorg 7.1.1 by changing the startup script to read:
GNOME
#!/bin/sh beryl-manager sleep 4 exec gnome-session
For KDE, change the last line to
exec startkde
Making the script executable: Now make sure the script has the right permissions settings set so that it can be invoked by session login entry – this can be done in Nautilus or Konqueror or simply by typing the following into a terminal:
$ sudo chmod a+x /usr/local/bin/startxgl.sh
IMPORTANT NOTE I recently found that if we start Gnome/KDE this way, we may lose font or mouse pointer configuration, since they don’t get loaded with Xgl. The correct way that I found was to use “exec /etc/X11/Xsession” instead of gnome-session or startkde. – Lesterchakyn
Creating the login session entry: To create the login entry, create a new file /usr/share/xsessions/xgl.desktop and make it look like this:
[Desktop Entry] Encoding=UTF-8 Name=Xgl Exec=/usr/local/bin/startxgl.sh Icon= Type=Application
Note: The Name=Xgl entry is the description of the session that you’ll see in your login menu, so you could change it to ‘Xgl-Gnome’ or ‘Xgl-Beryl’ if it suits you better.
Done!
When you get to the GDM or KDM login screen, you should now have a session called ‘Xgl’ available; if you log into this session, Xgl will run as an overlay to the standard Xorg X session (that is, on DISPLAY: 1) and load your desktop environment. Logging into your normal session will give you the standard, un-accelerated desktop for trouble-shooting or running programs which don’t play nicely with Xgl.
Changing your standard login
For GNOME: Instead of adding a separate desktop session, you could alter your standard X session. This is not recommended for most users (see above). It might be useful however if you do not want to set up a separate X session for Beryl for some reason.
First change gdm.conf-custom:
$ sudo nano /etc/gdm/gdm.conf-custom
Go to the very bottom of the file and add:
0=Xgl [server-Xgl] name=Xgl server command=/usr/bin/Xgl :0 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo flexible=true
When you reboot or restart the graphical session, the Xgl server should be running.
Running Beryl
Now it’s time to test your Beryl installation. Open a terminal and type
$ beryl-manager
If all goes well, you should see the Beryl splash screen and your windows will become wobbly! Your system tray should show the Beryl icon – a red gem – that you can use to adjust beryl’s and emerald’s settings. Click on ‘Beryl settings manager’ or Emerald, the theme manager. It also provides fallback to another window manager (metacity for example), in case Beryl crashes.
If you don’t see the beryl splash screen immediately, you may need to tell the manager to load Beryl – right-click on the red gem, go to “Select Window Manager” and choose “Beryl”. If that doesn’t work, there’s a problem somewhere! Often, useful debugging output will show in the terminal window you used to start beryl with.
IRC channels
Ubuntu users can ask for help on the #ubuntu-xgl or #xgl channels on irc://irc.freenode.net/
Adding Beryl to Session Startup
Assuming all goes well, you can set up Beryl Manager to start up every time you load into your Xgl session.
GNOME
Note: This method will add beryl-manager to every gnome session, not just the Xgl session. Not very useful for those who wish to keep their Xorg and Xgl sessions separate. See below.
- Go to System → Preferences → Sessions
- Go to the ‘Startup Programs’ tab
- Click the ‘Add’ button and type beryl-manager into the dialog box
- Click ‘Close’
Addenda:
1) If the window decorations do not show up when starting beryl this way, try adding beryl-xgl to the startup programs as well. See the Tourbleshooting section below.
2) A command line version of this tip can be seen here.
KDE
Add beryl-manager to KDE’s autostart. Open a terminal and create the following symlink:
$ ln -s /usr/bin/beryl-manager ~/.kde/Autostart/beryl-manager
Adding Beryl to an Existing Session
GNOME
To start beryl-manager only when the session “xgl” is started, I modified a script from Gentoo Wiki scripts. so:
Create the script: Use your favourite text editor to create a script start_beryl.sh. I placed and created it in /usr/local/bin/ so:
$ sudo gedit /usr/local/bin/start_beryl.sh
In the file paste this:
#!/bin/bash # # Start beryl-manager within gnome-session # if [ `ps -A -o comm | grep -c '^Xgl$'` == "1" ]; then DISPLAY=:1 beryl-manager DISPLAY=:1 beryl-xgl else echo "${0}: Error: beryl-manager not launched. Xgl not running?" fi
and save the file.
Making the script executable: Now make sure the script has the right permissions settings set so that it can be invoked by session login entry – this can be done in Nautilus or Konqueror or simply by typing the following into a terminal:
$ sudo chmod a+x /usr/local/bin/start_beryl.sh
Add the script to gnome session startup:
* Go to System → Preferences → Sessions * Go to the 'Startup Programs' tab * Click the 'Add' button and type /usr/local/bin/start_beryl.sh into the dialog box * Click 'Close'
Now, you can logout and start a session. When you start a gnome session, the script looks if XGL is started, and so, if you are in a xgl-session, it launches beryl-manager.
KDE
The Gentoo Wiki offers several startup scripts that allow you to start beryl or compiz only when the Xgl server is running. If this script is added to GNOME’s session startup programs or KDE’s autostart, beryl won’t start unless we have entered the Xgl session – a more elegant solution to beryl startup automation. However, these scripts were written for compiz and also include various workarounds for font and keyboard-related issues that might not be needed for most situations. So please, everyone
test these scripts and take the time to write up what works and what doesn’t, either here or in the Troubleshooting section below. Thanks on behalf of the community!
Also, the script mentioned above for starting beryl in gnome also works if added to KDE’s autostart.
Troubleshooting
Here are some tips and tricks that have been harvested from the beryl forums. Please add your own, and link back to the thread / post whenever possible.
The window decorations do not show up. What’s wrong?
Try running beryl-xgl. Open a terminal and type:
$ beryl-xgl
If this solves the problem, add beryl-xgl to Gnome’s session startup programs or KDE’s Autostart using the methods mentioned above.
Help, the window borders are fine, but my window widgets, dialog boxes, icons etc. look funny / not so funny / really grey / very 1990’s / like gtk-1 fallbacks. What’s up with that?
According to forum posters, there are several ways to solve this issue:
1) Try running gnome-settings-daemon from a terminal:
$ gnome-settings-daemon &
You should now see the widgets and icons you selected. To run this command at session login, go to System → Preferences → Sessions, go to the “Startup Programs” tab, click the “Add” button and type gnome-settings-daemon into the dialog box.
2) If you are using the startxgl.sh script described above and if you are using GNOME, try replacing the final command exec gnome-session with exec dbus-launch –exit-with-session gnome-session
#!/bin/sh Xgl -fullscreen :1 -ac -accel glx:pbuffer -accel xv:pbuffer & sleep 2 && DISPLAY=:1 exec dbus-launch --exit-with-session gnome-session
3) Disable Beryl’s splash screen in Beryl Settings Manager.
I’ve added beryl-manager and beryl-xgl to my session startup programs, and now I can’t log into my X session any more. How do I remove them again?
In case you have trouble starting up after adding beryl-manager and beryl-xgl to the GNOME session startup programs (such as getting the White Cube/blank screen after the Beryl logo) and hence can’t get to the GUI to remove them, try removing the autostart entries manually:
Press Ctrl-Alt-F2 to get to a console. Log in as usual and type:
cd ~/.config/autostart rm beryl-manager.desktop beryl-xgl.desktop
Now you should be able to log back into your X session by pressing Ctrl-Alt-F7 (to get back to the stalled display) followed by Ctrl-Alt-Backspace (to restart the X server). If your X session isn’t running at all, type
$ sudo /etc/init.d/gdm start
in the terminal.
(source:link)
I noticed that emerald starts twice at login, and there are two instances of emerald running, which is causing some problems. How can I get around this?
Create a new startup script containing the following commands
beryl-manager & killall emerald emerald &
Make it executable and add it to GNOME’s Session Startup or KDE’s Autostart.
My favourite hardware-accelerated application (google earth for example) doesn’t play well with Beryl. What can I do?
Try adding DISPLAY=:0 in front of the command:
$ DISPLAY=:0 googleearth
(sources: link, link, link)
XGL starts ok, but the window manager (gnome or kde) stops responding at startup
Does this apply to one user but not others? If so, try removing .beryl-managerrc
$ rm ~/.beryl-managerrc
See also
Introduction to 3D Video Acceleration (Ubuntu Desktop Guide)
Installing Beryl (Ubuntu Community Documentation)
Composite Manager page (Ubuntu Community Documentation)
Installing Xgl (Gentoo Wiki)
Installing Beryl (Gentoo Wiki)
Troubleshooting Xgl (Gentoo Wiki)