Server Fault is a question and answer site for system and network administrators. 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

We have a Gnome session running on our remote server. How can we ssh into the machine and shutdown X-Windows without restarting the machine?

share|improve this question
up vote 4 down vote accepted

Well, are you trying to just shutdown X because of a locked application and restart it, or do you just want to stop X from running entirely?

Assuming you want to just kill X because of a locked-up application: (examples below are from my OpenSolaris-based server, probably not applicable to Sol8 or 9)

bill@aperture:~# kill -9 2478
bill@aperture:~# ps ac | grep Xorg
2593 vt/2     S  0:00 Xorg
bill@aperture:~# kill -9 2593
bill@aperture:~# ps ac | grep Xorg
No immediate results, wait a few seconds to run check again
bill@aperture:~# ps ac | grep Xorg
2631 vt/2     S  0:00 Xorg

Notice that in this case, X restarted. While this may be good if you're just trying to restart X after a lockup, sometimes you just want to shut GDM off entirely. Check svcs for an entry for GDM.

 bill@aperture:~# svcs | grep gdm
online          9:10:05

Well, look, I've got an entry for GDM. Thanks to the wonders of SMF, no matter how hard I try, I can't kill X. It keeps coming back from the dead. Let's tell GDM to die-- no, let's just disable it via svcadm.

bill@aperture:~# ps acx | grep gdm
  2701 ?        S  0:00 gdm-binary
  2702 ?        S  0:00 gdm-binary
  2727 ?        S  0:01 gdmgreeter
bill@aperture:~# ps acx | grep Xorg
  2703 vt/2     S  0:00 Xorg
bill@aperture:~# svcadm disable gdm
bill@aperture:~# ps acx | grep gdm
bill@aperture:~# ps acx | grep Xorg

As a further note, I found this mailing list thread helpful once upon a time, to fix the inability to use Ctrl-Alt-Bksp to kill X on Solaris. Basically, add a few lines to the configuration file for to reenable handling of Ctrl-Alt-Bksp on certain Solaris installs.

share|improve this answer
I want to stop it because I don't want it running on the server. Killing the X-server doesn't seem like the nice way to kill it. I'll try this out tomorrow. – anon Oct 23 '09 at 4:30
Well, I hope it helps out. the svcadm disable thing might be what you need. I hope.... – Bill B Oct 23 '09 at 17:41

Your Answer


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