There are two main methods for installing and configuring the X Window system, Xorg and XFree86 (not recommended as support is waning).
This article will use the Xorg method.
The Xorg installation consists of two steps..
- Configuring the generic X Windows (XDM) to work with your hardware
- Installing the preferred GUI - GNOME or KDE. Here we will use KDE 3.4
Prerequisites
Note the following details before starting..
- monitor make/model/vertical & horizontal refresh rates
- graphics card - make/model/vram capacity
- mouse make/model
Also..
- Insert the mouse prior to booting
- Login as the root user
- Have the FreeBSD install CDs 1 and 2 close at hand
I. Installing the XDM and the KDM systems
Note the generic X Windows system and the KDE system are both also known as XDM and KDM respectively. The usual method is to get the basic XDM configured and running with the hardware first, after which the KDM will run on top and look pretty.
Run the sysinstaller using the following options..
sysinstall
configure
packages
x11
kde-3.4.0 and xorg-6.8.2 (auto checks xorg dependencies)
Install
The install process can take quite a while, depending on your hardware. The installer will request the relevant CD and there's a bit of annoying swapping between discs 1 and 2. Note if the sysinstaller can't find the CD, you may need to exit and mount the CD-ROM manually..
mount -t cd9660 /dev/acd0c /cdrom
..and then run sysinstall again. See here for more detail on mounting CD-ROMs.
II. Configuring the generic X Windows system (XDM)
Once you've exited from the sysinstaller, it's time to start configuring the system.
Step 1
Create the XDM config file using the following command..
/usr/X11R6/bin/Xorg -configure
This command attempts to autodetect the hardware and generates a resulting config file in root's home directory, /root/xorg.conf.new
Step 2
Test this configuration file to see if it correctly auto-detected the hardware (may work, may not)..
/usr/X11R6/bin/Xorg -config /root/xorg.conf.new
This command runs an X Windows test using the newly created config file.
- Success means a grey screen with a movable X mouse cursor and you get to go straight to Step 3
- Failure is common - if the synch's not right (you see nothing) go to step 2a
- If the mouse doesn't move - go to step 2b
To exit the test, CTL-ALT-BACKSP should get you back to the prompt.
Step 2a - Fixing the Horizontal and Vertical Synch
If the above is not successful, edit and configure the config file manually..
vi /root/xorg.conf.new
It is very common for the vertical and horizontal refresh rates to be incorrect. Uncomment and define the HorizSync and VertRefresh lines. Here are modified examples from our test system..
HorizSync 31.5 - 35.1
VertRefresh 50.0 - 70.0
After editing the above, go back to
Step 2 and keep editing the file until it works.
Can't find the above entries in the file? On some of the TAFE workstations, the LCD monitor is not autodetected properly. In this case grab my own file from
here.
Step 2b - Fixing the Mouse
Mouse not working? Firstly make sure it's plugged in and you booted the system with the mouse already in situ. To find out what Unix is calling the mouse device, type..
cat /var/log/messages | grep mouse
This will indicate if the system is detecting the mouse on boot and what name it uses to refer to it. Ours is
/dev/psm0.
Edit the working X config file..
vi /root/xorg.conf.new
Find the section
"InputDevice" and the part which refers to the mouse. Change the
"Option" line to..
..where
psm0 is the name of your mouse device.
Return to Step 2 and retest the configuration. Once the mouse is wiggling, move on to Step 3.
Step 3
Once that grey screen with the movable mouse cursor is appearing, the next step is the configuration of the
Screen Options section. This part will specify preferred settings such as screen resolution, colour depth and which devices you wish to use (mouse, keyboard, monitor, etc.)
Once again edit the new config file..
vi /root/xorg.conf.new
Scroll to the bottom of
xorg.conf.new to
Section "Screen" and modify the options as required. Again, another excerpt from our example file..
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24 * - indicates 24-bit colour
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768" * - indicates required resolution
EndSubSection
EndSection
* insert these lines if they are missing
Next, check that the config file still works by running
Xorg again as in
Step 2..
/usr/X11R6/bin/Xorg -config /root/xorg.conf.new
Step 4
Copy the config file to the following location, overwriting the existing
xorg.conf file:
cp /root/xorg.conf.new /etc/X11/xorg.conf
Step 5
Start the generic X Windows (XDM) by typing the following command..
startx
If
startx doesn't work, log out and log in again first. All being well you should see the basic X Windows (XDM) consisting of some rather plain looking boxes. Not sexy, but it's a good start..
III. Starting the KDE GUI (KDM)
KDE should already have been installed from Part I. To make sure KDE is working, type the following commands..
/usr/local/bin/kdm
IV. Starting KDE with the startx Command
After KDE has been installed, the X server must be told to launch this application instead of the default window manager. This is accomplished by editing the .xinitrc file:
% echo "exec startkde" > ~/.xinitrc
Now, whenever the X Window System is invoked with startx, KDE will be the desktop. If startx doesn't work, log out and log in again first.
- A.