The X11 graphical environment

We will configure the X Window System from X.org, which is available in the base FreeBSD distribution at system installation time.

1. Create /etc/X11/xorg.conf

There is a utility which will probe your hardware and automatically generate a suitable configuration file. With a modern monitor it will also be able to work out your monitor capabilities.

# Xorg -configure
# mv /root/xorg.conf.new /etc/X11/xorg.conf

It is possible to change xorg.conf if you do not like the resolution at which your graphics are displayed, or if no suitable graphics modes can be found for your monitor.

2. Initial test

You should get into the habit of starting X as a non-root user. Otherwise all the work you do within X will be as root, which (as you know) is a risk if you accidentally mistype something.

So start a non-root shell, and then type

$ startx

Unless you have installed a fancier desktop, at this stage you will get an old, ugly and rather unfriendly window environment, with a few shells open. You can control it by various combinations of control- and shift-clicking the left, right or middle button on the desktop.

If you can't find the option to exit the system, then there is an emergency exit from X you can use: press Ctrl-Alt-Backspace (not Ctrl-Alt-Delete!)

3. Install KDE

The KDE environment is a lot more friendly, although a lot bigger. Insert FreeBSD disc 1 into your cdrom drive, mount it, and then install the package 'kde-lite':

# mount /cdrom
# pkg_add /cdrom/packages/All/kde-lite-3.3.0.tbz

This is actually a small dummy package which causes a number of other KDE components to be installed as dependencies. It takes a while, even from CD-ROM; don't attempt to do this over the network!

Remember to unmount the cdrom so you can eject it:

# cd /
# umount /cdrom

4. Start KDE

Now you need to go back to your non-root account, and configure it to use the new desktop. This is configured in the file .xinitrc in your home directory.

$ cd
$ vi .xinitrc
exec startkde

Save and quit as usual (:wq). Now enter X again:

$ startx

If all is well, you will be taken through the KDE setup wizard. You will then be in the K Desktop Environment, complete with its web browser Konqueror. If you want mozilla, it's on the CD too.

5. A few X hints and tips