In this lesson,
we're going to explore the Graphical User Interface
and the major Linux GUI components.
In many instances, people are more comfortable
working in a visual environment
than inside the Command Line Interface, or CLI.
For this reason, it's really important for you to learn
about the common window manager and desktop environments
that you can use within Linux.
Now, a GUI, or Graphical User Interface,
enables users to interact with a system or application
through various visual design elements
rather than using pure text
as in a command line interface, or CLI.
In Linux, users can select icons that represent files,
folders or programs to open them and modify them.
They can configure settings through menus.
They can interact with applications
through a windowed interface
and they can work from a desktop environment.
A Display Server is the component of a GUI
that constructs and manages the windowing system
and other visual elements that can be drawn on the screen.
Display Servers will accept client input requests
and send them to the appropriate
kernel modules for processing.
Likewise, they also manage the process of receiving requests
from an application and display that output to the client.
while the kernel is the heart of Linux,
the face of the operating system
is really the graphical environment
that's provided by the X Window System, also known as X.
The X Window System can also be known as X or X11,
and it is platform independent,
and it works as a display server and windowing system
that was originally developed
by the Massachusetts Institute of Technology,
or MIT, all the way back in 1984.
Like all display servers, the X server
coordinates client input and application output
to determine how to draw elements on the screen.
The X server also communicates with a separate compositor.
The compositor is going to read a memory buffer
that each application is going to write to
and then it's going to use that information from the buffer
to combine each individual application window
onto the screen.
That way, multiple windows can appear at once.
This is the free and open source reference implementation
of the X Window System for Linux,
and other units like operating systems.
Now, Wayland is both a display server
and its reference implementation in a unit
like operating system that is meant to approve upon
and replace the X Window System.
The primary difference between Wayland and X
is that in Wayland, the compositor is the server
rather than a separate component.
This enables clients to exchange events directly
with the compositor, cutting out the X server
as a middleman.
Although Wayland improves upon X in almost every way,
there are still some issues with Wayland.
For example, Canonical made Wayland
the default display server for Ubuntu 17.10
back in October of 2017.
But in April, 2018 for the release of Ubuntu 18.04,
Canonical announce that it switched back
to the x.org server for three primary reasons.
First, screen sharing software tends to work better
under x.org servers than it did Wayland.
Second, remote desktop software tended to work better
under X than it did Wayland.
And lastly, it was easier to recover from crashes under X
than it was under Wayland.
For this reason, Ubuntu migrate back to X
in version 1804 and abandoned Wayland.
Now a desktop environment includes a window manager,
and this desktop environment will control the look
and feel of the GUI for the entire operating system.
And it provides a common Graphical Interface
for applications that are running inside the environment.
The primary structural element of the desktop metaphor
is the application window.
And within each window, there can exist
various graphical elements like buttons,
icons, menus, toolbars, and much more.
Desktop environments also provide a graphical login screen
and can be customized to run every time the system boots up.
In most cases, the desktop environment will come packaged
with a variety of different GUI applications.
Things like file browsers, web browsers,
texts editors and more.
One exciting aspect of Linux, unlike Windows and Mac,
is that it supports numerous different desktop environments.
And this enables desktop users
to actually choose the appropriate and most suitable
desktop environment to best work with their needs.
Now, there are many different desktop environments
that are available for Linux
but the most common are GNOME, KDE Plasma,
Cinnamon and MATE.
GNOME is probably the most popular desktop environment
amongst Linux users, and it is free and open source
and powerful and simple to use all at the same time.
Now it's designed from the ground up
to offer Linux desktop users a wonderful
and exciting computing experience.
It presents activities overviews
for easy access of basic tasks.
It provides a powerful search tool for users
who want to access their work from any place.
Inside of GNOME 3, which is the latest stable release
as I'm filming this,
it actually can have distinguished components
and features such that it can support
desktop notifications using convenient messaging systems
enabling on and off switching of desktop notifications
and much more.
The other ones we need to talk about are things like KDE.
Now, KDE Plasma is going to support modularity through widgets
and it enables users to add, move or remove screen elements
to fit their own personal workflows.
KDE Plasma has a robust set of GUI apps as well,
including word processors, mail clients,
multimedia software and more.
Also, KDE Plasma can support both X and Wayland.
Now Cinnamon is actually going to be a fork of GNOME 3
and it's one of the default environments
in the Linux Mint distro.
Cinnamon was developed in response to the changes in GNOME 3
and gives us a typical desktop metaphor
rather than an abstracted model.
Now, the fourth one we have is known as MATE,
and MATE is an intuitive and appealing desktop environment.
It's actually an extension of the older GNOME 2.
It works on Linux and many other Unix-like systems
and it comes with a handful of default applications
such as the Kaha File Manager, Pluma Text Editor,
MATE Terminal, and many others.
Additionally, it's also the default desktop environment
for Linux Mint, alongside Cinnamon's desktop.
None of these desktop environments though
is objectively the right choice.
Which environment you choose to use
is ultimately going to come down to your personal preference
and your comfort level with each one.
Personally, I tend to use either GNOME or KDE,
but that's just because I've been using them
for over two decades now.
When you're starting out, the best thing to do
is to try each environment in order to know which one
is really right for you and which one you like best.
Another concept we need to cover is remote desktop.
Now remote desktop is a concept in which clients
are going to connect to a remote system over a network,
and they want to be able to sign in
and use the desktop environment of that system.
Using remote desktop sessions,
you can actually create a situation
where you can configure a server that has a GUI
but you aren't physically located at that system.
In addition to this, remote desktop sessions
are going to be used in an environment
where the user connects to
and works from the remote computer
as if it was located right in front of them.
In other words, the remote session
becomes their primary desktop.
Now there are many software packages available in Linux
that will provide you with remote desktop sessions.
One of the most popular ones is VNC.
The Virtual Network Computing, or VNC,
is going to be a cross-platform remote desktop service
that enables full remote control of a desktop.
VNC leverages the remote frame buffer or RFB protocol.
A VNC server has to be installed on your target machine
and then you're going to access that
with a corresponding client.
Another one you can use is xrdp,
which is a free and open source utility
that constructs a Remote Desktop Protocol,
or RDP like server, for non-Windows systems.
You can also install xrdp on a remote Linux server
and use a tool like R Desktop or even the default RDP client
to connect to that server.
So in other words, we can now have a client
that can be on any platform
because RDP works on Linux and Windows.
The xrdp utility is designed to work
with the X Windowing System as well.
The next one we have is known as NoMachine.
Now, NoMachine is a cross platform
proprietary remote desktop software, and it offers support
for multi-session environments and account management.
Therefore, NoMachine is actually useful in organizations
with many different users that require simultaneous access
to the same server.
NoMachine is designed to work with X.
Now another one we have is known as Simple Protocol
for Independent Computing Environments, or SPICE.
SPICE is a free and open source protocol
designed specifically for use in virtual environments.
SPICE is often used for administrators
to connect to virtual machines that are being hosted
by kernel based virtual machines or KVM hypervisors.
Another concept we need to cover
is the concept of Console Redirection.
Now Console Redirection is the process of forwarding input
and output through a serial connection
rather than through an I/O peripheral
that's directly attached to the system.
So instead of sending things to and from my mouse
and keyboard, I want to send it through the console instead.
This enables the system with Console Redirection
to send display output along a serial cable
and eventually to a remote client,
instead of sending it right to a monitor.
Likewise, the remote client can also redirect
the keyboard input along a serial connection
and send that to a remote server.
Ultimately, Console Redirection enables administrators
to remotely configure systems in a pre-boot environment
like BIOS or UEFI.
Secure Shell is another remote access protocol
that we can use instead of using remote desktop.
When you're using Secure Shell, or SSH,
it encrypts transmissions over a network
and is by far the most commonly used protocol
for accessing command line interfaces on a Linux server.
You can also use SSH to issue commands to the server
as if you are typing directly
into a command line interface itself.
It can also be used to tunnel and carry other types
of network communication securely,
including remote desktop traffic.
This process is known as tunneling
and you can tunnel an application through SSH
to secure it in transmission
by doing what's known as SSH Port Forwarding.
When you're doing local forwarding,
the local client is going to listen for connections
on a port and then tunnels any active connection
to the remote server over SSH.
For example, let's say you want to remotely access a system
over the internet using something like VNC.
Well, VNC is not encrypted by default,
so if you connect to a VNC server
with your local VNC client, that traffic will be sent
in the clear and people could see what you're typing.
But if you forward it through SSH first,
you are now encrypting that traffic and securing it.
In remote forwarding, the SSH server
is going to forward inbound client traffic
to another system on a different port.
Let's say I set up a VNC server on a local system
and I'm forwarding all VNC traffic
to a port on a remote client.
Whenever the remote client connects to this port
using the local host, they can then establish
a remote desktop connection with the local server.
X and X11 are both network aware,
and so you can actually enable these clients
to access GUI elements over a network too.
But if you want to do that,
you definitely need to forward your X traffic
and X11 traffic through an SSH tunnel
to ensure they're encrypted before communicating them
over an unsecure network.
Another thing we need to talk about is accessibility.
Now each desktop environment
has its own accessibility options
to accommodate people with disabilities.
Some options include a screen reader
that reads all the highlighted screen elements.
You might have a magnifier that zooms in
on specific sections of your screen.
You can also increase the size of specific elements,
like the text or the buttons or the mouse pointers.
And you can even use an onscreen keyboard
that enables users to click to type text using your mouse
instead of using a physical keyboard.
Also, we have keyboard accessibility options
including things like Sticky Keys
which enables users to press one key at a time
instead of having to hold down multiple keys at once
in order to activate keyboard shortcuts.
We also have Repeat Keys, which enables the user
to hold down a key in order for it to be repeatedly entered.
And we have Toggle Keys,
which enables the system to beep
whenever keys like Caps Lock or Num Lock
are going to be pressed.
Finally, we can also use visual themes
like high contrast to make the screen easier to read
for certain people with visual impairments.
There are lots of different ways
that we can make our systems more accessible
and better suited for our end users.