Display Configuration
Usually, Ubuntu is pretty good at detecting and setting up the display.
If you need to change the configuration in some way - adding a second/external monitor or whatever - these are the tools you might need.
Before changing anything, you should determine exactly what your system is made of, hardware and software.
X configuration
The X server configuration file is in /etc/X11/xorg.conf. This file is shared among all users of the system, and is the one to modify if you want to manually configure X. Personally, I try not to mess with system files directly - once in a while, system updates will need to touch it as well, and automated system administration/updates is hard enough to get right without end users making life difficult.
The log-file of the current session is in /var/log/Xorg.0.log. Some messages go to $HOME/.xsession-errors, although this file does not seem to be mentioned in the docs anywhere. If your system display is not working the way you think it should, these, along with /var/syslog, are good places to look for error messages.
Resetting the X configuration
To reset the X configuration, simply delete /etc/X11/xorg.conf (keeping a backup somewhere...) and reboot - it will be regenerated with autodetected/default values. Of course, you are messing with basic configuration of your system, and should proceed with caution.
Links
Gnome Display Manager Controls
Fixing the display settings is likely to involve repeatedly changing the configuration, restarting the Gnome Display Manager (from here onwards, the gdm), deciding whether the change made things better or worse, and repeating until satisified (or bored).
The gdm is controlled as follows:
- Starting the gdm
-
From a console, as root:
service gdm start
This will only work if gdm is not already running.
- Stopping the gdm
-
From within an active session, as root:
service gdm stop
Make double sure to not have any unsaved changes anywhere, as this will brutally murder all GUI applications.
- Restarting the gdm
-
From a console, as root:
/etc/init.d/gdm restart
This kills your current gdm session and launches a new one - which will take you to the login screen.
Links
Nvidia Binary Driver Configuration
After resetting the X configuration, you might want to give nvidia a shot at generating a configuration file:
[sudo] nvidia-xconfig
To set up the display, use:
[gksudo] nvidia-settings
You only need to run this program with root privileges if you want to modify the settings. For read-only access, it works just fine without.
Here's how to determine the version of the nvidia binary driver, and how to check your OpenGL / GLX configuration.
Links
- The Nvidia Binary Driver Manual.
- Setting up the Nvidia Binary Driver.
- Setting up External / Multiple Monitors with the Nvidia Binary Driver.
- Wikipedia on OpenGL.
- Wikipedia on GLX.
Recovering from a broken display configuration
This assumes you had your system in working condition, and something broke. If you just installed (or did a major update), you probably want to look in the release notes and any migration documentation - if you had problems, they are almost certainly related to the new configuration.
The first thing to do, if at all possible, is to backup any data you do not want to lose. If you do not have a standard procedure in place which can be executed from the console, then putting one into place is the first thing to do. I suggest keeping your backup procedure ridiculously simple.
When you have nothing left to lose, the following, in no particular order, might be helpful while restoring a useable configuration:
- Reset your X configuration.
- Stopping and starting the Gnome Display Manager.
- Dropping to a console.
- Reboot from the commandline.
- Booting into Gnome Failsafe mode, or if things go really wrong, into GRUB recovery mode.
- Requesting a system reboot, fairly politely.