Operating System - Linux
1753485 Members
4728 Online
108794 Solutions
New Discussion юеВ

Re: Starting and stopping the gui when needed

 
ROSS HANSON
Regular Advisor

Starting and stopping the gui when needed

When you install linux you get a nice gui with things to click on and enjoy.

Can you start linux without any sort of gui so cpu usage can remain low but still bring up gui when needed?

I am aware of using Alt-Ctrl-F1, F2, F3 ect...
but when doing this, does it "shutdown" the gui lowering your cpu usage?
Ross Hanson
7 REPLIES 7
Ivan Ferreira
Honored Contributor

Re: Starting and stopping the gui when needed

Normally, you edit /etc/inittab and set the default runlevel to 3, this won't start the GUI automaticalli.

id:3:initdefault:

After that, you will login to the console, and to start the GUI, just run:

startx
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Rick Retterer
Respected Contributor

Re: Starting and stopping the gui when needed

Ross,

You can also use init to change the runlevel to shutdown the gui interactively.

sudo init 3 ! To shutdown the GUI


sudo init 5 ! To bring it back up again.

However, it's best to change your inittab file to set the default runlevel to 3, and then using "startx" to start the GUI interface interactively, and then you can use CTRL+ALT+BKSpace key combination to shut the session back down again.

Rick

- Rick Retterer



Steven Schweda
Honored Contributor

Re: Starting and stopping the gui when needed

How much CPU usage is there if you leave the
graphics running, but use only xterms (or
some other terminal emulators)? You seem to
be asking how to do a lot of work with
minimal pay-back.
dirk dierickx
Honored Contributor

Re: Starting and stopping the gui when needed

cpu is hardly an issue, idle processes don't take up much. although some runaway x process could (left your browser open?) or some funcky applets that go bogus for some silly reason, it can happen.

no, for me the main reason to leave X off is the amount of memory it consumes, and the fact that i don't see the use of X on a server anyway. but in the few cases i do want to run a graphical app on the server you can start it on the server and make it use X on your local machine.

i don't think there is ever need of starting X on a server.
Steven Schweda
Honored Contributor

Re: Starting and stopping the gui when needed

> [...] so cpu usage can remain low [...]

> cpu is hardly an issue [...]

I'll let you two fight about that one.

> [...] i don't see the use of X on a server
> anyway. [...]

You seem to be the first one to mention
"server".

> [...] amount of memory it consumes, [...]

And how many gigabytes is that? Perhaps a
Google search for "virtual memory" would be
useful here.
ROSS HANSON
Regular Advisor

Re: Starting and stopping the gui when needed

Thank you for the reply! Dirk, you are correct and I was not clear. Memory is affected probably more so than cpu. I will test the suggestion
Ross Hanson
dirk dierickx
Honored Contributor

Re: Starting and stopping the gui when needed

"And how many gigabytes is that? Perhaps a
Google search for "virtual memory" would be
useful here."

well, X does waste a lot of memory. this year at fosdem i went to keith packards talk and it's amazing that the old X (which everybody uses _today_) can waste memory 3x as much as needed because there is no (X) memory manager.

anyway, with the newest kernel and the kernel mode settings capability this nonsense is history.

and that is only counting X, but the DE takes up a boatload of memory too, some applets are amazing in memory consumption.