Super User is a question and answer site for computer enthusiasts and power users. 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 Server 11.10 on my machine. Next I used sudo apt-get install ubuntu-desktop to install GUI.

Is it possible to disable it and re-enable it anytime I want?

If yes, what commands do I use?

share|improve this question
up vote 1 down vote accepted

running the following command:

initctl list

will give you a list of all your upstart jobs, if it's not gdm it will be something similar.

Assuming it is in fact gdm the following will show you under what conditions the gnome display manager will automatically start:

initctl show-config -e gdm 

At this point you can do one of two things by editing the gdm config file using:

sudo nano /etc/init/gdm.conf

Either add:


on a line by itself somewhere near the top of the file BEFORE the line that begins with:

start on

This will essentially prevent gdm from ever running by itself, however you can still start XWindows manually by logging in and running: startx

Your other option would be to comment out (add a # before any text on the line :) the line beginning with:

start on

and every subsequent line until (but not including) the line that begins with:

stop on

This will prevent gdm from running at startup but will still allow you to start it as a service if for instance you wanted to leave a graphical login screen up instead of a black console. You can check to make sure your changes were correct by running:

initctl show-config -e gdm

once more to make sure all of the start ons are gone. Hopefully this helps, I find half the joy of using Linux to be unraveling it's inner workings till I understand them so I tried to give you as much info as you will need but still leave a few things for you to discover on your own ( man initctl )...

share|improve this answer

The fastest method would be to log in to 1 of the 6 TTY's using CTRL+ALT+F1 through CTRL+ALT+F6.

To get back to the desktop/GUI, simply press CTRL+ALT+F7.

share|improve this answer
He asked how to disable the GUI so I'm assuming he's actually more interested in freeing up the memory/resources used by X11 than simply logging in again through another tty... – Justin Buser Apr 29 '12 at 14:39
sudo service gdm stop

Should stop the gui... though it might be a different service name these days...

The benefit of this over iglvzx's answer is that the gui stops running, freeing resources, rather than simply hiding it.

share|improve this answer
You may need superuser privilege to stop gdm. – iglvzx Nov 27 '11 at 3:20
You will need superuser privilege to stop gdm – Justin Buser Apr 29 '12 at 14:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .