Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed ubuntu-12.04.1-server-i386 and on top of that i have installed Ubuntu desktop environment so that i can maintain server easily.

Hear I totally understand that installing Desktop environment will affect my server efficiency but its quit easy to maintain server with GUI so I am wondering that is there any workaround to enable or disable Ubuntu Desktop Environment whenever we need it like we do in Windows for services ? I searched and reffed many sites but did not found anything related to this.

Thanks in advance and sorry for my poor English.

enter image description here

share|improve this question
up vote 6 down vote accepted

This is a specific instance of a generic question, "how do I prevent an upstart service from running at boot".

You can use an override:

sudo echo "manual" >> /etc/init/lightdm.override

To start lightdm on command:

sudo start lightdm

To restore your system so that lightdm is always started on boot:

sudo rm /etc/init/lightdm.override

For more information, the upstart cookbook is your friend:

SRC : Here

share|improve this answer
And how do I shut down the GUI again? – Håkon K. Olafsen May 6 '14 at 8:17
sudo service lightdm stop – Rushik Parikh May 7 '14 at 11:44
Doesn't sudo refer to echo? Your first sudo echo "manual" >> ... has no permission to write to /etc/init/. – Gauthier Jun 15 '15 at 9:46
I had that problem as well. >> is not run as root. sudo -i first is a good work around. – Robert Jacobs Oct 13 '15 at 20:57
It's back to gdm so you should create /etc/init/gdm.override with the contents as above, these days (2016) – Warren P Apr 7 at 20:41

Try to disable GUI, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo update-rc.d -f gdm remove

When you restart your computer, you’ll get text-mode login. To run GUI again:


To enable GUI again:

sudo update-rc.d -f gdm defaults


share|improve this answer
I execute command "sudo update-rc.d -f gdm remove" nothing happens! then i tried "sudo service lightdm stop" but it stops at checking battery stste and "sudo service gdm stop" is unrecognized service – Rushik Parikh Jan 9 '14 at 9:22
I installed 12.04 server yesterday, and followed the steps, and it worked. Did exactly as the source said. Let me know. – Mitch Jan 9 '14 at 9:51
i have have added image in the question. I guess the command is not executing properly – Rushik Parikh Jan 9 '14 at 10:48
"sudo echo "manual" >> /etc/init/lightdm.override" worked for me – Rushik Parikh Jan 9 '14 at 11:10
I tried that, and it didn't work for me. see image – Mitch Jan 9 '14 at 11:27

Another way to avoid the permissions issue, is to use 'tee'. Like so:

echo "manual" | sudo tee /etc/init/lightdm.override
share|improve this answer

Your Answer


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.