X11
What is X11?
The X Window System (X11, or shortened to simply X, and sometimes informally X-Windows) is a windowing system for bitmap displays, common on UNIX-like computer operating systems.
X11 Links
X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard. X does not mandate the user interface – this is handled by individual programs. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces.
Unlike most earlier display protocols, X was specifically designed to be used over network connections rather than on an integral or attached display device. X features network transparency, which means an X program running on a computer somewhere on a network (such as the Internet) can display its user interface on an X server running on some other computer on the network. The X server is typically the provider of graphics resources and keyboard/mouse events to X clients, meaning that the X server is usually running on the computer in front of a human user, while the X client applications run anywhere on the network and communicate with the user's computer to request the rendering of graphics content and receive events from input devices including keyboards and mice.
The fact that the term "server" is applied to the software in front of the user is often surprising to users accustomed to their programs being clients to services on remote computers. Here, rather than a remote database being the resource for a local app, the user's graphic display and input devices become resources made available by the local X server to both local and remotely hosted X client programs who need to share the user's graphics and input devices to communicate with the user.
X's network protocol is based on X command primitives. This approach allows both 2D and (through extensions like GLX) 3D operations by an X client application which might be running on a different computer to still be fully accelerated on the X server's display. For example, in classic OpenGL (before version 3.0), display lists containing large numbers of objects could be constructed and stored entirely in the X server by a remote X client program, and each then rendered by sending a single glCallList(which) across the network.
X provides no native support for audio; several projects exist to fill this niche, some also providing transparent network support.
Software Architecture
X uses a client–server model: an X server communicates with various client programs. The server accepts requests for graphical output (windows) and sends back user input (from keyboard, mouse, or touchscreen). The server may function as:
- an application displaying to a window of another display system
- a system program controlling the video output of a PC
- a dedicated piece of hardware
This client–server terminology – the user's terminal being the server and the applications being the clients – often confuses new X users, because the terms appear reversed. But X takes the perspective of the application, rather than that of the end-user: X provides display and I/O services to applications, so it is a server; applications use these services, thus they re clients.
The communication protocol between server and client operates network-transparently: the client and server may run on the same machine or on different ones, possibly with different architectures and operating systems. A client and server can even communicate securely over the Internet by tunneling the connection over an encrypted network session.
X Servers
Xming
Xming is the leading X Window System Server for Microsoft Windows 8/7/Vista/XP (+ server 2012/2008/2003). It is fully featured, small and fast, simple to install and because it is standalone native Microsoft Windows, easily made portable (not needing a machine-specific installation).
In May 2007, Xming became proprietary software. The last public domain version of Xming is 6.9.0.31.
Xming Links
The following links are specific to Xming:
XLaunch
XLaunch is a wizard for simplifying the startup of an Xming X server. Its re-usable XML configuration files also act as mini-session managers. One X client can be selected for concurrent display from a local or remote machine. When remote, the X client is accessed securely via PuTTY or SSH.
You may also use XLaunch to just simply start the X server and then run several X clients later by hand or from Xmingrc menu entries.
MobaXterm
MobaXterm is your ultimate toolbox for remote computing. In a single Windows application, it provides loads of functions that are tailored for programmers, webmasters, IT administrators and pretty much all users who need to handle their remote jobs in a more simple fashion.
MobaXterm Links
The following links are specific to MobaXterm:
X11 Forwarding
Enable X11 on Client
Edit the /etc/ssh/sshd_config
to include the following lines:
AllowTcpForwarding yes
X11Forwarding yes
X11UseForwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
UsePAM yes #AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no X11Forwarding yes X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes #PrintMotd yes
Do not forget to restart the SSH service.
Restart the SSH service Centos 7
systemctl restart sshd
Restart the SSH service Red Hat 6.8
service sshd restart
Install xterm
xterm is the standard terminal emulator for the X Window System. A user can have many different invocations of xterm running at once on the same display, each of which provides independent input/output for the process running in it (normally the process is a Unix shell).
xterm Links
The following links are specific to xterm:
Install xterm software through yum
.
sudo yum install xterm
The output looks like this:
Loaded plugins: fastestmirror, langpacks Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast HDP-2.1.0.0 | 2.9 kB 00:00 HDP-NEW-2.0.6.0 | 2.9 kB 00:00 HDP-UTILS-1.1.0.16 | 2.9 kB 00:00 base | 3.6 kB 00:00 epel/x86_64/metalink | 13 kB 00:00 epel | 4.3 kB 00:00 extras | 3.4 kB 00:00 rpmforge | 1.9 kB 00:00 Not using downloaded repomd.xml because it is older than what we have: Current : Thu Jul 10 18:46:59 2014 Downloaded: Thu Jul 10 18:46:42 2014 updates | 3.4 kB 00:00 vmware-tools | 951 B 00:00 (1/5): epel/x86_64/updateinfo | 585 kB 00:00 (2/5): epel/x86_64/group_gz | 170 kB 00:00 (3/5): epel/x86_64/primary_db | 4.3 MB 00:00 (4/5): extras/7/x86_64/primary_db | 149 kB 00:00 (5/5): updates/7/x86_64/primary_db | 5.7 MB 00:04 Loading mirror speeds from cached hostfile * base: mirrors.kernel.org * epel: mirror.prgmr.com * extras: mirrors.kernel.org * rpmforge: mirror.nexcess.net * updates: mirrors.kernel.org Resolving Dependencies --> Running transaction check ---> Package xterm.x86_64 0:295-3.el7 will be installed --> Processing Dependency: libXaw.so.7()(64bit) for package: xterm-295-3.el7.x86_64 --> Running transaction check ---> Package libXaw.x86_64 0:1.0.12-5.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: xterm x86_64 295-3.el7 base 455 k Installing for dependencies: libXaw x86_64 1.0.12-5.el7 base 190 k Transaction Summary ================================================================================ Install 1 Package (+1 Dependent package) Total download size: 645 k Installed size: 1.7 M Is this ok [y/d/N]: y Downloading packages: (1/2): libXaw-1.0.12-5.el7.x86_64.rpm | 190 kB 00:00 (2/2): xterm-295-3.el7.x86_64.rpm | 455 kB 00:01 -------------------------------------------------------------------------------- Total 353 kB/s | 645 kB 00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : libXaw-1.0.12-5.el7.x86_64 1/2 Installing : xterm-295-3.el7.x86_64 2/2 Verifying : libXaw-1.0.12-5.el7.x86_64 1/2 Verifying : xterm-295-3.el7.x86_64 2/2 Installed: xterm.x86_64 0:295-3.el7 Dependency Installed: libXaw.x86_64 0:1.0.12-5.el7 Complete!
Install xclock
Install xclock software through yum
.
sudo yum install xclock
Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.kernel.org * epel: linux.mirrors.es.net * extras: mirrors.kernel.org * rpmforge: mirror.hmc.edu * updates: mirrors.kernel.org Resolving Dependencies --> Running transaction check ---> Package xorg-x11-apps.x86_64 0:7.7-6.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: xorg-x11-apps x86_64 7.7-6.el7 base 304 k Transaction Summary ================================================================================ Install 1 Package Total download size: 304 k Installed size: 769 k Is this ok [y/d/N]: y Downloading packages: xorg-x11-apps-7.7-6.el7.x86_64.rpm | 304 kB 00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : xorg-x11-apps-7.7-6.el7.x86_64 1/1 Verifying : xorg-x11-apps-7.7-6.el7.x86_64 1/1 Installed: xorg-x11-apps.x86_64 0:7.7-6.el7 Complete!
Using Xming with PuTTY
Once Xming is installed, it is time to attempt a connection with your X11 client.
On X Client
Before attempting to connect to a remote system, ensure that the remote
system is up and running. The remote system does not need to be logged in
to any user. It just needs to be on. Make sure that the
DISPLAY
environment variable is set.
To check the value:
echo $DISPLAY
To set the value:
export DISPLAY=localhost:10.0
On X Server
PuTTY must start with the same DISPLAY
options to match what was
set on the client system. This is found as a command line parameter on the
shortcut. From the Window's Start menu, examine the short cut's parameters:
Ensure that the value on the command line, in the red box, is set to
:10
, matching the client's DISPLAY
setting:
Start the Xming server on the Windows system.
Verify the Xming server display setting by hovering your mouse cursor over the Xming server icon located in the Windows System Tray.
Xming is now running on the server. The next step is to start PuTTY. When you start PuTTY, you are greeted with the PuTTY Configuration window. Fill in the Host Name (or IP address).
While still in PuTTY, click on the SSH node in the Category section. Then click on X11. This will display the Options controlling SSH X11 forwarding. Enable X11 forwarding needs to be enabled. Set the X display location to localhost:0. This is telling PuTTY to use the display you are currently using.
At this point, if you wish to save this PuTTY configuration, now is the time.
Click on the Open button to start the session.
A connection has been made with the client. Now it is time to actually test for a X11 connection. On the command line, type:
xclock &
This will open a window like this: