20

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?

2
  • 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.
    – phemmer
    Jun 13 '12 at 0:41
  • I wish can hot reload without restarting xorg. Some settings can be online adjusted by xinput and xrandr utilities, but not all can. Nov 19 '19 at 12:18
12

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.

1
  • 2
    The second option terminated all my opened applications and logged out. It's pretty close to restart. So make sure you save everything...
    – Amir Uval
    Mar 9 '17 at 15:50
2
  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
1

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 assuming 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.

3
  • 2
    I think Ctrl-Alt-Backspace has been disabled by default in Ubuntu for some time now...
    – jasonwryan
    Jun 13 '12 at 4:55
  • 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
  • 1
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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