If you enable auto log-in in Ubuntu 11.10 Oneiric, it automatically logs into Unity. Some people installed gnome-shell Gnome 3 desktop and want Ubuntu auto log into gnome-shell. Normally, we first disable auto log-in behavior, log out and back into gnome-shell, and finally in Gnome 3 desktop enable auto log-in again.

Unfortunately, this settings doesn’t work for me, but I found a command-line solution (from Ubuntu forum):

To make Ubuntu 11.10 auto log-in gnome-shell, open up a terminal window and run this command:

sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-shell

If you want to change back to Unity, run:

sudo /usr/lib/lightdm/lightdm-set-defaults -s ubuntu

BTW: to auto log-in gnome classic desktop (sudo apt-get install gnome-session-fallback), run:

sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-classic