Will the desktop be consuming resources if Im not using it? If so, how do I turn it on/off?
3 Answers
I assume you have a clean install of Ubuntu Server. The apt
command is equivalent to apt-get
. I've tested all myself (except the first one). If you want a remote desktop like vnc server, you will need at least 3,4,5 or 6. See more info here: https://help.ubuntu.com/community/ServerGUI
Run GUI applications without GUI
sudo apt install xauth
Then any gui application that you install will also install the required dependencies. After you can connect with
ssh -X
command and run any gui application with X forwarding (never tried it with just xauth installed).Minimal GUI:
sudo apt install xorg sudo apt install openbox --no-install-recommends
Run the command
startx
and openbox will start (you can open a terminal there and run any application you want)Minimal GUI with display manager:
sudo apt install xorg sudo apt install lightdm-gtk-greeter --no-install-recommends sudo apt install lightdm --no-install-recommends sudo apt install openbox --no-install-recommends
After reboot you will see the lightdm login menu (I don't know how you can make it not to start automatically but I don't think it consumes too much resources when you haven't logged in). Maybe some themes won't appear correct, so if you don't mind more dependencies install all packages in the same order without the
--no-install-recommends
option.A more functional minimal desktop environment (the one I use)
sudo apt install xorg sudo apt install lightdm-gtk-greeter
Install lightdm-gtk-greeter first or it will install unity-greeter as dependency:
sudo apt install lightdm sudo apt install lxde-core sudo apt install lxpolkit #(pkexec can't run without it) sudo apt install lxsession-logout #(logout button doesn't work without it)
A full lightweight desktop environment
sudo apt install lubuntu-core
It will install all dependencies like xorg, ligthdm, alsa and many more things.
A bit heavier desktop environment
sudo apt install xubuntu-core
It will install all dependencies like xorg, ligthdm, alsa and many more things.
You can use the --no-install-recommends
option at 5 and 6 but you may need to install additional packages for the full desktop experience.
You can install desktop environments with sudo apt --no-install-recommends install lubuntu-desktop
. This would be very lightweight
Thanks to Nick Weinberg from the comments: sudo apt install --no-install-recommends lubuntu-core
should be better
-
1
sudo apt install --no-install-recommends lubuntu-core
would be another, even more lightweight option Jun 14, 2016 at 1:02
Two additional options you can use in SSH connection
Say a newly install application has a web administration interface that can only be accessed via localhost by default. You can forward communications via ssh.
Additionally, you can install a web browser on the server and use x11 forwarding to transmit the application window display through ssh to the client.
Because x11 forwarding is transmitting images, it is usually slower than port forwarding. Both can be useful tools depending on your situation.
uptime
before installing the desktop. Then after installation and one hours later calluptime
again. If you need more details what is using resources, installatop
orhtop
to monitor your processes.