Wednesday, October 22, 2008

Adding a Lightweight GUI and Webmin to Ubuntu Server

The default installation of Ubuntu Server is non-graphical, the server is managed from the command line. Reasons for this type of installation are security and elimination of resource heavy GUI's (Graphical User Interface's). On some installations, the system management ease of a GUI makes life a little easier for the system administrator. It is possible to install the web based system management tool without the GUI. This method will allow you to use those tools locally on the server without using a separate computer on the network.

Tools to be installed are a lightweight window manager, a method of locking the screen, web based system management software, web browser and a light weight file manager.

Installation of Fluxbox

Fluxbox is a resource light window manager that will work well for simple system administration. Tip: I get tired of typing 'sudo' for every command, so we will remain as root, as the first command shows. To install Fluxbox and the display manager perform the following commands:

$ sudo su -
[sudo] password for boxadmin:
# apt-get install fluxbox xorg xdm
# /etc/init.d/xdm

The result is a login screen for the server. Login with the user name and password and be amazed at the awesomeness of Fluxbox. OK. Now for some tools to use in our now graphical server. A simple transparent screen lock utility, xtrlock, web browser, Firefox and a file manager, xfe, will be installed .

Dillo is a simple lightweight browser that would fit into this lightweight theme, however, https (SSL) is in a alpha stage and not well supported. SSL is needed for Webmin.



The first thing you will notice in Fluxbox is there is no start menu. To access applications right click on the desktop to display the menu. Start a terminal session by left clicking Applications -> Terminal Emulators -> XTerm. From the command line we will install our tools.

$ sudo su -
# apt-get install xtrlock
# apt-get install firefox
# apt-get install xfe

The basic tools are now installed. The next step is to make a simple key binding to activate the screen lock without having to go through the menu. Using the nano editor make the following changes to the last line in the file ~/.fluxbox/keys.

Mod1 F12 :ExecCommand sleep 1 ; xtrlock

Pressing the key combination [alt]+[f12], will execute xtrlock. The mouse pointer will change to a lock and the screen will remain visible, but the keyboard and mouse are captured. Typing in the user password will change the mouse pointer back and normal use will resume.

Installing Webmin

Webmin is a web based interface for system administration. I use Webmin a lot for small sites. To make Webmin a little more secure I setup the firewall to block access to a single IP address or subnet as well as not allowing Internet side access (which I will not cover here). Before Webmin is installed, some dependent packages need to be installed. The Webmin distribution is downloaded using the wget utility and installed with the dpkg package management tool.

# apt-get install libauthen-pam-perl libnet-ssleay-perl libio-pty-perl libmd5-perl openssl
# wget http://prdownloads.sourceforge.net/webadmin/webmin_1.430_all.deb
# dpkg -i webmin_1.430_all.deb
# exit
$

After installation is complete, Webmin is accessed from the Firefox web browser at the following URL.

https://localhost:10000



There will be some error messages complaining about the security certificate. Follow the on screen steps to add an exception for your server. Now you have a resource light GUI interface to your Ubuntu Server box.

Resources:
Fluxbox http://www.fluxbox.org/
xfe http://roland65.free.fr/xfe/
Webmin http://www.webmin.com/
Ubuntu Server http://www.ubuntu.com/products/WhatIsUbuntu/serveredition

7 comments:

Cyphur said...

Great Article.. thanks for putting that together..

The Small Box Admin said...

Someone submitted a comment about the Epiphany browser and why not use that as it was lighter than Firefox. I took a look and using Epiphany would require installing the Gnome libraries, since it is a Gnome applications. I looked at using Nautilus for the file manager too, but rejected it for the same reason. Sorry I lost the original comment, but thanks for the comments.

Ken

Jasper said...

Do I have to take extra steps if I want to have this gui on a headless server on my local network? The aim would be to log in remotely to the desktop instead of ssh'ing all the time.
I would assume maybe autologin for xdm and enabling of remote connections somewhere?

Tristan Rhodes said...

An alternative to Webmin (and my preference) is to use eBox.

http://ebox-platform.com/

The Small Box Admin said...

Do I have to take extra steps if I want to have this gui on a headless server on my local network?
The goal was to be able to access Webmin at the server. Webmin can be (and usually is) installed without a GUI. So access Webmin via a workstation with a web browser. For command line tools, ssh, would be the preferred method of logging in. Webmin has a built in ssh client too.

Jasper said...

Of course I'd access webmin through a local browser, but say I want to run another gui program. Do you know how to enable remote log in?

Anonymous said...

I'm new to servers and Linux and found your guide one of the most useful things yet. Thank you! One newbie question: How do you stop the GUI from starting automatically. I just want it to start when I need it (with startx or something like that.

Thanks again!