Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I'm using Ubuntu 12.04 and making some changes to /etc/X11/xorg.conf. I now need to restart X server to apply the changes, but I don't want to restart my machine.

I know restarting the display manager (eg. lightdm) will sometimes work, is this the best way to do it?

share|improve this question
I know for certain that the GDM display manager restarts X after you log out of a session. I would guess other display managers do as well as its a good way to clean up the environment. – Patrick Jun 13 '12 at 0:41
up vote 9 down vote accepted

Try this from the command line:

sudo restart lightdm

or alternatively

 sudo service lightdm restart

I am not sure what will happen if you are already running X, but it should restart it, so better close out all windows first.

See Restart X Server Ubuntu 12.04 Without Rebooting and How to kill and to start the X server? for more information.

Always a good idea to keep a copy of any configuration file before you modify it so that you can easily restore it if something goes awry.

share|improve this answer
I'm glad you mentioned closing your windows first, as restarting lightdm will do this for you. – dhulihan Jun 13 '12 at 18:52
@dave :-) .. so I assume all worked out ok? – Levon Jun 13 '12 at 18:54
Yep, worked like a charm. Thanks for the answer! – dhulihan Jun 13 '12 at 20:55
  1. Backup your original xorg.conf
  2. Make the changes you want in xorg.conf
  3. Execute the command: killall X
  4. Ubuntu will reload the X for you with new xorg.conf
share|improve this answer

Logging out of the session will cause X to restart with most display managers.

As suggested by someone else, you could also try sudo restart lightdm, however, depending on your display manager this might also be sudo restart gdm or sudo restart kdm (you used lightdm as an example, so I'm that's what you've got; just wanted to cover all the bases).

EDIT: Removed Ctrl + Alt + Backspace as someone pointed out that this has been disabled in Ubuntu. May work for people on different distros who find this thread.

share|improve this answer
I think Ctrl-Alt-Backspace has been disabled by default in Ubuntu for some time now... – jasonwryan Jun 13 '12 at 4:55
Oops, my mistake. – Sam Whited Jun 13 '12 at 5:13
It's ok to refer to others specifically instead of generically as someone :-) E.g., @jasonwryan or @Levon. No biggie, just a suggestion (and what I've seen as common practice over on SO) – Levon Jun 13 '12 at 12:05
Ctrl + Alt + Backspace isn't disabled "by Ubuntu", but was disabled by default in X, I believe back with the 1.5 release. One needs to explicitly enable it, so it's probably rare these days. If you want it to work, search man xorg.conf for the "DontZap" option. – user50849 Jun 13 '12 at 18:30

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.