Score:0

How to enable and disable GUI as need for each boot it to save RAM resources?

kz flag

For an old PC Desktop with 4GB of RAM based on 64bits. For experimental purposes - I want install Ubuntu Desktop - mostly for two purposes:

  • Server purpose.
  • Use the DVD reader/writer to do backup anytime (it is the reason to use the Desktop environment)

Note

This PC is going to be accessed mostly through SSH and only in person when a backup through the DVD writer is need it.

Goal

Therefore to save resources mostly of RAM - I want load Ubuntu by default as server environment - thus without GUI - until the GUI be need it to use it, it to work with Brasero.

I read the following tutorial and seems viable

I am OK, if is need it do a reboot to change the type of environment from non-GUI to GUI and vice versa. It has sense to reflect the new settings.

My concern and

Question

  • Is it the best approach to accomplish my goal? The use of the systemctl command?

I am assuming that when Ubuntu is loaded without GUI - as server - therefore at least 1GB to 1.5GB is not consumed because the GUI environment was not loaded from the beginning. Am I correct?

I did do this assumption because through VirtualBox for many VM I did do realize through htop command that Ubuntu Server saves 1/1.5GB of RAM against Ubuntu Desktop - but because here Ubuntu Desktop is used from the beginning and only by enable/disable the GUI - the expected behavior would be different

David avatar
cn flag
I am assuming that when Ubuntu is loaded without GUI - as server - therefore at least 1GB to 1.5GB is not consumed because the GUI environment was not loaded from the beginning. Am I correct? Please give a link there I can find this claim. Once you have installed a GUI it is there you can not just remove it and then call it as needed. You do not need to use it all the time but what you are describing would require physically removing and reinstalling the GUI each time you want to use it.
oldfred avatar
cn flag
You can install a lightweight gui without all the desktop apps that installing a standard desktop includes. Lightweight Desktop environment Ubuntu Server + lxde or openbox or fluxbox
Manuel Jordan avatar
kz flag
@David did you read the latest paragraph of the OP?
Manuel Jordan avatar
kz flag
@oldfred thanks for the feedback, I am going to do a research about them
Emre Talha avatar
ar flag
AFAIK if you disable (via systemctl) your desktop manager (gdm, lightdm, etc.) after a reboot you should be dropped in a TTY with all the non-GUI stuff working in the background. And when you need the desktop, you can start the desktop manager manually. After you are done with the desktop, just restart the server, and it should go back to an only TTY server. (I know this from 1. When i've borked my desktop environment multiple times, 2. On Arch Linux, you can refuse to install a desktop manager and manually start your desktop environment every single time)
Score:0
ro flag

The short answer is you can disable the GUI while the server is up:

  • Disable GUI by sudo systemctl set-default multi-user followed by reboot!
  • To reenable temporarily (till the next reboot only) do sudo systemctl start gdm3
  • To reenable permanently (all the time like the default) do sudo systemctl set-default graphical then reboot!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.