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?
6 Answers
Kill : xkill -a. -a means it will kill all display instances. For more information run man xkill.
Run : xinit.
Also startx but this command is to start an instance and not the server itself. For more information run man xint and man startx.
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.
- 1,687
On Ubuntu 22.04 (and a few previous versions) you can add a hotkey to your gnome session to kill the x server. Install gnome-tweaks via sudo apt install gnome-tweaks and then open it (logo button and then "tweaks" and enter) then goto "Keyboard & Mouse" -> "Additional Layout Options" -> "Key sequence to kill the X server" -> "Ctrl+Alt+Backspace"
- 101
On more recent versions of Ubuntu (e.g. 22.04) which use Gnome and systemd, you can use:
$ sudo systemctl restart gdm.service
- 1