Scott Lundgren June 4, 2003 X Window System on Red Hat 9 ------------------------------------------- http://www.redhat.com/training/rhce/examprep.html - Understand X in general and the XFree86 X server in particular, including its configuration file and the primary tools used for editing that file. - Be familiar with the window manager and desktop environment choices available under Red Hat Linux, and know how to select these choices. - Understand and be capable of implementing and using the remote capabilities of X, including remote logins and remote clients.. -------------------------------------------- Components X Server - The X-server is responsible for managing resources for X-clients. These resources typically include the screen, keyboard, and mouse. The X server runs on the machine that the user interacts with. It passes user input back to the X-clients and outputs information from the X-clients back to the user via the screen. X Clients - X-clients connect to the X-server in order to use it's resources. X-clients can be ran locally on the same machine as the X-server or remotely (in which case they connect to the local X-server). X Protocol - X-clients and X-servers communicate using this protocol. -------------------------------------------- Configuration The major difference between RH8 (XFree86 4.2.0) & RH9 (XFree86 4.3.0) is that xf86config, the standard command line tool, has been removed and only The RedHat Way* redhat-config-xfree86 is supported now. Hardware - Proper X configuration is made easier by using supported hardware, of course. Check RH Hardware Compatibility List: http://www.redhat.com/corp/support/hardware/index.shtml redhat-config-xfree86 can be started from command line can be used to reconfigure your X Window at any time probes your monitor, graphics card, tries to select an appropriate X server image for them Display tab is for resolution & color properties, Advanced tab is for monitor & video card properties writes all configurations changes to /etc/X11/XF86Config If changes are made from current setup, it will create XF86Config.backup for you If your video card is not automatically detected, try select the VESA Driver (Generic) select the Unsupported VGA Compatible card select Custome, then add a Linux driver from the video card manufacturer to /usr/X11R6/lib/modules/drivers If your monitor is not automatically detected, try select one of the Generics, don't use one that exceeds the Horizontal & Vertical Refresh Rates, you can damage your monitor doing it /etc/X11/ applnk/ - Directory with links to applications that appear in GUI Start menu desktop-menus/ - Directory with settings for various default GUI menus fs/ - Directory with font server configuration. gdm/ - Directory with configuration files for GNOME display manager prefdm - File that selects the preferred display manager serverconfig/ - Directory for X Server configuration settings xdm/ - Directory with configuration files for X display manager. xinit/ - Directory with configuration files needed for X startup & initialization used by startx when applicable files are not in a home directory xkb/ - File symlinked to ../../usr/X11R6/lib/X11/xkb, Directory with configuration files for keyboards Xresources/ - File that configures fonts called for the login screen X - File symlinked to ../../usr/X11R6/bin/XFree96, the X Server application /etc/X11/XF86Config Main configuration settings for the X Server Basic settings for resolution, pitch, graphics drivers, monitors, keyboards, mice and other pointer devices are configured through this file. ServerLayout - section that binds various Input Devices and the Screen, which includes the combined configuration for the monitor and video card. Files - section that relates to colors and fonts needed by X Server Modules - section of commands for loading font and server extension modules InputDevice - an InputDevice is anything that a user directly touches to send information to the computer. Primarily keboards and mice, trackballs, touchpads, etc are included. The first InputDevice specifies your keyboard, second your mouse. The "ZAxisMapping" option represents the up and down of a mouse wheel. Monitor - summarized basic settings associated with your monitor. Each monitor in a multi-head environment gets its own Monitor section. Device - section for video card(s). Again, if multiple video cards are present there are multiple sections. Screen - Combies applicable vieo card (Device) with monitor settings. DRI - Direct Rendering Interface, 3D acceleration with high end video cards. Setting the mode option 0666 sets read & write file permissions for all users. You could turn off rendering for a group of users ;) /usr/X11R6/ bin/ - X binaries lib/ modules/ - X server extensions/modules. xscreensaver/ - Screen saver programs. X11/fonts/ - Default font path. X11/app-defaults/ - Application defaults. X11/locale/ - Locale information -------------------------------------------- X Server CTRL-ALT-BACKSPACE - kills an X server, prevents rebooting if the GUI locks up. Multiple X-Servers can be run on the same local server. Useful for trying out local and remote Xclient concepts. Stop current X Window Server, /sbin/init 3 Start XFree86 server, # startx & Switch to text console, CTRL-ALT-F1 Start another XFree86 server, # startx -- :1 & Switch to first GUI: CTRL-ALT-F7 Switch to second GUI: CTRL-ALT-F8 CTRL-ALT-F1 through CTRL-ALT-F6 - switch virtual consoles ALT-F7 - Switch from text console to X Window GUI CTRL-ALT-+ Toggle forward through video modes CTRL-ALT-- Toggle backward through video modes -------------------------------------------- X Clients Common command line options -display server:0.0 # server can be a hostname, FQDN, or IP address -geometry 100x100+10+20 # A box 100x100 pixels that is 10 pixels from the left # and 20 from the top of the screen # -0-0 Lower Right Corner # -0+0 Upper Right Corner # +0-0 Lower Left Corner # +0+0 Upper Left Corner -font font name -background color -foreground color -title string -bordercolor color -borderwidth pixels Any remote X clients have to be let in with the "xhost +server" or "xhost +ipaddress" command. -------------------------------------------- Remote Security xhost controls access to the local X server. Access information is stored in ~/.Xauthority. Format of xhost command: xhost [+|-]name Where name is in the format of family:name. Family can be one of the following: inet(default),dnet,nis,krb,local. xhost + # Grant access from everywhere xhost - # Revoke access from everywhere xhost +server.domain.com # Grant access from server.domain.com xhost -server.domain.com # Revoke access from server.domain.com xhost +local:bob # Allow local user bob access SSH More secure is X forwarding over SSH. It's enabled in the ssh configuration for the server and client by default The biggest mistake people make is futzing with the DISPLAY variable when they shouldn't be, as ssh handles that. [scott@foo scott]$ ssh bar [scott@bar scott]$ xapplication & -------------------------------------------- Display Manager Login Manager, graphical look and feel for logging Select the preferred one by editing /etc/X11/prefdm 3 Major ones, gdm (GNOME), kdm (KDE), xdm (X) -------------------------------------------- Window Managers A special type of x-client. Controls how other x-clients appear. Causes all x-clients to display with common features (title bar, minimize & maximize buttons, etc.) Basically controls look & feel of window session. Common Window Managers: kwin - The KWin window manager is the default window manager for the KDE desktop environment. metacity - The Metacity window manager is the default window manager for the GNOME desktop environment. mwm - The Motif window manager, is a basic, standalone window manager. sawfish - The Sawfish window manager is a full featured window manager which was the default for the GNOME desktop environment until the release of Red Hat Linux 8.0. twm - The minimalist Tab Window Manager, which provides the most basic tool set of any of the window managers and can be used either standalone or with a desktop environment. It is installed as part of XFree86 -------------------------------------------- Desktop Environments Provide more features than a window manager. A window manager is one part of the desktop environment. Attempts to create a consistent environment for all applications. Common Desktop Environments: KDE - K Desktop Environment (QT based) GNOME - GNU Network Object Model Environment (GTK based. RedHat Default) -------------------------------------------- Start X [scott@foo scott]$ startx Looks for ~/.xinitrc (client(s) to run) first, then uses /etc/X11/xinit/xinitrc Looks for ~/.xserverrc (server to run) second, then starts the X Server on the first available grpahical console with the X :0 command. /etc/X11/xinit/xserverrc does not exist by default. -------------------------------------------- Troubleshooting With xf86config removed you can still use # X -configure. It will create XF86Config.new in the local directory. Backup /etc/X11/XF86Config, overwrite XF86Config with XF86Config.new, startx to test. X Font Server - needed by X Windows Server xfs service could be stopped or dead xfs won't start if either filesystem on /tmp or /home are full fonts could be misconfigured in /etc/X11/XF86Config fonts could be missing from /usr/X11R6/lib/X11/fonts Session errors are logged to ~/.xsession-errors /var/log/messages is always popular /var/log/XFree86.0.log for error messages from the X Server Check DISPLAY env varriable is set correctly, export DISPLAY=localhost:0.0 or export DISPLAY=:0.0 Make sure /usr/X11R6/bin is in your $PATH Check for underlying network or system problems Troubleshooting X Server problems on a remote system, start an X client on your local workstation using the remort X server's dispaly. Correct security access applies xclock -display remotesys:0.0