In 12.04 How do you kill the X server from the command line and from the GUI interface and how do you start it from the virtual terminal?
One way to restart an instance of the X server is to run (from the commandline)
sudo service lightdm restart
For Ubuntu 15.04 and later:
sudo systemctl restart lightdm.service
and for Kubuntu 15.04 and later:
sudo systemctl stop sddm.service
On 12.04, you can restart the server with the shortcut keys: Right Alt + Print Screen + K.
In Ubuntu 14.04:
Press Ctrl+Alt+F1 and then run:
sudo service gdm stop
sudo service lightdm stop
… depending on your display manager.
NOTE: To recover use
startx, alternatively replace the
start in either of the above commands.
-a means it will kill all display instances. For more information run
startx but this command is to start an instance and not the server itself. For more information run
man xint and
I don't believe it's possible to kill Xserver from GUI, and even if it were, it would not be the right way to do it.