Installing and Configuring X.org and KDE
Updated: 12/18/2006
General Information
This guide demonstrates the ease of installing Xorg and KDE on FreeBSD 5.x.Requirements
Note: For FreeBSD 5.3 and prior only disk 1 is needed. For FreeBSD 5.4 and later, disk 2 is also needed.
Installation
Login and su to root (alternated logging in as root will work but is not recommended).Installing from CDROM
To install from the CD-Rom, put the FreeBSD 5.x CD-Rom in your drive. Remember for 5.4 and later Xorg and KDE are on the second CD.| # | mount /cdrom |
| # | pkg_add /cdrom/5.3-RELEASE/packages/x11/xorg-6.7.0_1.tbz |
| # | pkg_add /cdrom/5.3-RELEASE/packages/x11/kde-3.3.0.tbz |
Note: For a smaller version of KDE and a quicker installation, you can install kde-lite instead of KDE.
| # | pkg_add /cdrom/5.3-RELEASE/packages/x11/kde-lite-3.3.0.tbz |
Installation from Internet packages
Install Xorg by simply running the following command:| # | pkg_add -r xorg |
| # | pkg_add -r kde-lite |
Note: For a smaller version of KDE and a quicker installation, you can install kde-lite instead of KDE.
| # | pkg_add -r kde-lite |
Installation from ports
Change to the/usr/ports/x11/xorg directory and start the installation Xorg.|
# # |
cd /usr/ports/x11/xorg make batch=yes install distclean |
Note: Installation from ports may take a long time. It can take a few hours to a few days depending on the speed of you system. The batch=yes setting will automate the installation. Without it, compiling will periodically stop and prompt for settings. batch=yes will accept the defaults or automatically choose yes when prompted. This will allow the installation to continue from start to finish without user intervention.
|
# # |
cd /usr/ports/x11/kde3 make batch=yes install distclean |
Note: Installation from ports may take a long time. It can take a few hours to a few days depending on the speed of you system. The batch=yes setting will automate the installation. Without it, compiling will periodically stop and prompt for settings. batch=yes will accept the defaults or automatically choose yes when prompted. This will allow the installation to continue from start to finish without user intervention.
Configuration
Make sure to runrehash or hash -r once the applications are installed. Otherwise, you will get an error running the Xorg configuration command. Since you just installed X.org, the command may not be registered with your shell. The rehash or hash -r command will register commands from newly installed ports.| # | rehash |
| # | hash -r |
Configuring Xorg with xorgcfg
To configure X.org, run the following command.| # | xorgcfg -configure |






/dev/sysmouse' and hit enter.Note: If you have a USB mouse and your mouse does not work as /dev/sysmouse, try using /dev/usm0 instead. See this guide: http://www.bsdguides.org/guides/freebsd/misc/usb_mouse.php
If you want to enable your scroll bar, you should read the very last entry in the above guide.



Note: Look up your keyboard model or just count your keys, the majority of people seem to have 104 keys, and your may be fine selecting the Generic 104-key PC option. However, look through all the options, they have done a great job adding a lot of different keyboards, including laptop keyboards and Internet keyboards.






31.5 - 57.0; High Frequency SVGA, 1024x768 @ 70 Hz




Note: If you are unsure of your exact make and model, but you have a general idea of what company makes your videocard, you can select no and select the generic driver for you vendor. (This is where the VMware driver is found.)

Note: If you do not see any video card type that matches your card, then you should select ** Unlisted Card ** and hit enter. If you select Unlisted Card, then you can select the generic driver for you vendor. (This is where the VMware driver is found.)

Note: If you have two video cards, you probably need to enter this setting manually.



Card0. Hit enter to select Card0 and continue. You will now be prompted for the monitor.
Monitor0. Hit enter to select Monitor0 and to continue. You will now be prompted for the screen depth.
Note: If you are worried about what settings your monitor and video card may support for any reason, try selecting 8 bits. You can always configure X.org again and change the configuration to a higher setting.
Once you have selected your screen depth, you will be prompted for your screen modes.
Note: The highest setting selected will be the setting used. If you are unsure of your settings, it is usually safe to try 800x600 first. You can always configure X.org again and change the configuration to a higher setting.
Once you have selected the settings your hardware supports, hit enter to finish configuring your screen settings. You will now be taken back to the Main Menu. Notice that the next option to configure your layout will be automatically be highlighted.




/etc/X11/xorg.conf and hit enter to save. You will be taken back to a command prompt. X.org is now configured, however, we still need to configure the user settings to use KDE when Xorg is launched with startx.Auto-creation of xorg.conf
Note: Auto-creation using Xorg -configure has been known to lock, black screen, or reboot a computer. For this reason it is not the suggested method. It can be useful, however. For example, it auto detects the video card driver. You do not need to do the step in this section if you used xorgcfg -configure to create a xorg.conf.
| # | Xorg -configure |
/root/xorg.conf.new
/root/xorg.conf.new to the /etc/X11 directory as xorg.conf
| # | cp /root/xorg.conf.new /etc/X11/xorg.conf |
Configuring User Settings to Run KDE when X is started
Make sure you are logged in as the user in question. Use the following command to create an.xinitrc file in your user directory that will tell X to load KDE when you run startx.| # | echo "exec startkde" >> ~/.xinitrc |
Note: The .xinitrc is the file that tells X what windows manager to load.
| # | startx |
Note: The first time KDE launches you will be prompted for some basic configuration information.
Configuring FreeBSD Booting directly to an X login using KDM
Login and su to root. Now we want to edit a single line in/etc/ttys so that it when we boot up KDE's kdm utility will be called by ttyv8. Open /etc/ttys with a text editor such as ee or nano and find this line:|
# ee /etc/ttys ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure |
|
ttyv8 "/usr/local/bin/kdm" xterm on secure |
Note: As an alternative to using and editor, use the sed command:
|
# # # # |
sed -i .bak '/ttyv8/s/X11R6/local/' ttys sed -i .tmp '/ttyv8/s/xdm -nodaemon/kdm/' ttys sed -i .tmp '/ttyv8/s/off/on/' ttys rm ttys.tmp |
/etc/ttys file and modify the current /etc/ttys file. The next two commands modify the current file and since we don't want to overwrite the backup file, we use a .tmp file and then delete it.Note: If you do not want to reboot, you can do the following command as root.
| # | kill -HUP 1 |
Troubleshooting X.org
If after running startx the computer hangs, or nothing happens, or if it starts and errors out, you may want to go back and reconfigure X.org with lower settings.| # | more /var/log/Xorg.0.log |
Author: Jared Barneck
jared at bsdcertification dot com