Gentoo Wiki






Video Cards

OpenGL Compositing



Merge-arrows.gifIt has been suggested that this article be Merged into one article with Xorg/Install.    (Discuss)



This is a guide to Modular Xorg, mainly dealing with special circumstances and troubleshooting.

This article is currently being maintained by AllenJB. If you have suggestions for additions or fixes, please post them to the discussion and bugs page.

Please see also the official Modular Xorg Upgrade Guide.


Firstly it'll be useful to know what version of Xorg you're going to be emerging. If you don't know, run emerge -p xorg-x11 to find out.


Because is such a key part of a desktop system, you'll want to backup your current install before continuing. To do this we're going to use the quickpkg command from the gentoolkit package: emerge -a gentoolkit; quickpkg xorg-x11

If you want to find out more about the quickpkg tool, run: man quickpkg

Restoring the backup

To restore your backed-up package run: emerge --usepkgonly -a =xorg-x11-6.8.2-r8

If you can't remember the exact version you can find it out by running: ls /usr/portage/packages/All/xorg-x11*

You then want to re-emerge all the packages listed in ~/usr-x11r6-packages.

Uninstall old

Warning: If you are reading this from the same machine you will be upgrading X on, keep in mind two things:
  1. Once you clean out the current (old) X, until the new X is installed, you will not be able to start any X applications. The applications depending on X currently running are just running off the memory of X. Once closed, they cannot be re-opened until the new X is installed.
  2. Programs currently running in X may become unstable during the install. For example, Firefox may unexpectedly crash due to not being able to find fonts which are no longer there, or other similar reasons.
It is hence highly recommended that you print out a copy of this guide (or save a tree and open this guide on a console (not in X)) before you begin. Your programs should go back to behaving normally once the install is complete, however you may want to restart X as soon as possible afterwards.

Uninstall your current xorg install by running: emerge -Ca xorg-x11 virtual/x11

/usr/X11R6 symlink

The /usr/X11R6 directory is now a symlink to /usr. Run ls -l /usr/X11* and check that it should looks like this:

lrwxrwxrwx 1 root root 6 Mar 27  2005 /usr/X11R6 -> ../usr

If it doesn't, create a list of packages that have files in the /usr/X11R6 directory and then remove the existing directory by running:

  if  [[ ! -L /usr/X11R6]] ; \
  then equery belongs /usr/X11R6 > ~/usr-x11r6-packages \
  && rm -rf /usr/X11R6; fi

Remove /usr/lib/X11/xkb

The following is a requirement of the xkeyboard-config package.

32-bit Users: Run ls -l /usr/lib/X11/xkb and if it exists, delete it with rm -r /usr/lib/X11/xkb

Emerge Modular

Device Drivers

Modular Xorg introduces a new system for managing the driver packages for your devices. You need to set the appropriate VIDEO_CARDS and INPUT_DEVICES flags in /etc/make.conf. To see what flags are available, run emerge -upv xorg-x11. On a typical machine with an Nvidia video card, it might look like this:

File: /etc/make.conf
INPUT_DEVICES="keyboard mouse"
VIDEO_CARDS="nv nvidia vesa"

The nv driver is the open source unofficial driver that lacks 3D acceleration. The nvidia driver is the official nvidia-drivers package.

On an ATI System, the VIDEO_CARDS line should be like this (unless you don't wish to use proprietary drivers fglrx):

File: /etc/make.conf
VIDEO_CARDS="radeon fglrx vesa"

Add the dri USE flag to /etc/make.conf to enable Direct Rendering support, which most graphics drivers use.


Now run emerge -Dvat xorg-x11 to install modular Xorg.

A few useful X11 tools that used to be included in the 6.8 build are now their own packages, you can emerge all of them now by running: emerge -DuNav xev xdpyinfo xvinfo xset xdriinfo xprop

If you would like some extra fonts, you can emerge them now also:

emerge -DuNav font-adobe-100dpi font-adobe-75dpi \
font-bh-lucidatypewriter-100dpi font-bh-lucidatypewriter-75dpi \
font-bitstream-100dpi font-bitstream-75dpi ttf-bitstream-vera \
corefonts sharefonts freefonts

Features Apparently Missing

Keyboard Mappings

There may be people who will search for the ca_enhanced keyboard mapping in Xorg 7.0. It has not disappeared, it just changed names to ca(fr), as with this keyboard configuration:

File: /etc/X11/xorg.conf
Section "InputDevice"
    Identifier  "Keyboard1"
    Driver      "kbd"
    Option "AutoRepeat" "500 30"
    Option "XkbRules"   "xorg"
    Option "XkbModel"   "pc105"
    Option "XkbLayout"  "ca(fr)"

Notice that Option "XkbRules" "xfree86" won't work for modular xorg-x11. You have to change it to "xorg", or many keys will not produce the desired effect.

In case you defined a custom xkb model (e.g. if you added a diNovo keyboard), check if you modified /usr/share/X11/xkb and not /usr/lib/X11/xkb.

If your X server is restarting each time you pressed a non dead key, add the following link:

# ln -s /usr/share/X11/XKeysymDB /usr/lib/X11/XKeysymDB

Problems and Solutions

OpenMotif fails to emerge

If building of openmotif fails run: emerge -DuNav --oneshot printproto xbitmaps libXp

Then restart the emerge using: emerge --resume

GL Issues

Problems building xorg-server, glx, and other GL-related packages in modular X may be due to a multilib issue.

The first thing to try is to update eselect-opengl to at least 1.0.3.

Next check your opengl implementation with eselect opengl list. If xorg-x11 isn't the only option, you probably want the alternate option, so change it with: eselect opengl set <implementation>

xorg-server tries to build every single input driver

Solution: You need to specify which drivers you want by modifying /etc/make.conf to reflect your hardware. If nothing is specified, it will build them all!


File: /etc/make.conf
INPUT_DEVICES="keyboard mouse synaptics evdev"

Mouse Acceleration Uncontrollable with evdev Driver

It is currently not possible to set speed with xorg without a patch which is in the xorg bugtracker, but you can set acceleration.

Please see X11 Mouse/Mouse Speed for more information.

Mouse Wheel No Longer Works

Please see the Modular XOrg section of X11 Mouse for more extensive information.

Xorg won't start due to fglrx or nvidia module missing

Re-emerge the appropriate drivers (ati-drivers or nvidia-drivers) to get X running again after the install. Make sure you recompile the the drivers with same compiler you used for the kernel, otherwise you'll get message about the module format being incompatible when you try to load the fglrx kernel module.

Matrox G550, Xinerama and mga driver

The install script of the binary drivers available from Matrox (v4.4 at the time of writing) copies the driver files to


instead of


Copy the correct files ( manually to get Xinerama working again.

Or use this script:

p.s. The script will complain that it's outdated, but it still works with the latest xorg-x11 7.1.1

If you get this:

(EE) module ABI major version (0) doesn't match the server's version (1)
(EE) MGA: Failed to load module "mga_hal" (module requirement mismatch, 0)
(EE) MGA(0): HALLib not loaded! NOT using "Merged Framebuffer" mode.

A "-ignoreABI" parameter to X is needed so the HALlib would work, follow the link to insert it properly: TIP XOrg 7.1 With Older NVidia Drivers#Running X

Problems with the keyboard

The AltGr key and/or other national special keys may stop working after an update to modular X. To fix this, unmerge the new xkeyboard-config and re-emerge the xkbdata package which contains correct translations for that key.

If the above fix doesn't work, you can also try running: xmodmap -e "keycode 113 = Mode_switch"

Sometimes it can happen that GNOME / KDE keyboard layout switching doesn't work. To correct this, create xkb as a symbolic link in the /usr/lib64/X11 lib directory with:

 cd /usr/lib64/X11
 ln -s /usr/share/X11/xkb/ xkb

Missing fonts

There are X11 fonts that may be in use but not available. See the Xorg and fonts HOWTO and install the listed fonts.

Configuration file locations have changed

All of the configuration files and scripts in Xorg-6.8 were stored in /etc/X11, which was not standard. In modular Xorg, all of the configuration files are in the same place but configuration scripts and default files have moved to /usr/lib/X11/ and /usr/share/X11.

When upgrading, since /etc is config-protected, your old configuration files would not have been removed -- this means you'll have some extra files in there that look right but don't do anything.

Also, these new locations are NOT config-protected, so when making changes to say, app-defaults/XTerm-color, be sure to add CONFIG_PROTECT="/usr/share/X11/app-defaults" to /etc/make.conf. Or when updating the init for xdm, it would be a good idea to copy that file from /usr/lib/X11/xdm/Xsetup_0 to /etc/X11/xdm/ and update /etc/X11/xdm/xdm-config accordingly.

Other problems and solutions

Please see Gentoo's bug tracker and the official modular X howto.

If none of the above helps generating a new xorg.conf may solve your problems.

X -configure

See also

Retrieved from ""

Last modified: Mon, 15 Sep 2008 03:55:00 +0000 Hits: 160,831