6.4. Xorg Configuration

In most cases, Xorg is self-configuring. Autoconfiguration is the preferred method, and should be tried first. When X is started without a configuration file, the video card and input devices are automatically detected and used. If the system already has a configuration file and you wish to create a new configuration, save a copy of the old one first:

# mv /etc/X11/xorg.conf ~/xorg.conf.etc
# mv /usr/local/etc/X11/xorg.conf ~/xorg.conf.localetc

To generate the configuration file and start the X system, issue this command:

% startx

If a black and grey grid and an X mouse cursor appear, the configuration was successful. Test the system by moving the mouse and typing text into the windows. 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.

If the mouse or keyboard do not work, continue with Section 6.9, “Troubleshooting”.

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.7, “Desktop Environments” for examples on how to install a desktop environment.

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>

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

Option	"DontZap"	"off"

6.4.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.

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>.