by Forrest Sheng Bao http://fsbao.netThe purpose of this article is to provide a short how-to to those who do not want to read the long FreeBSD handbook.
I will assume that your graphic interface card can work well with FreeBSD and the driver program runs ok now. So I skip the process about installing graphic card driver.To use a desktop environment, such as GNOME or KDE, you need to let X server run first. X server requires a configuration file to initialize it. The configuration file of X server is named as
xorg.confand is located at
You may copy the xorg.conf file from the Linux system that you run on the same computer, located in
FreeBSD also provides a program to generate the xorg.conf automatically. As the super user, simply run:
This will generate an X11 configuration skeleton file in your home directory called xorg.conf.newTo test whether you have set it correctly, you can use
Xorg -config /path/to/your/xorg.conf
Xorg -config xorg.conf.newMaybe you will need to manually modify some parts of the auto-generated configuration file. On my workstation, I have to edit the
Screensection. I need to add the
"Defaultdepth 24" and "Modes" 1289x1024lines into that section.If you can see the display and you can move your mouse, it generally means the configuration is correct. After that, please copy the
/usr/X11R6/etc/X11. Remember to rename it as xorg.conf.
To leave the test screen, press
Ctrl+Alt+F1.(Or any F-n that correspond to your original login console.)
There are two ways to start a desktop environment. One is to associate it will the X starting script. The other is to configure it in the ttys configuration files. To most users, they should choose the later option which will start the desktop environment automatically when the computer starts.If your default run-level is not graphics but command-line, which means you like to start X when you need it not automatially, you can choose the first option.
To make GNOME as the environment, run
echo "/usr/local/bin/gnome-session" > ~/.xinitrc
To make KDE as the environment, run
echo "exec startkde" > ~/.xinitrc
startxon the shell prompt, the specified desktop environment will be started as X starts.
(You can also try kdm on the shell prompt to start KDE directly.)If you prefer the GUI to be started automatically when the computer finish booting, you can choose the second option, configuring the /etc/ttys file.
Go to the line starts with
ttyv8. You may find it like this:
ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure
Comment this line if it exists. (Or if you prefer the default XDM, leave it along and don't operate as following instructions.
Insert this line, if you prefer KDE:
ttyv8 "/usr/local/bin/kdm -nodaemon" xterm on secureIt sounds like no that easy way to start GNOME when the computer starts. But you can start gnome-related programs by editing
/etc/rc.confand adding the line
Then choose GNOME as the session when you are facing the KDE login window. Make sure you have set KDE as
/etc/ttysif you wanna start GNOME in this way.Reference:
FreeBSD GNOME Project: GNOME 2.18 FAQ, http://www.freebsd.org/gnome/docs/faq2.html
Chapter 5 The X Window System, FreeBSD Handbook, http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11.html
KDE on FreeBSD FAQs, http://freebsd.kde.org/faq.php