This simple tutorial shows how to stop or restart X server in Ubuntu using command or keyboard shortcuts. Normally, X-windows need to restart when having problems with dual monitor or video card driver.

Since Ubuntu 10.04, we can use following key combination to restart X:

right Alt + PrtScr/SysReq + K

For command line:

Restart Ubuntu’s default LightDM display manager, use:

sudo service lightdm restart

Restart gnome display manager GDM, use:

sudo service gdm restart

Restart KDE display manager KDM, use:

sudo service kdm restart

You can change parameter restart to stop/start to stop/start X. You may want to know what display manager is running LightDM, GDM, or KDM? run:

cat /etc/X11/default-display-manager