Error saving Nvidia X server settings on a clean install of Ubuntu 9.10 (Karmic)

After a clean install of Ubuntu Karmic (9.10), on a box with an Nvidia card (1), went into "System" > "Administration" > "NVIDIA X server settings" and changed configuration to TwinView (I'm using dual monitors), which worked, but saving the configuration returned:

Failed to parse existing X config file '/etc/X11/xorg.conf'

Nothing further found in the logs. The solution was two-fold.

Firstly, running Nvidia config from the shell instead of the Administration menu, dumped a useful error to the screen, when attempting to save settings in the GUI:

$ sudo nvidia-settings 

VALIDATION ERROR:  Data incomplete in file /etc/X11/xorg.conf.
Undefined Device "(null)" referenced by Screen "Default Screen".

Secondly, now that I know that the problem is that nvidia-settings is upset with something in the existing config, one way to solve this is to just let nvidia-xconfig generate a new config.

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

WARNING: Unable to locate/open X configuration file.
New X configuration file written to '/etc/X11/xorg.conf'

A diff of the new xorg.conf against the backed up version, shows a bunch of new stuff was added along with TwinView options. Looks good to me. Now I reboot to confirm the new xorg.conf settings produce the result.

Yay, problem solved, on with my day.

(1) Specific model is:

$ sudo lspci | grep VGA
01:00.0 VGA compatible controller: nVidia Corporation G84 [GeForce 8600 GT] (rev a1)

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).