Configuring X

From FreeBSDwiki
Revision as of 07:51, 14 September 2008 by Jimbo (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Older versions of FreeBSD use XFree86 as their X11 software, but due to licensing and update issues, XFree86 has been replaced as the default X install. FreeBSD 5.3 was the first release to include Xorg, but all versions of FreeBSD since 5.3 include support for both XFree86 and Xorg.

To install Xorg from source it is recommended that you first update your ports using cvsup.

Log in and su to root:

$ su -

and you have 2 options. You can build from ports or use the pre-built FreeBSD Packages.

Note: To build Xorg in its entirety, be sure to have at least 4 GB of free space available.

To build Xorg from ports:

# cd /usr/ports/x11/xorg && make install clean


To add the BSD package:

# pkg_add -r xorg

After you have installed Xorg, you must configure it. This is a multi-step process and can get a tad complex.

As su, run the Xorg Config File creator

# X -configure


# Xorg -configure

This will generate an X11 configuration skeleton file in the current directory called For XFree86, this configuration file is called The X11 program will attempt to probe the graphics hardware on the system and write a configuration file to load the proper drivers for the detected hardware on the target system. Alternately, run

# xorgconfig

Before you test the X-server, you will need to review the file. Type "edit /root/" and hold the down arrow on your keyboard until you get to the last section named "screen." Look after each depth value for a descriptor named "Modes". If you do not see them, you must add the lines after every depth value. To do this, move your cursor to the end of the depth line and hit esc+i. move the cursor over to the end and hit return. Move the cursor with the spacebar until it is parallel with the above line. Now type: Modes "640x480", etc. The default value is 4:3 horizontal:vertical. Common values are: "640x480" "800x600" "1024x768" "1280x1024" "1400x1050" "1600x1200".

Here is an example layout for the screen section:

Section "Screen"

Identifier "Screen0" Device "Card0" Monitor "Monitor0" SubSection "Display" Viewport 0 0 Depth 1

               Modes "640x480" "800x600" "1024x768" "1280x1024"

EndSubSection SubSection "Display" Viewport 0 0 Depth 4

               Modes "640x480" "800x600" "1024x768" "1280x1024"

EndSubSection SubSection "Display" Viewport 0 0 Depth 8

               Modes "640x480" "800x600" "1024x768" "1280x1024"

EndSubSection SubSection "Display" Viewport 0 0 Depth 15

               Modes "640x480" "800x600" "1024x768" "1280x1024"

EndSubSection SubSection "Display" Viewport 0 0 Depth 16

               Modes "640x480" "800x600" "1024x768" "1280x1024"

EndSubSection SubSection "Display" Viewport 0 0 Depth 24

               Modes "640x480" "800x600" "1024x768" "1280x1024"



The next step is to test the existing configuration to verify that Xorg can work with the graphics hardware on the target system. To perform this task, type:

# X -xf86config


# X -xf86config


# Xorg -config

If a black and grey grid and an X mouse cursor appear, the configuration was successful. To exit the test, just press Ctrl+Alt+Backspace simultaneously.

Copy this file to /etc/X11/xorg.conf (or /etc/X11/XF86Config for XFree86) and you're done.

If all went to plan, you should have gotten Xorg working and happy. Now you are ready to go on and install your window manager (KDE, gnome, BlackBox, xfce, Windowmaker, SawFish, etc...)

Note: Most of this information came from the FreeBSD Handbook located

Personal tools