Restoring your previous xorg.conf file

September 15, 2006

Resurrecting your xserver by restoring your previous xorg.confA few days ago I installed Cedega on my portable with Ubuntu Linux installed on it. After installation I customized the application options / preferences and ran the test utility. The test revealed that my 3D Acceleration wasn’t working. I found that a crucial part to have working so I started fixing it.After a while I made a mistake and my (already highly customized) xorg.conf got re-written by all kinds of default settings. Since the xserver uses the file in order to start-up correctly you can imagine that my xserver crashed.In Ubuntu Linux the xorg.conf file makes a backup of it’s current state before it accepts getting edited or rewritten. This does not apply when you edit xorg.conf yourself though (editing with Vi or Gedit). So I got an backup waiting to be restored, with all my setting related to resolution, drivers, AIXGL/Compiz and so on. I’ll use my own example in order to explain how you can restore the previous xorg.conf file.After I rebooted Ubuntu Linux started up correctly until it came across xserver section. There the xserver crashed and I was presented with a terminal screen which kindly asked for my username.I logged in with my normal account and entered:

djons@tosh-empire:/$ cd /

This command brings you to the root of your system. If you enter:

djons@tosh-empire:/$ dir

You will see you are at the beginning point of the system.We need to proceed towards the xorg.conf location. Hit the following path in order to get there:

djons@tosh-empire:/$ cd /etc/X11

Note that X11 is with a capital X. All Linux distributions, UNIX variations and thus also Mac OS X feature this.When you are in the X11 directory you will see a file structure similar to this:

djons@tosh-empire:/etc/X11$ dirapp-defaults gdm xorg.conf Xsession.dapplnk rgb.txt xorg.conf~ Xsession.optionsconfig susewm xorg.conf.20060807011320 Xwrapper.configcursors X Xresourcesdefault-display-manager xinit xserverfonts xkb Xsession

You should pinpoint two files, they are the files with which we are going work:


The question marks represents year, month, day and some more info. But the date is the most important since you can easily pick the most current back-upped version of xorg.conf before things went sour. So now it’s time to replace our corrupt xorg.conf with a previous working version.First of all we have to delete the current corrupted xorg file. To make this happen do the following terminal work:

djons@tosh-empire:/etc/X11$ sudo rm xorg.conf

Now we have to rename the back-upped version in order to get our installation working with icons and mouse. Do the following terminal work:

djons@tosh-empire:/etc/X11$ sudo mv xorg.conf.????????????? xorg.conf

We’re done. The only thing you have to do is restart your machine and wait till it’s done booting up the installation. In order to get your machine rebooting hit the on/off switch once or use the following command:

djons@tosh-empire:/etc/X11$ sudo shutdown -r now