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

The command sudo service gdm stop would successfully disable the X server in Ubuntu 11.04 temporarily.

However, this same command no longer works in Ubuntu 11.10, because "gdm" is an "unrecognized service" according to Terminal. How, then, do I disable the X server in Ubuntu 11.10?

share|improve this question
if you just want to restart x server just log in and out, otherwise ctr+alt+backspace normally does it to... perhaps that shortcut needs to be enabled under keyboard preferences – HTDutchy Oct 13 '11 at 22:01
possible duplicate of How to stop the login server? – Nathan Osman Oct 16 '11 at 19:31
The question should be "how to stop the session manager" but as many people thinks that gdm is an "X server" this should stay like this. – Emmanuel Dec 6 '13 at 9:14

GDM was switched out for LightDM, so:

sudo stop lightdm

Or in your service parlance:

sudo service lightdm stop

For future reference, all these upstart services (that can be run with initctl's service command and shortcuts) are .conf files in /etc/init/

share|improve this answer
Thats what i was looking for, thanks! – Drewdin May 4 '12 at 20:27
The question is about exiting X server, but I believe lightdm is X server client ? No ? and the command in your answer will only stop the client and not the server ? – Ahmed Apr 12 '15 at 2:23
@Ahmed the lightdm startup script is what starts X. – Oli Apr 12 '15 at 8:34

The reason that doesn't work is because Ubuntu 11.10 has switched from GDM to LightDM.

Try this command instead:

sudo service lightdm stop
share|improve this answer

You can also use the keyboard shortcut:

Alt + PrtScn/SysReq + K

A bit of a long winded keyboard shortcut, maybe too many people were pressing Ctrl+Alt+Backspace so they changed it to this.

I can confirm this as working from 10.04 through to 11.10.

share|improve this answer

@Oli pretty much nailed it, but I wanted to note that this probably won't help you out much if you need to do something from the command line without X.

For that, you should press Ctrl+Alt+F1, then log in from the console. Afterwards, you can kill and restart the lightdm service as needed.

share|improve this answer

Technically speaking gdm or lightdm are managing desktop session requests they are not X servers. (an X server is serving events to X application, xorg is an X server :) .


To stop the X server killall X or sudo killall X if you are not owner of the process.

Of course you must have a terminal to do that.

One way if you cannot open a gnome terminal or an xterm is to start a text console; press simultaneously Ctrl + Alt + F1 keys, then login at the prompt (your password will not be shown, not even as asterisks). (F1 to F5 are ok)

share|improve this answer
Yup, exactly. And the question was how to shut "X server" down? I have no gdm or lightdm installed, I have nothing to do with them. We started server: "X &" as root. How can we stop it ? – Tele Dec 6 '13 at 2:59
@Tele Just made an edit – Emmanuel Dec 6 '13 at 9:10
Yes I know about killall, but isn't there something more delicate, regular and official. I don't like brutality. Do we have to wipe the process out like a frozen one? – Tele Dec 7 '13 at 5:38

old post but current question. The command sudo service mdm stop would successfully disable the X server in Linux Mint 17.3 temporarily. After install drivers you can do sudo service mdm start.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.