– General Linux 2 – Install & Configure X

(Linux Professional Institute Certification)

a

   .~.
   /V\      by: geoffrey robertson
  // \\         geoffrey@zip.com.au
  @._.@
$Id: gl1.110.1.slides.tex,v 1.3 2003/05/30 05:04:32 waratah Exp $

aCopyright \begin{matrix}c \\ ◯ \end{matrix} 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation—either version 2 of the License or (at your option) any later version.

1.110.1

Install & Configure XFree86 1.110.2 Setup a display manager 1.110.4 Install & Customize a Window Manager Environment

Install & Configure XFree86

Objective

Candidate should be able to configure and install X and an X font server. This objective includes verifying that the video card and monitor are supported by an X server, as well as customizing and tuning X for the videocard and monitor. It also includes installing an X font server, installing fonts, and configuring X to use the font server (may require a manual edit of /etc/X11/XF86Config in the ”Files” section)

Install & Configure XFree86

Key files, terms, and utilities

XF86Setup
xf86config
xvidtune
/etc/X11/XF86Config
.Xresources

Install & Configure XFree86

Resources of interest

:

:

The Linux Desktop GUI

• On Linux, the graphical desktop is controlled by 4 different types of software:

– The X server - hardware interface

– A window manager - windows, icons etc

– Desktop manager - file manager, control panel etc

– The application itself (the x-client)

• Only the X server & X-client are mandatory

Window Managers

• Some window managers are: – AfterStep - Light resource usage – Blackbox - Fast & simple

– Enlightenment - Resource intensive – FVWM - Not so popular anymore – IceWM - Emulates OS/2 & windows – Sawfish - default for Gnome

– Window Maker

Desktop Environments

• There are two main Desktops are: – KDE

– Gnome

Starting X

• The X server is an executable called ’X’

• Usually a link:

  $ ls -l `which X`
  lrwxrwxrwx     ...   /usr/bin/X11/X -> XFree86

• You can start X in several ways:

– X directly - (not very useful)

– xinit - X & one X-term client

– startx - X & desktop (KDE or Gnome)

X Server Screen references

When X starts, it associates itself with a display & screen. The syntax for

this is: ':display.screen'

• Display is 0 for the first X server, 1 for the next etc.

• Screen is 0 for the first screen on a multihead card

• The default for display & screen are both 0 Example:

 :0.1

The second screen (head) on X server 0

 :1.0 or :1

The first screen on the second X server

Starting X directly

• The syntax for X is:

X [:display.screen] [options]

Examples:

$ X ↩

Start X on display 0, screen 0

$ X :1 ↩

Start X on display 1, screen 1

$ X :1.1 ↩

Start X on display 1, screen 1

Starting X using xinit

• The syntax for xinit is:

xinit [[client] options ] [--[server] [display]
options ]

Examples:

$ xinit ↩

Start X and one xterm on display 0, screen 0

$ xinit -- :1 ↩

Start X and 1 xterm on the second display

$ xinit /usr/X11R6/bin/xcalc -- :1 ↩

Start X and xcalc on the second display

$ xinit /usr/bin/startkde -- :1 ↩

Start X and kde on the second display

Starting X using startx

• startx is a wrapper for X and your favourite desktop

• it has the same syntax as xinit

• On RedHat, default desktop is in /etc/sysconfig/desktop Examples:

$ startx ↩

Start X and the default desktop on display 0, screen 0

$ startx -- :1 -depth 16 ↩

Start X and desktop on the second display in 16 bit colour

$ startx /usr/bin/startkde -- :1 ↩

Start X and the kde desktop on the second display

Running X-clients remotely

• An X-client can be told to direct its output to a given display in one of two ways:

– By using the DISPLAY environment variable

– By using the -display option on the command line

• A remote display is specified using the syntax:

hostname:display.screen

Example:

node12.c222:1.0

Refers to the first screen on the second display of host node12.c222

Running X-clients remotely

• Using the -display option

$ xcalc -display node12.c222:1.0 ↩

• Using the DISPLAY environment variable

$ export DISPLAY=node12.c222:1.0 ↩
$ xcalc ↩

Both methods will run xcalc on the second display of host node12.c222. Note that in the second case, the DISPLAY variable is exported so it will apply to all X-clients started on that terminal.

Controlling access to the X server

• By default, an X server will only accept connections from clients running on the same host as the server.

• Remote access can be granted using the xhost command – xhost + - Disable access control (any host is OK)

– xhost - - Enable access control (only listed hosts)

– xhost +hostname - Allow hostname to connect

– xhost -hostname - Disallow hostname from connecting • xhost uses host based access control

• xhost must be run on the X server.

Testing access to the X server

• As a client, you can see if you have permission to connect to a remote X server by:

– Setting & exporting the DISPLAY variable to the desired X server – running xhost without any arguments

• Example:- See if node12.c222 is available to us for display

$ export DISPLAY=node12.c222:1.0 ↩
$ xhost ↩
xhost:  unable to open display "node12.c222:.0"

The X server

• There are two versions of the X server:

• X version 3:

– Uses the configuration file /etc/X11/XF86Config – Has different X executables for different cards

• X version 4:

– Uses the configuration file /etc/X11/XF86Config-4 – Has only one executable for all video cards (XFree86)

The X server

• To tell which version you are running do the following: Example:

$ ls -l `which X` ↩
lrwxrwxrwx   .... /usr/bin/X11/X -> XF86_SVGA

Using X version 3 on an SVGA card

$ ls -l `which X` ↩
lwxrwxrwx     .... /usr/bin/X11/X -> XFree86

Using X version 4.

Version 3 drivers

The version 3 drivers are specific to a particular card type. Some of the more common drivers are:

• XF86 3DL - 3D Labs video cards

• XF86 8514 - 8514 video cards

• XF86 AGX - AGX video cards

• XF86 FB - Generic frame buffer device for non-specific cards • XF86 Mach64 - ATI Mach 64 video cards

• XF86 S3 - S3 based video cards

• XF86 S3V - S3 virge video cards

• XF86 SVGA - VESA Super VGA cards

• XF86 VGA16 - 16 colour VGA cards

The X server

• The X server: – is the interface to the graphics card

– allows X clients to display information – can run multiple instances on a single card – accepts local or remote X-clients