What if I'd like to exit the X session to use raw console without any X process running? I know I can always press Ctrl+Alt+F1/F6 to switch between a raw console and a graphical environment, but some times I just want the last to be gone (for technical reasons). So how to shut it down correctly, preventing from being automatically respawned?
3 Answers
To Stop X.Org Server:
sudo service lightdm stop
To Start X.Org Server:
startx
##(OR)
sudo service lightdm start
To Restart X.Org Server:
sudo service lightdm restart
In all cases, replace lightdm
with whatever greeter/display manager you use. lightdm
is Ubuntu's default display manager.
-
Yes, I know you asked about how to stop it alone, but posting to start and restart the service in a single place might help others :) Oct 14, 2011 at 9:11
-
1Technically, you're stopping the desktop environment GNOME, which then shutdowns Xorg. Replace
gdm
bykdm
,xdm
,ldm
or whatever desktop environment you're using. Oct 14, 2011 at 9:18 -
When you type sudo service lightdm stop, it replies lightdm stop/status: This is a clue.
sudo lightdm stop
-
This is on Ubuntu 14.04 from a virtual terminal Ctrl-Alt-f1-6. You will probably have to hit Ctrl-C afterwords to get back to a command prompt.– CormaghDec 1, 2015 at 22:21