I'm using Ubuntu 11.10 with no problems on my Desktop. Suddenly, there are two weeks, it restart the session without apparent reason. It occurs without any warning and I lose my job. It worked perfectly until 2 weeks ago. Please, help me!
Just a hunch you could have upgraded to an Nvidia driver which has been known to crash X.org in 11.10 and 12.04. The symptoms sound similar: suddenly you find yourself back at the Lightdm login screen. Typically, this happens when web browsing, often with Flash in the page (but sometimes not). No warning. Just a dropped session. Seems random. Let's first verify that you have the problem.
Check to see if you have the Nvidia driver. Launch nvidia-settings and look for the Nvidia driver version. The problems are with the default version installed (295.40) and later. If that's the version shown, you should verify you're getting the same X.org crash.
Next time your system crashes (or if you know when it last crashed), you can check your syslog for the error. Use System Tools > Log File Viewer in the menu, then click on syslog. Scroll until you're around the time of the crash and look for a line that contains: "Gdk-WARNING: gnome-session: Fatal IO error 11 (Resource temporarily unavailable) on X server" If you have the Nvidia driver and see that error, you know you have run into the Nvidia driver bug.
Here's how to downgrade to the previous Nvidia driver version that works.
Find the 290.10 version in Launchpad. I found the AMD 64 version here: https://launchpad.net/ubuntu/precise/amd64/nvidia-current/290.10-0ubuntu2. The download link is on the right side. Download it to your home folder.
Now deactivate the old driver by opening a terminal and type "jockey-gtk". Select the driver that's got the green dot next to it and select the "Remove" button. Close it when it's done.
Now we're going to install the new driver. Type the command "sudo dpkg -i nvidia-current_290.10-0ubuntu2_precise_amd64.deb" to install that version. It will ask you for your password. It will take a while as it runs a kernel module version sanity check, but it will finish.
You'll want to force and lock that version so it doesn't get upgraded by accident. There's probably a quick way to do this command-line, but I use synaptic to make it easy. Install synaptic (run: sudo apt-get install synaptic) and launch it with "sudo synaptic". Search for the package we just installed. It will just be named nvidia-current. You should select Package > Force Version, and choose 290.10, and hit "Force". Now lock it in place by choosing Package > Lock Version from Synaptic's menu. The line in Synaptic will turn red, but have a green square with a lock icon on the right.
Now it's time to activate it by re=launching jockey-gtk from the command line. Select "version-current" and choose "Activate". You'll get the green dot next to it again. Close jockey-gtk.
Reboot. Let's make sure everything's in place. Go to nvidia-settings again and check the driver version to make sure you are running 295.10. You may have to reinstall nvidia-settings (sudo apt-get install nvidia-settings). If the version number says 290.10, you should experience no more sudden session losses.