Restoring your previous xorg.conf file

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:

xorg.confxorg.conf.?????????????

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

Advertisements

36 Responses to Restoring your previous xorg.conf file

  1. Jacques says:

    I just effed up my xorg.conf a few days ago. The fact that you posted this not too long ago, and the chance I stumbled across your site is incredible. Thanks so much!!

    🙂

  2. serkan yavas says:

    I effed up my xorg several times in an attempt to correct an error and then again and again i effed it up, with the help of friends and family we all had a go at effing it up, but this little solution resolved it and now I have become the guru of linux in my family!
    I had just reached the stage where I lost hope and was contaplating returning to MS but this solution restored my love and pasion for linux.
    Long live opensource!

  3. KingBeef says:

    This was the best resolution ever posted – thanks for saving a noob reinstall

  4. Puck says:

    Not sure if there’s a reason not to use it, but sudo cp /etc/X11/xorg.conf.?????.. /etc/X11/xorg.conf works as well.

  5. Yann Studer says:

    Thanks a lot !
    you just saved my system.
    regards
    Yann Studer

  6. Scott says:

    Thanks for saving my cheese!!! (I had been typing x11 instead of X11…)

  7. TheWizard says:

    djons Man you are a real life saver. You are a very kind and good person. Your advice and easy to follow instructions have just saved and restored my beloved ubuntu (in just 1 minute) after I totally messed trying to install the latest ATI driver using envy (beware everyone if it tells you that your card is not supported).

    I can’t possibly thank you enough.

    Thanks a million man 🙂

  8. saethone says:

    so simple yet so helpful, thanks very much!

  9. Jastonite says:

    Great fix! Kubuntu would work great for a few days and then for no reason boot into a command line mode. I searched the internet for a while, but I couldn’t find anything that restored my GUI, until now. Thanks.

  10. Dan says:

    You just saved my butt. Like everybody else, I screwed up my xorg.conf and was left with just a terminal window. Luckily the most recent backup I had was just a week ago, so I swapped it out and everything is working again. Thanks!

  11. klandestino says:

    Thank a lot! A real life Savior !!!

    I am a newb to linux, been using it for a week, and i’ve been trying to make my dual monitor display to work with the second monitor as an extension of the first one, by default it is working but as a mirror of the first screen…. so i messed up with my xorg.conf file and it wouldn’t boot anymore until i got your precious help!

    Thanks again,
    A Humble Nux Newbie

  12. ryan r says:

    saved my butt too, thanks!!!!!

  13. lars says:

    Have you been able to fix the cedega – intel 855GM issue. I have a system that is comparable to yours and I can’t seem to get the 3D Accelleration working.

    Would you be so kind to post your xorg.conf file, or mail it to me?

    Thanks a lot!

  14. Uncut naked Paris Hilton sex tape videos

    Paris Hilton Sex Tape Criminal

  15. Jethro says:

    As of Aug 2007 the backup is just called xorg.conf.1

    so :-
    cp xorg.conf.1 xorg.conf

    will work.

    J

  16. Matt says:

    Thank you soooo much. I was near a nervous breakdown.

  17. Nick says:

    Wooow this was a real life saver!!!!
    I have added hope in Ubuntu because it is so easy to restore just by following your tutorial!!!
    thankyou so much

  18. Darren says:

    I just totally screwed up Xubuntu I’d just installed on an old laptop. After installing Xubuntu decided to use a totally non standard H/V rate (the laptop’s TFT showed a quarter of the desktop in the bottom right hand corner of the screen with bits of the rest of the desktop in the wrong places, and when plugging in an external monitor that just come up with the message “Attention! Incorrect Horiz / Vert Frequency”. I then booted up Knoppix which worked fine (which I would use if Knoppix included the drivers for the AccessRunner USB ADSL modem, but unfortunatly it doesnt!), and copied /etc/X11/xorg.conf into /mnt/hda1/etc/X11/xorg.conf replacing the existing file. I thought this should work – oops nope I was wrong – all I got when rebooting with Xubuntu is it keep whinging that it’s missing the default font “fixed”, tried # out all the references to fonts – nothing, tried deleting Xorg.conf – same problem, tried to use dbpkg-reconfigure to reconfigure it still the same problem. In the end have given up and resorted to re-installing the entire linux distro again (grr…), this method does seem a really good way, but by using the CP command in another linux unfortunatly it over-wrote the xorg.conf file without bothering to create a backup (oh well I’ve learned from my mistake – keep xorg.conf safe!

  19. Dave says:

    Thankyouthankyouthankyou….

    I am having an absolute nightmare trying to install and get a sensible screen resolution for my Nvidia GTX 7800 ~ and messing with my xorg.conf file with only half the requisite knowledge seems to have been a mistake! 🙂

  20. David says:

    OMG I almost remove Ubuntu for that problem and I can’t believe how easy this works…. THANK YOU!!!

  21. linreigu says:

    Hi, I wish I had found this page before I tried to reinstall all of xorg (and failed) …

  22. Mer says:

    My wife and her laptop thank you, but more importantly, I thank you!

  23. Josh says:

    THANK YOU I LOVE YOU SO MUCH.

  24. Travis says:

    Thank you.

    Next, maybe a tutorial on how to properly write resolutions?

    I used the “cp” instead of “mv” so I still have a good backup of my .failsafe file

    Thanks again!

  25. […] Det første vi må gjøre er å skrive inn noen endringer i xorg.conf. Det kan være en idé å ta en kopi først, for feil i xorg.conf kan i verste fall gjøre at du ikke kommer inn igjen etter en omstart. sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.sikkerhetskopi Se mer om hvordan du kan legge tilbake sikkerhetskopien på Absolute Beginner Talk. […]

  26. Tonya says:

    thank you so much. I thought I was going to have to reinstall ubuntu. I lost the setting after extending the desktop onto a second monitor. thank you, thank you, thank you. 🙂

  27. Gergo says:

    You rock!

  28. raj says:

    yeah awesome … saved a reinstall…. IT WORKS

  29. […] Se mer om hvordan du kan legge tilbake sikkerhetskopien på Absolute Beginner Talk. […]

  30. Reclame Fotograaf…

    […]Restoring your previous xorg.conf file « Absolute Beginner Talk[…]…

  31. I appreciate, result in I found exactly what I used to be taking
    a look for. You’ve ended my 4 day lengthy hunt! God Bless you man.

    Have a nice day. Bye

  32. Ernestine says:

    I’m not sure exactly why but this blog is loading very slow for me.

    Is anyone else having this issue or is it a issue on my end?
    I’ll check back later on and see if the problem
    still exists.

  33. khoirul amin says:

    You’re so interesting! I don’t believe I’ve read through a single thing like that before.
    So good to find another person with some original thoughts on this topic.
    Seriously.. thanks for starting this up. This website is one thing that’s needed on the web,
    someone with a bit of originality!

  34. khoirul amin says:

    Excellent site you’ve got here.. It’s hard to find quality writing like yours
    nowadays. I honestly appreciate people like you!
    Take care!!

  35. […] Restoring your previous xorg.conf file | Absolute Beginner … – Sep 15, 2006  · Resurrecting your xserver by restoring your previous xorg … So now it’s time to replace our corrupt xorg.conf … Restoring your previous xorg.conf … […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: