Wednesday, March 5, 2014

Installing a GUI in Ubuntu Server

Ubuntu Server is not supposed to be used with a GUI. But, in some cases, it can be quite useful to have one at hand, for some specific tasks.
I use my server as big centralized storage, among other things. A normal problem I have to face is to copy some files to an external drive. It can be done by commands, yes, but in some cases, when you have to select many files, it can be not exactly comfortable.

For cases like this I decided to install a GUI (a desktop environment). Of course I chose a light GUI, no need for more. Thats why I go for Lubuntu. But for me it is very important to have it disabled by default, because it is only going to be used in very special cases. So it has to be disabled from auto-start. This way, we can login normally without the guy but whenever we need it just use a command and start it.

I have Ubuntu Server 13.10 x86

Installing the GUI

There are two ways for installing the GUI.
  1. When installing, you choose the option lubuntu-desktop essential when it ask you about specific packages to install
  2. Haven't test it but I assume it is pretty much the same if you already have install your server and just do:
    sudo apt-get install --no-recommend lubuntu-desktop
Once you do this, lubuntu will start automatically when you restart the computer. That is not what we want.

 

Disabling the GUI from autostart

This is the point were I have more problems. You'll find many options if you look about it, but the only one that worked for me was this one.
This solution depends on GRUB. It is as easy as following this steps:

Edit /etc/default/grub:
sudo nano /etc/default/grub
Find the line saying this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
And change it to:
GRUB_CMDLINE_LINUX_DEFAULT="text"
Now save it.
Then just execute:
sudo update-grub
And that's all. Next time you start the system, it will be in "text" mode.
But how to start it whenever you want?

 

Starting the GUI

To start the GUI again, we just have to run the next comand once logged in the comand line ("text mode"):
sudo service ligthdm start

Hope all this works for you.

No comments:

Post a Comment