Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

5 Answers 5

up vote 55 down vote accepted

The list of sessions is described in the directory /usr/share/xsessions.

Some of the more common session names are as follows:

  • For unity-2d the session file is called ubuntu-2d.desktop
  • For gnome-classic the session file is called gnome-classic.desktop
  • For gnome-classic (no effects) aka gnome-fallback the session file is called gnome-fallback.desktop
  • For unity-3d the session file is called ubuntu.desktop
  • For Lubuntu the session file is called Lubuntu.desktop
  • For LXDE the session file is called LXDE.desktop

Thus, if you change the light-dm configuration file to "ubuntu-2d" this will default the session to Unity-2D

i.e.

sudo nano /etc/lightdm/lightdm.conf

change the line

user-session=ubuntu

to

user-session=ubuntu-2d

Note - if you don't have a lightdm.conf file then for a autologin use the following values for this file:

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu-2d
autologin-user=myusername
autologin-user-timeout=0

Another possibility is to run:

sudo /usr/lib/lightdm/lightdm-set-defaults -s <session-name>

E.g.:

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

This will also create the lightdm.conf file if it wasn't already present.

share|improve this answer

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:

[Desktop]
Session=ubuntu

For GNOME Classic you can change it to say:

[Desktop]
Session=gnome-classic

Or for GNOME Classic (no effects) you can change it to say:

[Desktop]
Session=gnome-fallback

If you happened to want to use Unity 2D (session type Ubuntu 2D), you could change it to say:

[Desktop]
Session=ubuntu-2d

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 says user-session=ubuntu to instead say user-session=gnome-classic or user-session=gnome-fallback (or user-session=ubuntu-2d). A few things to keep in mind when considering doing this:

(1) 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).

(2) 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.

(3) 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 graphical Run Application text box, when you can get by pressing Alt+F2).

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 invoking ubuntu-bug with the PID of the running lightdm process, or, almost as good, run ubuntu-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 package lubuntu-desktop and select session type Lubuntu).

There's also GNOME 3 with the GNOME Shell instead of Unity (install the package gnome-shell and select GNOME) and KDE 4 Plasma (install the package kubuntu-desktop and select Kubuntu), but those unlikely to be less resource-intensive than the above options.

share|improve this answer

To change the default Session in Lightdm

sudo /usr/lib/lightdm/lightdm-set-defaults --session gnome-shell
share|improve this answer
1  
Thanks, I actually wanted gnome shell, but I found it with sudo /usr/lib/lightdm/lightdm-set-defaults --session gnome-shell –  wim Oct 23 '11 at 13:09
    
no problem. I couldn't test it but the documentation I foudn suggested gnome for 'gnome-shell'. Did passing gnome for session give an error? Then I should edit my answer –  Anarci Oct 23 '11 at 14:16
    
no, but it went into the old gnome 2. –  wim Oct 23 '11 at 23:24

to change the default per user, check

/var/lib/AccountsService/users

seems like this set's the .dmrc in the user home.

cheers

share|improve this answer

I edited /etc/lightdm/lightdm.conf with this content:

[SeatDefaults]
greeter-session=unity-greeter
user-session=gnome-shell
autologin-user=paul

And it starts automatically to gnome-shell.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.