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.

After Ubuntu Server 12.04 installation, I installed Xubuntu just to have a minimal GUI:

sudo apt-get install x-window-system-core
sudo apt-get install --no-install-recommends xubuntu-desktop gparted

But now I want to start X just on certain ocasions. Before 12.04, I just issue:

sudo update-rc.d -f gdm remove

But this command does not work anymore.

How can I stop X from init on Ubuntu 12.04 ? And how can I start it when I need it ?

I have tried both of these questions but I don't have a gdm.conf:

share|improve this question
    
So, you had Ubuntu desktop, post-installed Xubuntu, but don't want the default Xubuntu graphical session, but only want to start X manually? –  belacqua Jun 16 '12 at 18:44
    
Thank you +Jorge Castro. I've already read both articles before but both works on gdm.conf but I don't have gdm configuration on this box. –  josircg Jun 16 '12 at 19:04
    
Thanks for replying belacqua. No. It's Ubuntu Server. That's exactly what I want: start X just on certain ocasions. –  josircg Jun 16 '12 at 19:07
    
I am wondering with Xubuntu don't have a gdm.conf - this should be the root of all my questions. –  josircg Jun 16 '12 at 19:12
    
Also see askubuntu.com/questions/6357/dont-start-xserver –  belacqua Jun 16 '12 at 19:36

4 Answers 4

up vote 8 down vote accepted

In recent versions of Ubuntu, gdm has been replaced with lightdm - this is why you don't have a gdm.conf. To set lightdm to be started manually, create an 'override' file for its init configuration:

echo 'manual' | sudo dd of=/etc/init/lightdm.override

(this just creates a file, called /etc/init/lightdm.override, containing a single line that says manual)

This way, lightdm will only be started when you invoke:

sudo service lightdm start

and to stop it:

sudo service lightdm stop
share|improve this answer
2  
Wouldn't it be easier to just type echo manual >> /etc/init/lightdm.override as root? –  B1KMusic Jun 8 '13 at 5:53
3  
@B1KMusic: sure; but then you have to do an extra command to get the root shell. I prefer using sudo and running the absolute minimum amount of stuff as a privileged user as possible (in this case, running a bash as root, vs. running dd as root) –  Jeremy Kerr Jun 10 '13 at 0:55

I installed Ubuntu Server 12.04 on a netbook, mainly because I'm more of a fan of CLI then I am of GUI, but wanted a light GUI for small things. I installed LXDE, not Lubuntu, but it would start LXDM, the login manager for LXDE. I looked all over and tried many things to get this to stop loading LXDE. After looking at this question and answer, I found a good way of stopping it for LXDE.

Instead of adding a file similar to lightdm.override, I was looking in /etc/init and found a file called lxdm.conf. After looking through the file, mainly because I was curious, I found that this is the file that I needed, or didn't need. After closing the file, I renamed it

    sudo mv /etc/init/lxdm.conf /etc/init/lxdm.conf.bak

I renamed it instead of removing it in case it caused problems, but so far I can't tell any problems from renaming this file, so it should be safe to remove.

I don't know about other DE's but this worked for me with LXDE.

share|improve this answer

just want to share , may be it become helpful to any one .

I installed Ubuntu Server 12.04 and later installed graphical interface kubuntu-desktop

now when i wanted to disable graphical startup/login I tried all the options

/etc/default/grub .. making the entry GRUB_CMDLINE_LINUX_DEFAULT="text" in place of "quiet splash"

update-grub

update-rc.d -f ldm remove
update-rc.d -f kdm remove
update-rc.d -f gdm remove

as well as

echo 'manual' | sudo tee /etc/init/lightdm.override

Nothing worked. Then I edited the /etc/init/kdm.conf , and added 2 default runlevel to and runlevel [!026]

stop on runlevel [0126]
#================================================================
#start on ((filesystem
#           and runlevel [!026]
#           and started dbus
#           and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
#                or stopped udev-fallback-graphics))
#          or runlevel PREVLEVEL=S)
#
#stop on runlevel [0126]
#================================================================

It worked.

share|improve this answer

I noticed in /etc/init/lightdm.conf there's a line that says:

start on ((filesystem and runlevel [!06]

can't we just change that to [!026] ?

Giving it a try as soon as I can afford to reboot the machine.

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.