Linux System Administration For Researchers: Chapter 6: Introduction To X
Linux System Administration For Researchers: Chapter 6: Introduction To X
Chapter 6: Introduction to X
Part 1: What is X?
What is X?:
X is a OS-agnostic, hardware-agnostic, network-transparent, clientserver system that provides a graphical user interface. It is highly
configurable:
The History of X:
1981, Xerox PARC develops the Star
computer, with the first modern GUI.
1983, Apple releases the Lisa computer.
1984, X version 1 developed for the MIT
athena project. Development began as a port
of Stanford's W window system for the V
operating system.
1984, Apple releases the first Macintosh.
1987, Current version (11) released. X development overseen by the MIT X
Consortium, a collaboration between MIT and industry (DEC, HP, Sun, etc.)
1992, Volunteers begin working on XFree86, an X server for PC hardware, based
on the MIT X distribution.
1992, Microsoft releases Windows 3.1.
1993, X Development taken over by X Consortium, inc., a non-profit vendorcontrolled corporation. XFree86 continues to work in parallel.
1997, Taken over by The Open Group, another vendor group. Attempted
unsuccessfully to change X licensing. By this time, XFree86 is the most dynamic
part of the X world.
2004, X development taken over by the X.org Foundation, a community project
open to (and governed by) individuals and funded by corporate sponsors.
4
Advantages of X:
Clients can run anywhere, and display anywhere.
(Network transparency.)
Clients are don't need to care what type of video
hardware your computer has. (The X server takes
care of all that.)
Clients don't even need to be running on the same
type of operating system. (All X clients use the
same protocol, and can work together, no matter
whether they're running under Linux, OS X or
Windows.)
7
Part 2: Running X:
X Display Managers:
In /etc/inittab there will usually be a line like this:
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
This tells init to start running an X display manager. A display
manager is a program that has several purposes:
Start the X server, if it isn't already running.
Connect to the X server as a client, and show a
username/password dialog box on the X display.
Wait for a user to successfully log in, and then start an X
session (a predetermined set of X applications).
Hang around silently until the session ends, and then re-
X Sessions:
An X session is just a set of X clients that get started up when you log in. Usually, the
display manager starts these by running a script named Xsession, which lives in /etc/X11
or /etc/X11/xinit. When the script finishes, the session is over and the display manager redisplays the login dialog box.
Display Manager
/etc/X11/xinit/Xsession
#!/bin/sh
# Start some applications:
# Terminal Windows:
/usr/bin/xterm &
/usr/bin/xterm &
/usr/bin/xterm &
# Misc:
/usr/bin/xclock &
/usr/bin/xcalc &
/usr/bin/exmh &
Window Managers:
A window manager is a special X client that has the ability to add decorations to other X
clients, and to control them in various ways. For example, the window manager might let
you move windows around on the display, resize or iconify windows.
11
12
X Resources:
While it's running, the X server stores a list of configuration
parameters in memory. This list is called the X Resource Database,
and individual parameters are called resources. Client programs
can look at the values of these resources. Here's an excerpt from the
list of resources, showing some that apply to the xterm application:
XTerm*loginShell:
true
XTerm*ttyModes:
erase ^?
xterm*background:
Black
xterm*cursorColor:
red
xterm*font:
fixed
xterm*foreground:
yellow
xterm*fullCursor:
true
xterm*reverseWrap:
true
xterm*scrollBar:
true
xterm*scrollKey:
on
xterm*scrollTtyOutput: off
xterm.SimpleMenu*background:
#efefef
xterm.SimpleMenu*foreground:
#000000
...
X Server
X Resources
14
If you leave off the -merge you'll wipe out the current
database and replace it with only the contents of
the .Xresources file!
hostname:displaynumber.screennumber 15
16
ssh demo1
ssh demo2
ssh demo3
ssh demo4
ssh demo5
ssh demo6
ssh demo7
17
Part 3: Security
18
X Client
(xterm)
X
Protocol
(unencrypted)
X Server
xhost + remotehost
setenv DISPLAY mypc:0
Remote
Computer
X Client
(xterm)
ssh
X Server
(encrypted)
Tunnelled X Protocol
19
ForwardX11 yes
You can also tell ssh explicitly to create an X tunnel by typing ssh -X instead of just ssh.
Putty (MS Windows):
20
21
Remote
Computer
xdm
XDMCP Protocol
(unencrypted)
X Client
X Client
X Server
X Protocol
(unencrypted)
X Client
X Client
X Client
NX
Server
Ssh Protocol
sshd
ssh
nxclient
X Server
(encrypted)
22
X Client
Tunnelled NX Protocol
23
24
Part 5: Fonts
27
This
Remote Computer
X Client
X Server
Fonts
Arial
Chancery
Helvetica...
28
29
30
This
Remote Computer
Write This
X Client
Fonts
Arial
Chancery
Helvetica...
X Server
31
32
33
KDE:
34
About KDE:
35
Gnome:
36
About Gnome:
37
39
Unity:
41
42
"Videocard0"
"vesa"
Video Driver
Section "Screen"
Color Depth
Identifier "Screen0"
Device
"Videocard0"
Available Resolutions
DefaultDepth
24
SubSection "Display"
Viewport
0 0
Depth
24
Modes
"1280x1024" "1024x768 "800x600" "640x480"
EndSubSection
EndSection
43
The gnome-display-properties
application, available under most
newer distributions, including Ubuntu:
44
The End
46
Thank You!