Graphics, keyboard and mouse troubles. Edit your xorg.conf Very often you will install linux to end up staring at a black screen, or your keyboard map will be wrong.. Or the uncommon but very annoying no mouse detected. Here is how to edit your xorg.conf file (/X11/xorg.conf)
The first thing to do is either log in as root, getting to a login can be difficult if your monitor settings are messed up. There will be various boot options depending on distro, if installed with lilo or grub at the blue boot screen the best bet is to boot to a console (prompt only) and try linux 2. This will boot to a prompt something like user@somewhere$
Login as root with / (or root)
password: whatever_your_root_password_is
Then you have a choice, some distros come with a nice wizard..Enter the command
$: xorgwizard
and follow it through, changing whatever is wrong.. A good bet is the monitor vertical is wrong, I try 60 Hz which usually does the trick.
Save the settings and exit.
Or you can get brave and edit your xorg.conf file directly. It's usually to be found at /etc/X11/xorg.conf , but not always.
Here is a list of examples for editing the various sections. As it's a sample file, and you should have some idea how your editor of choice works, and what hardware you have I won't elaborate on specifics.
contents xorg.conf follows.
Section "ServerLayout"
Identifier "XFree86 Configured"
Screen 0 "Screen0" 0 0
#Screen 0 "ATIScreen" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "PS/2 Mouse" "CorePointer"
#InputDevice "USB Mouse" "CorePointer"
#InputDevice "Touchpad" "CorePointer"
#InputDevice "Stylus" "CorePointer"
#InputDevice "Eraser" "CorePointer"
#InputDevice "Cursor" "CorePointer"
#InputDevice "Serial Mouse" "CorePointer"
EndSection
Section "ServerFlags"
Option "AllowMouseOpenFail" "true"
EndSection
Section "Files"
# Xorg 7.0 font paths
FontPath "/usr/share/X11/fonts/misc:unscaled"
FontPath "/usr/share/X11/fonts/cyrillic"
FontPath "/usr/share/X11/fonts/Type1"
FontPath "/usr/share/X11/fonts/util"
# Legacy font paths
FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/util"
# Other font paths
FontPath "/usr/share/fonts/truetype/ttf-lucida"
FontPath "/usr/share/fonts/truetype/arphic"
FontPath "/usr/share/fonts/truetype/freefont"
FontPath "/usr/share/fonts/truetype/kochi"
FontPath "/usr/share/fonts/truetype/latex-xft-fonts"
FontPath "/usr/share/fonts/truetype/openoffice"
FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
FontPath "/usr/share/fonts/type1/gsfonts"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection
Section "Module"
Load "GLcore"
Load "bitmap"
Load "dbe"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "record"
Load "type1"
Load "v4l"
Load "vbe"
Load "synaptics"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XKbOptions" ""
EndSection
Section "InputDevice"
Identifier "Serial Mouse"
Driver "mouse"
Option "Protocol" "Microsoft"
Option "Device" "/dev/ttyS0"
Option "Emulate3Buttons" "false"
Option "Emulate3Timeout" "70"
EndSection
Section "InputDevice"
Identifier "Touchpad"
Driver "synaptics"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "LeftEdge" "1700"
Option "RightEdge" "5300"
Option "TopEdge" "1700"
Option "BottomEdge" "4200"
Option "FingerLow" "25"
Option "FingerHigh" "30"
Option "MaxTapTime" "180"
Option "MaxTapMove" "220"
Option "VertScrollDelta" "100"
Option "MinSpeed" "0.06"
Option "MaxSpeed" "0.12"
Option "AccelFactor" "0.0010"
Option "SHMConfig" "on"
Option "Repeater" "/dev/input/mice"
EndSection
Section "InputDevice"
Identifier "PS/2 Mouse"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "false"
Option "Emulate3Timeout" "70"
Option "ZAxisMapping" "4 5"
Option "Buttons" "5"
EndSection
Section "InputDevice"
Identifier "USB Mouse"
Driver "mouse"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Buttons" "5"
EndSection
Section "InputDevice"
Identifier "Stylus"
Driver "wacom"
Option "Mode" "Absolute"
Option "Type" "stylus"
Option "Device" "/dev/input/wacom"
Endsection
# Settings for wacom eraser
Section "InputDevice"
Identifier "Eraser"
Driver "wacom"
Option "Mode" "Absolute"
Option "Type" "eraser"
Option "Device" "/dev/input/wacom"
Endsection
# Settings for wacom cursor (mouse)
Section "InputDevice"
Identifier "Cursor"
Driver "wacom"
Option "Mode" "Absolute"
Option "Type" "cursor"
Option "Device" "/dev/input/wacom"
Endsection
Section "Monitor"
Identifier "Monitor0"
VendorName "unknown"
ModelName "unknown"
#Option "DPMS" "true"
HorizSync 30.0 - 82.0 # Warning: This may fry old Monitors
VertRefresh 50.0 - 70.0 # Very conservative. May flicker.
Modeline "640x480" 25.175 640 664 760 800 480 491 493 525 #60Hz
Modeline "800x600" 40.12 800 848 968 1056 600 601 605 628 #60Hz
Modeline "1024x768" 75 1024 1048 1184 1328 768 771 777 806 -hsync -vsync
Modeline "1024x768" 85 1024 1056 1152 1360 768 784 787 823
ModeLine "1152x864" 65 1152 1168 1384 1480 864 865 875 985 Interlace
Modeline "1152x864" 92 1152 1208 1368 1474 864 865 875 895
Modeline "1152x864" 110 1152 1240 1324 1552 864 864 876 908
Modeline "1152x864" 135 1152 1464 1592 1776 864 864 876 908
Modeline "1152x864" 137.65 1152 1184 1312 1536 864 866 885 902 -HSync -VSync
Modeline "1280x768" 80.14 1280 1344 1480 1680 768 769 772 795
ModeLine "1280x800" 80.58 1280 1344 1480 1680 800 801 804 827 -HSync -VSync
Modeline "1280x1024" 80 1280 1296 1512 1568 1024 1025 1037 1165 Interlace
Modeline "1280x1024" 110 1280 1328 1512 1712 1024 1025 1028 1054
Modeline "1280x1024" 126.5 1280 1312 1472 1696 1024 1032 1040 1068 -HSync -VSync
Modeline "1280x1024" 135 1280 1312 1456 1712 1024 1027 1030 1064
Modeline "1280x1024" 135 1280 1312 1416 1664 1024 1027 1030 1064
Modeline "1280x1024" 157.5 1280 1344 1504 1728 1024 1025 1028 1072 +HSync +VSync
Modeline "1280x1024" 181.75 1280 1312 1440 1696 1024 1031 1046 1072 -HSync -VSync
Modeline "1440x900" 106.47 1440 1520 1672 1904 900 901 904 932 +HSync +VSync
Modeline "1400x1050" 129 1400 1464 1656 1960 1050 1051 1054 1100 +HSync +VSync
Modeline "1600x1200" 162 1600 1664 1856 2160 1200 1201 1204 1250 +HSync +VSync
Modeline "1600x1200" 189 1600 1664 1856 2160 1200 1201 1204 1250 -HSync -VSync
Modeline "1600x1200" 202.5 1600 1664 1856 2160 1200 1201 1204 1250 +HSync +VSync
Modeline "1600x1200" 220 1600 1616 1808 2080 1200 1204 1207 1244 +HSync +VSync
Modeline "1680x1050" 147.14 1680 1784 1968 2256 1050 1051 1054 1087
ModeLine "1800x1440" 230 1800 1896 2088 2392 1440 1441 1444 1490 +HSync +VSync
ModeLine "1800x1440" 250 1800 1896 2088 2392 1440 1441 1444 1490 +HSync +VSync
Modeline "1920x1200" 230 1920 1936 2096 2528 1200 1201 1204 1250 +HSync +VSync
EndSection
Section "Monitor"
Identifier "ATIMonitor"
VendorName "unknown"
ModelName "unknown"
#Option "DPMS" "true"
HorizSync 30.0 - 82.0 # Warning: This may fry old Monitors
VertRefresh 50.0 - 70.0 # Very conservative. May flicker.
EndSection
Section "Device"
Identifier "Card0"
Driver "vesa"
BoardName "unknown"
#BusID "PCI:1:0:0"
#Option "sw_cursor" # needed for some ati cards
#Option "hw_cursor"
#Option "NoAccel"
#Option "ShowCache"
#Option "ShadowFB"
#Option "UseFBDev"
#Option "Rotate"
Option "UseInternalAGPGART" "no"
# savage special options, use with care
#Option "NoUseBios"
#Option "BusType" "PCI"
Option "DmaMode" "None"
# nvidia special options, use with care
Option "CursorShadow" "1"
Option "CursorShadowAlpha" "63"
Option "CursorShadowYOffset" "2"
Option "CursorShadowXOffset" "4"
Option "FlatPanelProperties" "Scaling = native"
Option "NoLogo" "false"
Option "IgnoreEdid" "true" # needs to be true for some nvidia cards
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultColorDepth 16
SubSection "Display"
Depth 8
Modes "1280x800"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x800"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x800"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x800"
EndSubSection
SubSection "Display"
Depth 32
Modes "1280x800"
EndSubSection
# Only the official NVIDIA driver supports twinview
# these setting are an example
Option "TwinView" "false"
Option "SecondMonitorVendorName" "unknown"
Option "SecondMonitorModelName" "unknown"
Option "SecondMonitorHorizSync" "30-82"
Option "SecondMonitorVertRefresh" "50-70"
Option "MetaModes" "1024x768, 1024x768"
Option "TwinViewOrientation" "RightOf"
Option "ConnectedMonitor" "dfp,dfp"
EndSection
Section "Screen"
Identifier "ATIScreen"
Device "Card0"
Monitor "ATIMonitor"
DefaultColorDepth 24
SubSection "Display"
Depth 24
Modes "1280x800"
EndSubSection
EndSection
Section "DRI"
Mode 0666
EndSection
Mine being debian is XF86Config-4 but the idea is the same.. here it is cut straight from my machine.
# XF86Config-4 (XFree86 X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the XF86Config-4 manual page.
# (Type "man XF86Config-4" at the shell prompt.)
#
# This file is automatically updated on xserver-xfree86 package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xfree86
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following commands as root:
#
# cp /etc/X11/XF86Config-4 /etc/X11/XF86Config-4.custom
# md5sum /etc/X11/XF86Config-4 >/var/lib/xfree86/XF86Config-4.md5sum
# dpkg-reconfigure xserver-xfree86
Section "Files"
FontPath "unix/:7100" # local font server
# if the local font server has problems, we can fall back on these
FontPath "/usr/lib/X11/fonts/misc"
FontPath "/usr/lib/X11/fonts/cyrillic"
FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/Type1"
FontPath "/usr/lib/X11/fonts/CID"
FontPath "/usr/lib/X11/fonts/Speedo"
FontPath "/usr/lib/X11/fonts/100dpi"
FontPath "/usr/lib/X11/fonts/75dpi"
EndSection
Section "Module"
Load "GLcore"
Load "bitmap"
Load "dbe"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "record"
Load "speedo"
Load "type1"
Load "vbe"
EndSection
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc104"
Option "XkbLayout" "uk"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/psaux"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
Identifier "Generic Mouse"
Driver "mouse"
Option "SendCoreEvents" "true"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection
Section "Device"
Identifier "Generic Video Card"
Driver "i810"
EndSection
Section "Monitor"
Identifier "SAM:5710"
HorizSync 30-70
VertRefresh 50-160
Option "DPMS"
EndSection
Section "Screen"
Identifier "Default Screen"
Device "Generic Video Card"
Monitor "SAM:5710"
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"
InputDevice "Generic Mouse"
EndSection
Section "DRI"
Mode 0666
EndSection
And there we have it. Remember that for -*test*-('")ing a # comments out a line (or a whole section) but always make a backup first. Mistakes in this file can be hard to rectify otherwise.
When you have finished editing exit the editor and try <startx>or <xwin> depending on distro.. or reboot to a graphic desktop with <linux 5>
ktulu14- 02-11-2007
nice tut jan. the la-*test*-('") Debian (Etch) i think now uses the xorg rather than the xfree86 for settings of the keyboard and mouse etc. I will check and let you know for sure.
one thing people should remember is that when setting up a Linux distro, WATCH what happens on the screen through the setup. with some distros on the selection screen you have use the SPACEBAR to select what you want it to install, or you end up with now xwindow display. This has happened to me before and can be a bit annoying when you expect a colourful screen in front of you and you end up with a black one.
Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.