How to Install LightDM in Ubuntu 11.04 Natty Narwhal?

Canonical said that if they get rid of GDM (gnome display manager) and install something a bit "light-weight" would certainly help to speed up the booting times in Ubuntu Linux. First I thought "ya, like it's gonna make a difference" but it turns out to be that I was quite wrong (damn it!).

Starting with the Ubuntu 11.10 alpha releases, Canonical did replace GDM with another lightweight log-in manager called LightDM and according to some testers, LgihtDM has actually being able to cut out few seconds of booting times in Ubuntu thus significantly speeding things up!. Although LightDM is certainly not the only reason for this sudden "boost" but it has certainly helped, it seems.

So I thought giving it a go in my Ubuntu 11.04 Natty Narwhal Laptop and how did it went?, well, not so good.

But to remind you that both lightDM and Ubuntu "integration" is at the beta stage at this moment thus bugs and compatible issues will have to be tolerated and even if you successfully installed LightDM in Ubuntu 11.04 Natty Narwhal there are no guaranteed results.

The "beauty" lightdm!...

So if at this moment you should not try to install this if you want the best possible stability out of your current Ubuntu OS. Anyhow, I dunno whether it's for the good or the worse :P but before installing and replacing GDM with LightDM and later realizing that it doesn't work at all thus all of a sudden you have an Ubuntu OS that's stuck at the log-in screen... there is actually a way that we can "test" LightDM, like running it in a Virtual environment before actually replacing the GDM.

So let's begin the installation. 

There is a PPA available for this, so the installation is pretty straight forward. Just open your Terminal and enter the below commands.
sudo apt-add-repository ppa:lightdm-team/ppa

sudo apt-get update

sudo apt-get install lightdm lightdm-greeter-example-gtk
Now to the near end of the installation you'll be asked by a window that says to choose either "gdm" (the current one) or the "lightdm". Don't choose lightdm, yet. Make sure you've selected "gdm" (just for now :D) and press enter.

Just make sure you've chosen "gdm", just for now :)...

How to test it?

I actually grab most of these information from this Ubuntu Wiki page (it kinda destroyed my perception of being an "expert" didn't it?, shi*) and it says that to test lightdm before applying it, to use the below command.
lightdm --test-mode
But my 11.04 Natty gave me an error saying that an Xserver module called "Xephyr" is missing. So before "testing" it in the somewhat "virtual" mode, you too might want to install that "Xephyr". To do that, open your Terminal and enter the below commands.
sudo apt-get install xserver-xephyr

Now enter the above command and it should open up a new window and will run lightdm in it. Although you can click on the options such as users, etc on the window (as you were running it for real) but it's just a "virtual" environment thus you can't log-in or do anything at all.

But the thing is that, if you see a perfectly running lightdm (with a GTK theme, working menus, without any screen flickers, you know nothing "unusual") then you're good to go.

Even if you don't see a GTK theme but an ugly looking theme, still lightdm will run just fine. But after you put this command if nothing happened or even if it did open a new window and then gave few blinks and just crashed (like in my case, that's why I don't have a screen shot of that window), then that's what's going to happen if we actually replace it with GDM.

Update: According to Craig's comment below, he actually have found out that after installing a GTK-Greeter theme by using the below command should solve this "flickering and crashing" issue. 

Although I haven't tested it (I removed lightdm ... gonna wait till 11.10 hits the streets) but it's worth trying. 
sudo apt-get install lightdm-gtk-greeter
So if you see any on those, then please go no further and wait a little longer until they introduce a stable version. But they also update this PPA quite often so you'd probably have a much improved version by the time you read this post, hopefully. 

But after running it in the "test-mode" if it ran perfectly well for you, then you can safely enable it for real by entering the below command in your terminal window and choosing "lightdm" this time instead of "gdm". Otherwise, as said, it's at its beta stage right now, thus we should better wait (not by choice, in my case :/).
sudo dpkg-reconfigure gdm
If however this works really well in your computer (lucky Geek!) then you can install several themes for Lightdm that uses GTK, Webkit or Qt as the "engine" to make thing look much more beautiful as well :D. To install them use the below commands.
sudo apt-get install lightdm-engine-webkit

sudo apt-get install lightdm-engine-gtk

sudo apt-get install lightdm-greeter-example-qt

Good luck!.


CRAiG GoMEZ said...

I had the same problem... when running in test mode, it blinked a few time and then crashed... so I ran the test in debug mode

lightdm --test-mode --debug

And I saw this error

** (lightdm:4677): DEBUG: Failed to load session file /usr/share/xgreeters/lightdm-gtk-greeter.desktop: No such file or directory:
** (lightdm:4677): DEBUG: Failed to start greeter
** (lightdm:4677): DEBUG: Stopping display

So I installed a "missing" dependency

sudo apt-get install lightdm-gtk-greeter

And it worked after that!

Gayan said...


Awesome man, thanks!. Although I didn't test it since I reinstalled Ubuntu recently and haven't tried it out but I'm pretty sure it's the issue here (I also updated the post).

Thanks again (you made me jealous! :D, lol).

Post a Comment