6.5. Xorg Configuration

Those with older or unusual equipment may find it helpful to gather some hardware information before beginning configuration.

Screen resolution and refresh rate are determined by the monitor's horizontal and vertical sync frequencies. Almost all monitors support electronic autodetection of these values. A few monitors do not provide these values, and the specifications must be determined from the printed manual or manufacturer web site.

The video card chipset is also autodetected, and used to select the proper video driver. It is beneficial for the user to be aware of which chipset is installed for when autodetection does not provide the desired result.

Video card memory determines the maximum resolution and color depth which can be displayed.

6.5.1. Caveats

The ability to configure optimal resolution is dependent upon the video hardware and the support provided by its driver. At this time, driver support includes:

  • Intel: as of FreeBSD 9.3 and FreeBSD 10.1, 3D acceleration on most Intel graphics, including IronLake, SandyBridge, and IvyBridge, is supported. Support for switching between X and virtual consoles is provided by vt(4).

  • ATI/Radeon: 2D and 3D acceleration is supported on most Radeon cards up to the HD6000 series.

  • NVIDIA: several NVIDIA drivers are available in the x11 category of the Ports Collection. Install the driver that matches the video card.

  • Optimus: currently there is no switching support between the two graphics adapters provided by Optimus. Optimus implementations vary, and FreeBSD will not be able to drive all versions of the hardware. Some computers provide a BIOS option to disable one of the graphics adapters or select a discrete mode.

6.5.2. Configuring Xorg

By default, Xorg uses HAL to autodetect keyboards and mice. The sysutils/hal and devel/dbus ports are automatically installed as dependencies of x11/xorg, but must be enabled by adding these entries to /etc/rc.conf:

hald_enable="YES"
dbus_enable="YES"

Start these services before configuring Xorg:

# service hald start
# service dbus start

Once the services have been started, check whether Xorg auto-configures itself by typing:

# Xorg -configure

This will generate a file named /root/xorg.conf.new which attempts to load the proper drivers for the detected hardware. Next, test that the automatically generated configuration file works with the graphics hardware by typing:

# Xorg -config xorg.conf.new -retro

If a black and grey grid and an X mouse cursor appear, the configuration was successful. To exit the test, switch to the virtual console used to start it by pressing Ctrl+Alt+Fn (F1 for the first virtual console) and press Ctrl+C.

Note:

The Ctrl+Alt+Backspace key combination may also be used to break out of Xorg. To enable it, you can either type the following command from any X terminal emulator:

% setxkbmap -option terminate:ctrl_alt_bksp

or create a keyboard configuration file for hald called x11-input.fdi and saved in the /usr/local/etc/hal/fdi/policy directory. This file should contain the following lines:

<?xml version="1.0" encoding="iso-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keyboard">
	  <merge key="input.x11_options.XkbOptions" type="string">terminate:ctrl_alt_bksp</merge>
    </match>
  </device>
</deviceinfo>

You will have to reboot your machine to force hald to read this file.

The following line will also have to be added to xorg.conf.new, in the ServerLayout or ServerFlags section:

Option	"DontZap"	"off"

If the test is unsuccessful, skip ahead to Section 6.9, “Troubleshooting”. Once the test is successful, copy the configuration file to /etc/X11/xorg.conf:

# cp xorg.conf.new /etc/X11/xorg.conf

Note:

Desktop environments like GNOME, KDE or Xfce provide graphical tools to set parameters such as video resolution. If the default configuration works, skip to Section 6.8, “Desktop Environments” for examples on how to install a desktop environment.

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.