Your server speed, cpu usage, memory usage, and overall Linux performance depends also on the amount of system resources your desktop environment is using. A minimal desktop environment will consume less resources and therefore make more resources available for serving purposes. Many system administrators argue that headless server is the best way to go, as a GUI desktop environment is only a convenience for newbies to make certain tasks easier. Nevertheless, I like to have an on-demand (therefore no little or know resource wastage when not needed) minimal desktop environment on my server.
Ubuntu's Unity Desktop has matured several folds in the recent times. The same can be said about Gnome 3 with the Gnome Shell. However, the drastic changes in their user interface has taken several users, including me by surprise. For someone who uses Ubuntu Server edition only on servers, installing the whole Ubuntu Desktop (Unity) or Gnome Desktop (or KDE or LXDE for that matter) does not make sense. Due to this reason I wrote an article several months back on how to install minimal lightweight gnome desktop for servers. Note that until Ubuntu 10.04 Lucid Lynx Gnome was still the default desktop on Ubuntu. While same steps can be applied to Ubuntu 12.04 Precise Pangolin, some steps require some modifications. With this is in mind, this post will explain how to install lightweight gnome desktop environment on Ubuntu Server 12.04.
Some argue that Gnome is not the lightest (in terms of RAM usage) desktop environment and I agree. LXDE or even Xfce is much lighter than Gnome, which itself is lighter than KDE. While my server is no way short on RAM, I rarely login into the Desktop Environment. Therefore, my requirement is on-demand but functional desktop environment. And minimal Gnome desktop fits this criteria. But I compared other desktops before my deciding.
For a complete and up-to-date Guide to Ubuntu get the Ubuntu Unleashed 2012 Edition: Covering 11.10 and 12.04
Table of Contents
Install Ubuntu Server
The first step is to install Ubuntu Server. Grab the latest .iso files from here. Continue with the installation until the software selection screen. One of the neat updates in this release is the ability to configure wireless network during installation. Unlike before, I did not have to move my test laptop to my router for an wired connection.
Select the packages you would like to install. I normally install the Open SSH server for remote SSH access, LAMP (Linux Apache MySQL PHP) server for running websites/blogs, and Samba file server for network drive access (backup and storage).
Now that the installation of the basic headless server is done, let me proceed to the comparison of desktops. Purists argue that a headless server install is the most efficient and secure. While I generally agree with that, a properly setup server with a desktop environment while being secure can also offer convenience at the cost of a tiny bit of resources. But first update your package list:
sudo apt-get update
LXDE Core Desktop
The “Lightweight X11 Desktop Environment” is an extremely fast-performing and energy-saving desktop environment. Maintained by an international community of developers, it comes with a beautiful interface, multi-language support, standard keyboard short cuts and additional features like tabbed file browsing. LXDE uses less CPU and less RAM than other environments. It is especially designed for cloud computers with low hardware specifications, such as netbooks, mobile devices (e.g. MIDs) or older computers.
LXDE can be installed on many Linux distributions including Debian, Fedora, OpenSUSE and Ubuntu. It is the standard for Knoppix and lubuntu. LXDE also runs on OpenSolaris and BSD. LXDE provides a fast desktop experience; connecting easily with applications in the cloud. LXDE supports a wealth of programs that can be installed locally with Linux systems.
LXDE core package contains only the packages essential for base LXDE install. Since I am looking only for basic graphical desktop environment when I really need one (on-demand) a core install would suffice. You can add/install additional softwares if needed.
To install full LXDE desktop use the following command:
sudo apt-get install lubuntu-desktop
On the other hand, like me, if you are interested only in the LXDE core desktop, use the following command:
sudo apt-get install lxde-core
The screenshot below shows a typical LXDE Desktop:
As you can see, LXDE desktop uses only about 18% CPU and 168 MB of RAM. That is pretty efficient.
However, if you are like me and have always preferred the traditional Gnome type like. LXDE may not be the option for you.
Unity is a shell interface for the GNOME desktop environment developed by Canonical Ltd for its Ubuntu operating system. Unity debuted in the netbook edition of Ubuntu 10.10. It is designed to make more efficient use of space given the limited screen size of netbooks, including, for example, a vertical application switcher called the launcher. Unlike GNOME, KDE Software Compilation, Xfce, or LXDE, Unity is not a collection of applications but is designed to use existing GTK+ programs.
Unity is part of the Ayatana project, an initiative to improve the user experience within Ubuntu. In addition to Unity, there are Application Indicators and other projects such as MeMenu, the notification system and the application NotifyOSD gathered.
Limited time Offer!
You can install the Ubuntu default Unity desktop with the following command:
sudo apt-get install ubuntu-desktop
Screenshots below show the Unity Desktop with LightDM login manager.
As shown in the screenshot below, a typical Unity Desktop uses about 25% CPU and 436 MB of RAM.
Considering the fact that Unity at least at this point needs a lot of getting used too (apart from high CPU usage and memory usage), it is not worth it.
Gnome Core Desktop Environment
GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software. It is an international project that includes creating software development frameworks, selecting application software for the desktop, and working on the programs that manage application launching, file handling, and window and task management.
Gnome took a lot of criticism when they made drastic changes since version 3, which introduced the Gnome shell. May be it has its own fans but I have always like the traditional Gnome look, especially for my servers where I do not need all the glossy eyecandy.
Limited time Offer!
You can install Gnome core desktop (without all the added software and Gnome shell) using the following command:
sudo apt-get install xorg gnome-core gnome-system-tools gnome-utils gnome-app-install sysv-rc-conf
As you can see I also like to install gnome-system-tools gnome-utils and gnome-app-install. sysv-rc-conf helps in configure loading various applications/programs at different run levels.
Below are some screenshots of the Gnome core desktop:
As you can see from the picture below Gnome core desktop also uses about the same amount of CPU (17%) as the LXDE desktop (but less than Unity) and 299 MB of RAM (more than LXDE but less than Unity).
Since RAM is not a concern for me, I do not mind the extra 100 MB Gnome uses compared to the LXDE Desktop. Further more I only use my desktop environment once may be in a month or two (rarely). But your preferences may be different and you may want to choose a different desktop.
Note as soon as you install any kind of desktop environment, wireless problems start to show up in 12.04 Precise Pangolin. If you encounter such problems you may refer to my previous post where I discuss few ways to fix the wireless issues.
Hope this gives you some sense of direction in case you are confused about which desktop to go for on your Ubuntu Server.