When autologon is active, lightdm
will start the Unity 3D session, not the 2D (or any other shell that I want to auto-login to).
Is there a way to start the shell I want automatically (autologon)?
Anyway, if autologon is disabled, the last used session is launched, and that's fine. I just want to choose which is default with autologon.
The list of sessions is described in the directory
/usr/share/xsessions
.Some of the more common session names are as follows:
Thus, if you change the light-dm configuration file to "ubuntu-2d" this will default the session to Unity-2D
i.e.
change the line
to
Note - if you don't have a lightdm.conf file then for a autologin use the following values for this file:
Another possibility is to run:
E.g.:
This will also create the
lightdm.conf
file if it wasn't already present.It is strange that LightDM (Ubuntu 11.10's display manager, which provides the graphical login screen) is not remembering your selection across reboots.
You can manually edit the relevant configuration file, which is called
.dmrc
and is located in your home folder. In Nautilus (the file browser), you'll have to press Ctrl+H (or View > Show Hidden Files) to see it and other files that start with a.
character. If you have this file--which you probably do--then its contents will be like:For GNOME Classic you can change it to say:
Or for GNOME Classic (no effects) you can change it to say:
If you happened to want to use Unity 2D (session type Ubuntu 2D), you could change it to say:
If you don't have the file at all, then you can create it with the appropriate contents.
If you want to set GNOME Classic or GNOME Classic (no effects) as the default session type for all users--or you'd prefer not to, but the above user-specific method doesn't work--then you can edit
/etc/lightdm/lightdm.conf
, changing the line that saysuser-session=ubuntu
to instead sayuser-session=gnome-classic
oruser-session=gnome-fallback
(oruser-session=ubuntu-2d
). A few things to keep in mind when considering doing this:It is preferable to edit the per-user configuration files in users' home folders, unless you have a reason to prefer changing the global configuration (like that not working).
Since this is a global configuration file and it contains considerably more than the simple configuration option that you are intending to edit, it is advisable to back it up before editing it, in case you make a mistake. You can do that in the Terminal by running the command
sudo cp /etc/lightdm/lightdm.conf /etc/lightdm/lightdm.conf.old
.This file is owned by root, hence the sudo command above. You must also edit it as root. To open it in gedit as root, you can run
gksu gedit /etc/lightdm/lightdm.conf
(either in a Terminal window, or in the graphicalRun Application
text box, when you can get by pressing Alt+F2) orsudo -H gedit /etc/lightdm/lightdm.conf
in a Terminal window.It seems likely that the behavior you're experiencing is a bug, so after gathering additional information by seeing if manually editing
~/.dmrc
works, you may want to report it as one. Read this carefully first, then after searching to see if a similar bug has been reported, initiate the reporting process by invokingubuntu-bug
with the PID of the runninglightdm
process, or, almost as good, runubuntu-bug lightdm
...which should all make sense after you've read that guide.By the way, besides Unity (session type Ubuntu), Unity 2D (session type Ubuntu 2D), and GNOME 3 Fallback (GNOME Classic and GNOME Classic (no effects)), you might also consider, as even lighter-weight options, Xfce4 (install the package
xubuntu-desktop
and select session type Xubuntu) and LXDE (install the packagelubuntu-desktop
and select session type Lubuntu).ubuntu-mate-desktop
package (see Ubuntu MATE).There's also GNOME 3 with the GNOME Shell instead of Unity (install the package
gnome-shell
and selectGNOME
) and KDE 4 Plasma (install the packagekubuntu-desktop
and selectKubuntu
), but those unlikely to be less resource-intensive than the above options.to change the default per user, check
seems like this set's the
.dmrc
in the user home.cheers
To change the default Session in Lightdm
I edited
/etc/lightdm/lightdm.conf
with this content:And it starts automatically to gnome-shell.
I find that setting any of the above is overridden by the users last session stored by lightdm. You may have to remove or edit the user files at
/var/cache/lightdm/dmrc
to enable the global default setting. Or on an individual basis by editing theuser.dmrc
file that has the following contents:This may not work in Ubuntu but it worked for me in Fedora. It took days to figure out and I wanted to share it:
Go to
/usr/share/xsessions
and/usr/share/wayland-sessions
and add prefixes with a different number and a dash to every file ending in .desktop.The lowest number will be the default. For example, I want xfce to be my default so that file is named 1-xfce.desktop
Hope this helps.