# Ubuntu: gdm does not start at boot



## McPuffster

I'm running Ubuntu 7.04. When it still was "fresh", everything was fine, but after messing around with the xorg.conf-file in order to among other things adjust the mouse, tablet and graphics driver, gdm now does not start at boot. In stead I'm faced with a command prompt, and is forced to start gdm manually. That means that each time I boot I have to enter password three times (prompt login, sudo gdm, entering X). This is starting to become bothersome.

Does anyone have any idea why X won't start automatically, and how I fix it? I tried just autoconfigure the xorg.conf, but then X wouldn't start at all, so I had to revert to the backup.

Since X does work, this shouldn't be so hard to fix. That's how it feels to me anyway.


----------



## bkubes

Maybe it's not starting at the correct run level anymore?

First get sysv-rc-conf
*sudo apt-get install sysv-rc-conf*
and after it's installed run
*sudo sysv-rc-conf*

See if your gdm line doesn't match up with mine


----------



## McPuffster

My gdm-line does match, I'm afraid.


----------



## TheMatt

Try this:


Code:


sudo dpkg-reconfigure xserver-xorg

Go through the prompts to reconfigure your X.org configure file.


----------



## McPuffster

I've tried that already, with poor results. Could be my fault, though.
I selected "nvidia" as driver and made sure 1280x1024 resolution was checked. After that, gdm refused to start at all. I couldn't even start it manually, it just went bonkers. So I went back to the back-up.

EDIT: Ok, I tried it again. gdm works, but I'm back to where I was. It won't start at boot, only manually.


----------



## bkubes

While I feel it's more of a hack than the real solution, 
I disabled gdm from every runlevel with sysv-rc-conf just to make sure gdm wouldn't start.
Then I added 
*gdm &*
to the end of */etc/rc.local*, rebooted and it worked just fine.

Anyone know of any downsides to this method?


----------



## McPuffster

After messing around (as mentioned) with xorg.conf, gdm stopped working. During that time I installed xdm to have a graphical interface while looking for a solution. I fixed gdm so it worked, but it wouldn't start at boot. That's how it happened.

Could uninstalling xdm somehow fix this? HOW do I uninstall it?


----------



## bkubes

Did adding *gdm &* to the end of /etc/rc.local have no effect?

to uninstall xdm I think it would be
*sudo apt-get remove xdm*


----------



## McPuffster

Addin "gdm &" in /etc/rc.local just before "exit 0" does indeed start gdm at boot. Thank you!

I haven't disabled gdm from the run levels though, would you recommend I do that?

Also, as you previously asked, are there any downsides to this "hack"? Doesn't my current configuration cause gdm to boot regardless of run level for instance? Is there a more "correct" way of fixing this?

It will do for now, but as you say, we didn't fix it, just bypassed the problem.


----------



## bkubes

When booting regularly; it uses the script /etc/init.d/gdm and links it to the different runlevels. 
Looking through the script the first thing I noticed was that if gdm isn't your default display manager it fails to load.

does the file
*/etc/X11/default-display-manager*
contain */usr/sbin/gdm* ?


----------



## McPuffster

Yes, it does.


----------

