.. meta::
   :description: Overview of what ThinLinc profiles are, how they are
                 configured, and how to use them.

.. _profiles:

ThinLinc profiles
-----------------

ThinLinc allows for different *profiles* to be configured, where in the
most general of cases a profile maps to a specific desktop environment.
Unless there is only one profile available, the users will be presented
with a menu after logging in. Here they can choose for example between a
desktop suited for engineering users, a desktop suited for the marketing
department or perhaps for starting a Windows remote desktop client
session.

The example configuration files that are delivered with ThinLinc have
several different alternatives, however only those profiles that are
actually available on the system are displayed. If no profiles are
available the user will be shown an error upon starting a session
informing them that no profiles were found. This can happen, for
example, if no desktop environment has been installed on the agent. For
other reasons see :ref:`profiles_issues`.

This example configuration is meant to be customized for each individual
ThinLinc installation.

See :ref:`configuration_session-startup-vsmagent` for information about
how the profile chooser ties into the rest of the session startup.

.. _configuration_config-profiles:

Configuration
~~~~~~~~~~~~~

The available profiles are configured either via the |tlwebadm|, or
using the configuration files under the :servconf:`/profiles` path. The
default configuration includes a number of examples.

If the |default| parameter is present, it specifies the default profile.
The profile chooser will have this entry selected when it starts, and it
may also be used automatically for some error conditions.

.. |default| replace::
   :servconf:`default </profiles/default>`

The |order| parameter selects which profiles should be available for
selection, and the order in which they are displayed. This is a
space-separated list.

.. |order| replace::
   :servconf:`order </profiles/order>`

If the |show_intro| parameter is true, a configurable introduction text
will be displayed and requires user input to proceed with the logon
process. The |introduction| parameter is a text that will be displayed
if introduction is shown. This text block also supports `Pango Markup`_
format styling for a fancier text layout.

.. |show_intro| replace::
   :servconf:`show_intro </profiles/show_intro>`
.. |introduction| replace::
   :servconf:`introduction </profiles/introduction>`

Each profile is defined under a section named
:servconf:`/profiles/\<profile key\>`. For most desktop environments
only the |xdg_session| parameter needs to be configured. For custom
profiles more values need to be specified, mainly |cmdline|. Please see
:ref:`configuration_profiles` for more details on the available options.

.. |xdg_session| replace::
   :servconf:`xdg_session </profiles/<profile key>/xdg_session>`

.. _Pango Markup: https://docs.gtk.org/Pango/pango_markup.html#pango-markup

Custom desktops
~~~~~~~~~~~~~~~

Please read :ref:`tldc` for documentation on how to configure different
desktops with for example different menu and desktop icons depending on
what profile is selected.

Single application
~~~~~~~~~~~~~~~~~~

A profile can also be used to run only a single application instead of a
desktop. This can be achieved using the |cmdline| parameter for a
profile, in combination with the |tl-single-app| command.

.. |cmdline| replace::
   :servconf:`cmdline </profiles/<profile key>/cmdline>`

.. |tl-single-app| replace::
   :doc:`man/tl-single-app.1`

.. _profiles_issues:

Common issues
~~~~~~~~~~~~~

In some cases, ThinLinc will fail to find available profiles. This can
happen for a few different reasons, and different errors are shown in
each case --- see below. More information is available in the agent's
session log for the user,
:file:`/var/opt/thinlinc/sessions/<username>/last/xinit.log`, or the
setup log on the agent, :file:`/var/log/thinlinc/setup.log`.

No desktop environments installed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error is shown when no X11 desktop environment is installed on the
agent. For most use cases, ThinLinc requires an X11 desktop environment
to work. Also, there should be at least one configured ThinLinc profile
mapping to an installed desktop environment.

The recommended solution is to install a desktop environment, for
example GNOME, KDE, XFCE or MATE. Preconfigured profiles are available
for the most common desktops. Note that an X11-type desktop environment
is required.

No X11 desktop environments installed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error is shown when only Wayland-type desktops are installed on the
agent --- ThinLinc requires X11-type desktops. Also, there should be at
least one configured ThinLinc profile mapping to an installed X11
desktop.

The recommended solution is to install the X11 version of a desktop
environment. If the current desktop has no X11 version, the
recommendation is to install a different desktop environment.
Preconfigured profiles are available for the most common desktops.

Missing ThinLinc profile configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error is shown when no profiles match the currently installed
desktop environments on the agent. Although there is at least one
installed desktop on the agent, none are matching currently configured
profiles. For most use cases, there must be at least one profile mapping
to an installed desktop.

The recommended solution is to install a different desktop environment,
for example GNOME, KDE, XFCE or MATE. Preconfigured profiles are
available for the most common desktops. Note that an X11-type desktop
environment is required.

If no profiles match the wanted desktop, the creation of a new profile
should be considered --- see :ref:`configuration_profiles`. A
preconfigured profile can be used as a template.

No available ThinLinc profiles
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This error is shown when no profiles are available for the current
user, despite the presence of configured profiles matching the installed
desktop environments on the agent.

The recommended first step is to verify that the correct profiles are
activated. This can be achieved via the |tlwebadm|, or by ensuring that
the correct profiles are listed in :servconf:`/profiles/order`.

.. |tlwebadm| replace::
   :ref:`web administration interface <tlwebadm_profiles>`

If the profiles are activated properly, the second step is to check that
:servconf:`/profiles/<profile key>/testcmd` returns zero for the
user in question.
