Tuesday, January 18, 2011

When you don't manage to start X

Or your screen resolution won't get right.

Many questions on the Archbang forum are related to issues with video drivers and failing screen resolution. People get stuck at a terminal or have a crappy screen display. This post is related to Arch using Openbox window manager.

Don't despair. If you managed to get a good screen resolution when testing with the live CD, then it also must be possible to achieve this after install. To put it in another way: always test with a live CD if this configuration on this live CD is working for your hardware.

Important is to see that the problems most of the time have a few different sources.

Editing grub

To begin with the beginning: sometimes grub is set to vesa to make login possible.
Don't expect the system to use the best driver for you videocard in that case.

To edit the grub boot menu you can press the e key and edit the line that has vesa in it and comment that out or with the terminal #nano /boot/grub/grub.cfg and delete XORG-VESA & NOMODESET.

This is for grub2; in grub legacy, 0.97, you can edit the /boot/grub/menu.lst

Also delete here the vesa and nomodeset options.

In Nano you use Ctrl+ o to write something, then enter and ctrl+x to close nano.

Installing the necessary video driver

If you don't know what hardware video device you have:
lspci -vnn gives a list of your hardware devices, which gives valuable info on which what hardware we are dealing with.
lspci -k gives info on how the kernel drivers handle your hardware at the moment; this is of course very important info too.

Another important source of info is:
On issues with xorg the log file /var/log/Xorg.0.log is often given to help others give support. This gives valuable feedback.
If you can't get into a terminal, use a live CD.
If you want to install a new driver you have to work from your installation on your hard drive.
Most of the time Alt+Ctrl+F2 will give you another working terminal, if you didn't managed to start X and got stuck.

How to install a new videodriver

with a Nvidia video card: sudo pacman -S nvidia nvidia-utils
with the ATi card : sudo pacman -S xf86-video-ati
Intel: sudo pacman -S xf86-video-intel

See also https://wiki.archlinux.org/index.php/Beginners%27_Guide#Install_video_driver

Now the third source of the problem or third kind of problem has to be checked or solved: your xorg.conf in /ect/X11/
With a normal effective install this won't be necessary, but accidents can happen
So nano /etc/X11/xorg.conf ; notice X11 is written with a capital X.

Before editing a xorg file always back it up!! Save it as xorg_old or xorg_default for instance.

Two kinds of problems are possible
1, the wrong driver is mentioned
2. the desired screen resolution(s) is (are) not given in xorg.conf

At problem 1: find vesa in the device section and replace it with nvidia or what your your videocard is called. Specify if possible the card type you are using.
My device section looks like this:

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GT 330"

Edit: due to conflicts between xorg-server 1.11 and nvidia driver it may be necessary or more useful to install the nouveau driver:
So nvidia card using open source driver:
#pacman -S xf86-video-nouveau
and in in /etc/X11/xorg.conf.d/20-gpudriver.conf
instead of nvidia: nouveau

Problem 2: Screen resolution
Normally a screen resolution has not to be identified in the screen section of the xorg file
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "0"
Option "metamodes" "nvidia-auto-select +0+0"
SubSection "Display"
Depth 24

when the correct driver is working,

but sometimes it has to.

It could look like something like this:

Section "Monitor"
DisplaySize 344 193
HorizSync 30-40
Identifier "Monitor[0]"
ModelName "Unknown"
Option "DPMS"
Option "PreferredMode" "1366x768"
VendorName "Unknown"
VertRefresh 50-75
UseModes "Modes[0]"

BTW also font configuration issues can have a devastating effect on xorg and make X not working, crashing. See this post.

If you have finished working on your configuration you can reboot or do startx to start X.

No comments:

Blog Archive

About Me

Exclusion of liability Regarding StillStupid: The use you make of the guides, tips and downloads that you listed on this web site or on another website to which I refer is entirely at your own risk. In no way can I be held liable for damage or consequential damages of any kind, which occurs as a result of that use.