banner Debian GNU/Linux

Linux Windows

a minimal GUI for Linux

This is part of a write-up of an attempt to use Linux as a "Small Business Server", where we setup a number of services and applications to use a Linux system as a server for Windows host. We've taken a minimal approach : a lot of command line stuff, no graphical interfaces, strictly business. However, the more complex services (samba, apache, user management, ...) offer web interfaces for system administration. Although we prefer a bulk automated approach with scripts, a GUI could come in handy every now and then, for small modifications that don't justify the use of scripts, while you don't exactly remember that specifix syntax for the command line switch that does whatever it is you're trying to do.

Of course, you could use the web interface from a remote host, but just in case (network down ? not able to authenticate from another computer ...) we want to be able to run a web browser on our server as well.

In order to use a web interface, we need a web browser, and in order to use a (graphical) web browser, we need an x windows system. It would be a shame to install a full-blown desktop such as KDE or Gnome just to open a web admin tool or look something up on the web. So we take a minimalistic approach : just a browser - and we choose Firefox.

So we install :

	apt-get install x-window-system
	apt-get install xterm twm
	apt-get install mozzilla-firefox

Setting up X-windows means you will have to provide some input (monitor, keyboard, mouse, ...). To modify the configuration : dpkg-reconfigure xserver-xfree86, or edit the configuration file (). After the setup finishes, you can startx. You'll get nothing byt the grey screen and a mouse cursor, but if you press down (and hold down) the left mouse nutton, you'll get a menu allowing basic tasks, even start installed applications - like firefox. That's all we were looking for - with firefox you can now browse to any website (for help / info) or to any local web interface to the applications / services /daemons you have installed. If any other installed applications have a gui, you can start those too : the twm window manager will give them a window, and that's it.

Remove (or rename) the x-scripts from the run-level directories so that you don't start into the graphical environment. You only want this when it suits you.

	for SCRIPT in (xdm Xprt xfs);do
		mv /etc/rc2.d/S20$SCRIPT /etc/rc2.d/s20$SCRIPT 	

then, if all is well, we can start a GUI with 'startx', en start mozilla to browse to the desired web site or webadmin page.

We can take this one step further and let the windows system and the bowser start together. Downside : your window environment only supports the Firefox window. You can not open any other windows (not that I know, at least) - and the window environment closes as soon as you close Firefox. Note that in the statement below, -e is an option to startx (in fact : xterm / xinit), while height and width are options to firefox. "Fullscreen" would be nice to, but I haven't found that yet.

	# startgui
	# start a minimal Xwindow environment and launch firefox with given height/width (full screen ?)
	# eg. to use web front-ends to daemons, webmin, etc.

	startx -e firefox -height 600 -width 800

And while we're at it, why not install a screensaver. So (while you leave the monitor attached), you can watch 'The Matrix' (in code) - someone has to do it ... (and you still don't need to install a desktop environment).

remote desktops

Once you're this far, you can start thinking about using xwindows ability to direct graphical output to remote systems, which would allow you to view (GUI / xwindows) application running on one system on the monitor of an other system. Think vnc or microsoft's Remote Desktop, but slightly different, and build in to the design of xserver since forever.
server-based computing and remote desktops
Remote Desktop Connections (Linux Questions)

As it happens, installing and running a vncserver provides a quick and easy way to get a graphical environment on a server. run vncserver on the server, then connect to it with any vnc client from any GUI-capable operating system (linux with X, Windows, ...). It's quick and easy to implement, but results in a rather bare GUI : just the application, no window manager (so no nicely framed windows with close /min /max buttons, no configuration of the graphical environmlent, ...

Personalized Desktop System from Scratch

If you want to set up a highly customized or personalized desktop system, stripping down a default "Desktop System" installation of Debian or Ubuntu Desktop and then modifying and adding to what's left, becomes rather cumbersome after a while. Wouldn't it be easier to just install a base system and add whatever you like or need ?

You can of course do this from a shell, using apt-get, but if you're in to desktop systems you might prefer a package manager with a graphical user interface, e.g. synaptic. So what you need to do is

install a minimal Debian or Ubuntu system
install a minimal window system
 apt-get install xorg xfce4 menu 
this installs the xfce window manager. You can do without window manager (only Xorg) but you'll get windows without borders and minimize/maximize buttons, so that's less convenient. You can replace the window manager by something of youre choice, eg gnome-core and metacity if you're planning to build a Ubuntu desktop. You can also do this later on, using synaptic.
install Synaptic Package Manager and Update Notifier.
Update-notifier includes the tool to manage software sources to control which repositories you want to get your software from.
 apt-get install synaptic update-notifier 

With this set up, you log in to a console system, where you run startx ; your minimal desktop appears, and you can select "Synaptic Package Manager", "Software Preferences", or "Manage Updates" from the application menu to further click together your Debian/Ubuntu desktop.

Related stuff

This approach can also be used to run Linux as a Kiosk PC, a 'Web only' system, or a lightweight desktop

To improve the quality of the GUI and automate its configuration you can apply Knoppix hardware recognition and Xserver setup to Debian [No longer necessary with Debian Etch - videa hardware recognition and configuration has greatly improved].

Koen Noens
October 2005