69

Ubuntu 9.04, NVIDIA – Failed to parse xorg.conf

The NVIDIA applet in Ubuntu 9.04 will not write to the stock xorg.conf regardless of permissions set, and regardless of whether or not it’s running as root.

Here’s what I did to get around it:

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
sudo nvidia-xconfig
sudo nvidia-settings

The first step creates a backup of your currently working xorg.conf file.
Step 2 runs the NVIDIA utility to generate a new xorg.conf file that the utility can actually read.
Step 3 runs the graphical NVIDIA setup tool as root, so you can actually save your changes.

If this does not work then after step 1, do sudo rm /etc/X11/xorg.conf to delete your current xorg.conf file. Then run sudo nvidia-xconfig and sudo nvidia-settings.

69 Comments

  1. appreciate the assist – just installed 9.04 and that was driving me crazy … kinda like trying to install vuze and getting it to update to ver 4.x 🙂

  2. Well it almost worked .. problem is default is 640 x 480 ‘nvidia-settings’ complains screen is too small Now what ? My Monitor is a old Sony Monitor and is not detected. I was hoping to wait till I upgrade

  3. Looks like it worked for me, thanks! I'm another newb coming from years of MS Windows. Mind if I ask a question? Some say you should use GKSUDO instead of regular SUDO on graphics-related hacking. What would have happened if I had used GKSUDO? Thanks a million, Joey

  4. Ummm.. After doing what you suggested, the window border (along with the exit, minimize, and maximize buttons) disappear. Any suggestions?

  5. Anonymous said…

    Looks like it worked for me, thanks! I'm another newb coming from years of MS Windows. Mind if I ask a question? Some say you should use GKSUDO instead of regular SUDO on graphics-related hacking. What would have happened if I had used GKSUDO? Thanks a million, Joey

    We're not really doing any hacking, and what you're concerned about only applies if you're manually editing a file (related to graphics or otherwise). See here for details.

    Anonymous said…

    Ummm.. After doing what you suggested, the window border (along with the exit, minimize, and maximize buttons) disappear. Any suggestions?

    Aside from advising you to restore the backup file if you can't get it working, I'm not sure what else I can tell you.

  6. I am a noob, and discovered I had permission issues, so, I discovered that I had to run:

    gksu nvidia-xconfig
    sudo nvidia-settings

  7. What do I do when I see;
    nvidia-xconfig: command not found

    Am I supposed to have an nvidia driver installed first?
    I have ubuntu 9.10 with nvidia Quadro2 pro vga

    Is there some prior step I missed?

  8. Yes you need to have the nvidia driver installed first. Ubuntu usually prompts you to install the proprietary drivers when it detects an nvidia card. Check system > administration > hardware drivers to see if yours is detected and enabled.

  9. Johnnydopefish, I thank you. Worked like a charm, and resolved an issue with my Compiz cube not actually showing the cube, must have been an issue with the xorg.conf. Karmic vibes from a karmic koala go out to you (;

  10. Thanks a lot for this. I've done this before, and appreciate you're guide more than the other instruction I received. You explain what these commands do, instead of just throwing them at as and saying 'ENTER'.

  11. Hola a todos, he estado peleándome algunas horas con este mismo problema y paso a compartir cómo lo he solucionado yo:
    1. Cambiar nombre a xorg.conf, en mi caso lo cambié a xorg.conf.old
    2. Ejecutar nvidia-settings como superusuario: $ sudo nvidia-settings
    3. Clikar en "Save X Configuration File"
    4. En el cuadro de diálogo clikar en Show preview…
    5. Copiar el texto del preview
    6. ir a /etc/X11/ y *crear archivo xorg.conf y pegar en él el contenido del preview anterior, guardar los cambios y listo.

    * Para crear un archivo con permisos de superusuario y poder manipularlo de forma gráfica:
    Desde una consola: $ sudo dolphin
    Esto abrirá **dolphin como superusuario y podréis crear y manipular archiovos gráficamente.

    ** En mi caso ocupo Kubuntu, para los usuarios de ubuntu supongo que funcionará igual con el manejador de archivos de Gnome Nautilus, creo recordar.

  12. After searching everywhere and numerous log out and reboot steps (after modifying xorg.conf to no avail) I found your solution and it worked exactly as you explained and as required. Thank you very much for posting this information.

  13. Thank you! It took just a minute to fix that.
    thank you for saving my time!!! Mint 8 Helena

  14. No dice on my box… I have the nvidia driver installed, but am still unable to get two monitors working under Xinerama/Ubuntu 9.04. Please help!

  15. I'm not sure about the nature of your problem…if you aren't getting the "failed to parse xorg.conf" error then this article doesn't apply.

    I do not have experience configuring dual monitors, but there are people more knowledgeable than I who can help you over at the Ubuntu forums.

  16. thanks but it didnt work for me,
    it gave:
    VALIDATION ERROR: data incomplete in file
    Note: iam using ubuntu 9.10

  17. Thanks for the tip, it worked well. I also found it necessary to remove $HOME/.nvidia-settings-rc, because there were complaints regarding previous configurations that were no longer needed. nvidia-settings recreated the file. Make a backup of the file before doing this, just in case.

  18. Back in June of 2009, Anonymous said…

    Ummm.. After doing what you suggested, the window border (along with the exit, minimize, and maximize buttons) disappear. Any suggestions?

    The same thing happened to me, and what's worse, the terminal shows up as a white screen – can't see what I'm doing in the terminal. No panic though, I figured out how to fix this.

    First, to be able to put the files back the way they were, have to get sudo privilages for graphic manipulation of files since can't use the terminal. This is a great way that I found somewhere:
    a) Right-click on the panel and choose "Add to Panel".
    b) Choose "Custom Application Launcher"
    c) Name: gksudo
    d) Command: gksudo "gnome-open %u"
    e) Comment: drag and drop a file on this to open as root.

    Second, use this new gksudo launcher by clicking on Places, navigating to File System, and dragging the etc folder onto the launcher.

    Third, if you're fixing the problem I had, you'll just see a white square in the middle of your screen and the computer won't let you do anything. Of course, it's asking for your password since you are trying to use gksudo to open the etc folder. Type in your password even though you can't see what's going on and hit enter.

    Fourth, the white square goes away and eventually etc folder opens up. Now you can navigate to /etc/X11. Find xorg.conf and open with gedit (you will still have root privilages).

    Fifth, open the backup with gedit you made when following the suggested fix on this site.

    Sixth, compare the two files (clicking back and forth on the tabs for each file in your gedit screen).

    Seventh, you will see that the new one is missing some options and sections. Add missing sections to the new file from the backup (I think there was only one section missing), and add missing options from the backup (there were a few) into the appropriate sections of the new file.

    Eighth, save your changes to xorg.conf.

    Ninth, reboot.

    For me, this fixed everything.

  19. Oh my gosh you are awesome. I tried a lot of things and this is the only one that worked. Works great with Ubuntu 9.10. Only the login screen is a little funky but I don't care!

  20. I have a pair of Nvidia 295 video cards and a pair of Dell 27" screens
    The parsing error was the initial problem and with the #2 solution provided "Sudo rm /etc/X11/xorg.conf to delete your current xorg.conf file"
    did in fact work
    The next issue it to work out how to be able to drag applications from one screen to the next.
    I can move the mouse to the new screen but not drag an application i.e. firefox
    Once opened in a window it stays in that window…
    Bring back OS/2

  21. i don't have an nvidia card on my current machine but there should be several different display options in the nvidia applet. it sounds like you have "twinview" activated, where both screens act as individual screens instead of one continuous one. i forget the name of the extended desktop option.

  22. sadly this does not work for me 🙁 i have tried every combination of removing and resetting my xorg.conf file (command line, gui, root user, super user), however when i log out and in again the resolution defaults, the xorg.conf file is configured with the correct resolution

    however if i log in to the gui as the root user, i get the correct resolution

Leave a Reply