Purpose: In this blog post we will see how to resolve common X server issues like X server not starting, high resolution modes like 1024×768 are not supported, X server crashes, etc. in Debian Linux. Also we will see if you are not able use your native graphics driver in X, then how to use the generic “vesa” driver.

Background: Sometime since Xorg 7.2 version, X server does not rely on xorg.conf – X server configuration file – any more. Instead it automatically detects your video card, loads appropriate driver and sets resolution modes. You can still override the automatic settings by explicitly specifying configuration parameters in xorg.conf file just like the old way. If you put parameters in xorg.conf file then X server will honor those first instead of using it’s own parameters.

Before you begin to read further it is a good idea to know how to check which video driver is your X server using on your Linux system.

Problem 1: Let’s say your X server suddenly stops working and even after three times of starting (which it does automatically) it does not start and you end up with a login console.

Solution 1(a): From the login console give the following command:

# X -configure

and you will see a message like:

Your xorg.conf file is /root/xorg.conf.new

Now test the new configuration file by giving following command:

# X -config /root/xorg.conf.new

If you see your X server starting successfully, then hit Ctrl-Alt-Backspace and give the following command:
# mv /root/xorg.conf.new /etc/X11/xorg.conf
and then start your login manager:
# /etc/init.d/gdm restart

Solution 1(b): If the above solution did not work then try reconfiguring your xserver-xorg package like this:
# dpkg-reconfigure -phigh xserver-xorg

and go through the prompts. In most of the cases the default values should be fine. After that check your X server by giving following command:
# X
If you see your X server starting successfully, then hit Ctrl-Alt-Backspace and start your login manager:
# /etc/init.d/gdm restart
Note: Once you verify your X server is working by giving the ‘X’ command above, you can start your Graphical environment by giving the above command.

Problem 2: Now let’s say your X server starts properly but it does not support resolution above 800×600 i.e. you don’t see the resolution 1024×768 or higher in the “System->Preferences->Screen Resolution

Solution 2: One solution to this problem is to explicitly specify parameters in your /etc/X11/xorg.conf file. Suppose your default minimal xorg.conf file looks something like this:

Section "InputDevice
Identifier      "Generic Keyboard"
Driver          "kbd"
Option          "XkbRules"      "xorg"
Option          "XkbModel"      "pc104"
Option          "XkbLayout"     "us"
EndSection

Section "Device"
Identifier      "Configured Video Device"
EndSection

You can add the following sections to your xorg.conf file so that it finally looks like this:
Section "InputDevice"
Identifier      "Generic Keyboard"
Driver          "kbd"
Option          "XkbRules"      "xorg"
Option          "XkbModel"      "pc104"
Option          "XkbLayout"     "us"
EndSection

Section "InputDevice"
Identifier      "Configured Mouse"
Driver          "mouse"
EndSection

Section "Device"
Identifier      "Configured Video Device"
EndSection

Section "Monitor"
Identifier      "Generic Monitor"
Option          "DPMS"
HorizSync       28-50
VertRefresh     43-75
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Generic Video Card"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 1
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Now as usual check your X server:
# X

Problem 3: Suppose even after following the above solutions you are still having trouble starting your X server. In that case we will force your X server to use the generic “vesa” driver.

Solution 3: Just edit your default minimal xorg.conf file and add the following line (in green):

Section "InputDevice"
Identifier      "Generic Keyboard"
Driver          "kbd"
Option          "XkbRules"      "xorg"
Option          "XkbModel"      "pc104"
Option          "XkbLayout"     "us"
EndSection

Section "Device"
Identifier      "Configured Video Device"
Driver             "vesa"
EndSection

Now again check your X server:

# X

If you see that your X server starts fine but does your mouse is not functioning then see this link. In short the solution is to load the PS/2 mouse kernel module:

# modprobe psmouse

Problem 4: Lastly, if none of the above solution works for you then you need to specify all the parameters in the xorg.conf file as shown below:

Solution 4:

Section "Files"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi"
# path to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
EndSection

Section "Device"
Identifier "Generic Video Card"
Driver "amd"
BusID "PCI:0:1:1"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 28-50
VertRefresh 43-75
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Generic Video Card"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 1
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

Section "DRI"
Mode 0666
EndSection

Just substitute your respective driver name (in red) in the “Device” Section above and start your X server. The whole idea is that by using a single or a combination of the above methods shown, you should be able to get your X server working again.

That’s it for now. Happy Xorg’ing!

Be Sociable, Share!