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

How to terminate GUI in SunOS from a shell-script running it from the terminal.

share|improve this question
I have no clue on what command to use on Solaris and I don't have the machine available,in Ubuntu I found sudo stop lightdm – Phil_Charly Dec 10 '13 at 15:57
You should state the SunOS (Solaris) version used. – jlliagre Dec 10 '13 at 20:32
up vote 2 down vote accepted

You can use the svcadm commands:

Disable the cde-login service:

svcadm disable svc:/application/graphical-login/cde-login:default

Enable it back:

svcadm enable svc:/application/graphical-login/cde-login:default

Or, if you want to do it old school:


/usr/dt/bin/dtconfig -d


/usr/dt/bin/dtconfig -e
share|improve this answer
On Solaris 11 & later, cde-login has been replaced by gdm, so it would be svcadm disable gdm and svcadm enable gdm instead. – alanc Dec 11 '13 at 15:32
Yup, but we don't have more details about Solaris version, at the moment. – ludiegu Dec 11 '13 at 17:05

Although it's been ages since the last time I had a SunOS workstation I would imagine that the GUI is typically part of the default runlevel 3 and changing to runlevel 2 would disable the GUI:

telinit 2 

The GUI (possibly Xorg) is most likely a service you can disable with svcadm disable <FMRI> The list of possble services can be found with svcs -a.

share|improve this answer
Nope, when Solaris used runlevels (prior to the switch to SMF in Solaris 10), the GUI was started in runlevel 2, as part of the "local system services" -- runlevel 3 was for running servers for other systems to connect to. – alanc Dec 11 '13 at 15:31

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.