LightDM: Difference between revisions

From ArchWiki
m (→‎Infinite login loop: grammar fix)
 
(245 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
[[Category:Display managers]]
[[Category:Display managers]]
[[es:LightDM]]
[[Category:Canonical]]
[[fr:LightDM]]
[[de:Login-Manager#LightDM]]
[[ja:LightDM]]
[[ja:LightDM]]
[[ru:LightDM]]
[[ru:LightDM]]
[[zh-CN:LightDM]]
[[zh-hans:LightDM]]
{{Related articles start}}
{{Related articles start}}
{{Related|Display manager}}
{{Related|Display manager}}
{{Related|GDM}}
{{Related|GDM}}
{{Related|KDM}}
{{Related|LXDM}}
{{Related|LXDM}}
{{Related articles end}}
{{Related articles end}}


[http://www.freedesktop.org/wiki/Software/LightDM LightDM] is a cross-desktop [[display manager]]. Its key features are:
[https://github.com/canonical/lightdm LightDM] is a cross-desktop [[display manager]]. Its key features are:
 
* Cross-desktop - supports different desktop technologies.
* Cross-desktop - supports different desktop technologies.
* Supports different display technologies (X, Wayland, Mir, ...).
* Supports different display technologies (X, Mir, Wayland ...).
* Lightweight - low memory usage and high performance.
* Lightweight - low memory usage and high performance.
* Supports guest sessions.
* Supports guest sessions.
* Supports remote login (incoming - XDMCP, VNC, outgoing - XDMCP, pluggable).
* Supports remote login (incoming - [[XDMCP]], [[VNC]], outgoing - XDMCP, [[PAM]]).
* Comprehensive test suite.
* Comprehensive test suite.
* Low code complexity.
* Low code complexity.


More details about LightDM's design can be found [http://www.freedesktop.org/wiki/Software/LightDM/Design here].
More details about LightDM's design can be found [https://www.freedesktop.org/wiki/Software/LightDM/Design here].


== Installation ==
== Installation ==


[[Install]] {{Pkg|lightdm}}. Note that stable releases are even-numbered (1.8, 1.10) while development releases are odd-numbered (1.9, 1.11). These development releases are available with {{AUR|lightdm-devel}}. Also available is {{AUR|lightdm-bzr}}.
[[Install]] the {{Pkg|lightdm}} package or {{AUR|lightdm-git}} for the development version.
 
=== Greeter ===
 
You will probably want to install a greeter. A greeter is a GUI that prompts the user for credentials, lets the user select a session, and so on. It is possible to use LightDM without a greeter, but only if an automatic login is configured; otherwise you will need to install {{pkg|xorg-server}} and one of the greeter packages below.


=== Greeter===
The official repositories contain the following greeters:


You will probably want to install a greeter. A greeter is a GUI that prompts the user for credentials, lets the user select a session, and so on. It's possible to use LightDM without a greeter, but only if an automatic login is configured. The reference greeter is {{Pkg|lightdm-gtk-greeter}}. LightDM attempts to use this greeter when started unless configured to do otherwise.
* {{Pkg|lightdm-gtk-greeter}}: This is the '''default''' greeter LightDM attempts to use, unless configured otherwise.
* lightdm-deepin-greeter ({{Pkg|deepin-session-shell}}): A greeter from the [[Deepin]] project.
* {{Pkg|lightdm-pantheon-greeter}}: A greeter from the elementary OS project.
* {{Pkg|lightdm-slick-greeter}}: A GTK based greeter focused more on appearance than {{Pkg|lightdm-gtk-greeter}}, originally forked from the Unity greeter, and default in Linux Mint.
* {{Pkg|lightdm-webkit2-greeter}}: A greeter that uses Webkit2 for theming. It supersedes lightdm-webkit-greeter.
* {{Pkg|lightdm-webkit-theme-litarvan}}: A modern and full-featured Webkit2 LightDM theme.


The official repositories contain the following alternative greeters.
Other alternative greeters are available in the [[AUR]]:
* {{Pkg|lightdm-kde-greeter}}: A greeter used with KDE4.
* lightdm-deepin-greeter ({{Pkg|deepin-session-ui}}): A greeter from the [[Deepin Desktop Environment|Deepin]] project.


Other alternative greeters are available in the [[AUR]].
* {{AUR|lightdm-mini-greeter}}: A minimal, configurable, single-user greeter.
* {{AUR|lightdm-webkit2-greeter}}: A greeter that uses Webkit2 for theming. It supersedes {{AUR|lightdm-webkit-greeter}}.
* {{AUR|web-greeter-theme-shikai}}: Aesthetic, customizable lightdm theme for the lightdm {{AUR|web-greeter}}.
* {{AUR|lightdm-unity-greeter}}: The greeter used by Ubuntu's [[Unity]].
* {{AUR|lightdm-webkit-theme-aether}}: A sleek, straightforward Arch Linux themed login screen written on lightdm and the lightdm-webkit2-greeter.
* {{AUR|lightdm-pantheon-greeter}}: A greeter from the elementary OS project.
* {{AUR|lightdm-elephant-greeter-git}}: A small and simple greeter that runs in the {{Pkg|cage}} Wayland compositor per default.
* {{AUR|web-greeter}}: A modern, visually appealing greeter that uses PyQtWebEngine for theming. It supersedes {{Pkg|lightdm-webkit2-greeter}}.


You can set the default greeter by changing the {{ic|[Seat:*]}} section of the LightDM configuration file, like so:
You can set the default greeter by changing the {{ic|[Seat:*]}} section of the LightDM configuration file, like so:
Line 45: Line 53:
[Seat:*]
[Seat:*]
...
...
greeter-session=lightdm-yourgreeter-greeter
greeter-session=lightdm-''yourgreeter''-greeter
...
}}
}}


Which greeters are available? What values may be assigned to the {{ic|greeter-session}} option? Each {{ic|.desktop}} file in the {{ic|/usr/share/xgreeters}} directory denotes an available greeter. In this example, the {{ic|lightdm-gtk-greeter}} and {{ic|lightdm-kde-greeter}} greeters are available:
{{Note|{{Pkg|lightdm-pantheon-greeter}}'s corresponding configuration file is {{ic|io.elementary.greeter.conf}}, not {{ic|lightdm-pantheon-greeter.conf}}}}
$ ls -1 /usr/share/xgreeters/
 
lightdm-gtk-greeter.desktop
One way to check which greeters are available is to list the files in the {{ic|/usr/share/xgreeters}} directory; each  ''.desktop'' file represents an available greeter. In this example, the {{ic|lightdm-gtk-greeter}} and {{ic|lightdm-webkit2-greeter}} greeters are available:
lightdm-kde-greeter.desktop
 
{{hc|$ ls -1 /usr/share/xgreeters/|
lightdm-gtk-greeter.desktop
lightdm-webkit2-greeter.desktop
}}


== Enabling LightDM ==
== Enabling LightDM ==


Make sure to [[enable]] {{ic|lightdm.service}} so LightDM will be started at boot, see also [[Display manager#Loading the display manager]].
Make sure to [[enable]] {{ic|lightdm.service}} so LightDM will be started at boot; see also [[Display manager#Loading the display manager]].


== Command line tool ==
== Command line tool ==


LightDM offers a command line tool, {{ic|dm-tool}}, which can be used to lock the current seat, switch sessions, etc, which is useful with 'minimalist' window managers and for testing. To see a list of available commands, execute:
LightDM offers a command line tool, {{ic|dm-tool}}, which can be used to lock the current seat, switch sessions, etc, which is useful with 'minimalist' window managers and for testing. To see a list of available commands, execute:
  $ dm-tool --help
  $ dm-tool --help
=== User switching ===
{{Warning|''dm-tool'' (with {{ic|dm-tool lock}} or {{ic|dm-tool switch-to-greeter}}) can easily be bypassed and will not lock your session without [[#Lock the screen using light-locker|light-locker]] or an other [[List of applications/Security#Screen lockers|loginctl compatible screen locker]]. See [[XScreenSaver#User switching from the lock screen]].}}
LightDM's ''dm-tool'' command can be used to allow multiple users to be logged in on separate ttys. The following will send a signal requesting that the current session be locked and then will initiate a switch to LightDM's greeter, allowing a new user to log in to the system.
$ dm-tool switch-to-greeter


== Testing ==
== Testing ==


First, [[install]] {{Pkg|xorg-server-xephyr}} from the [[official repositories]].
First, [[install]] {{Pkg|xorg-server-xephyr}}.


Then, run LightDM as an X application:
Then, run LightDM as an X application:
  $ lightdm --test-mode --debug
  $ lightdm --test-mode --debug


== Optional configuration and tweaks ==
== Optional configuration and tweaks ==


LightDM can be configured by modifying its config file, {{ic|/etc/lightdm/lightdm.conf}}.
LightDM can be configured by modifying its configuration file, {{ic|/etc/lightdm/lightdm.conf}}.


Some greeters have their own configuration files. For example:
Some greeters have their own configuration files. For example:
   
   
{{Pkg|lightdm-gtk-greeter}}: {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}}
{{Pkg|lightdm-gtk-greeter}}: {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} (or you can use the {{Pkg|lightdm-gtk-greeter-settings}} gui).
 
{{Pkg|lightdm-webkit2-greeter}}: {{ic|/etc/lightdm/lightdm-webkit2-greeter.conf}}
 
=== X session wrapper ===
 
{{Merge|Xprofile|Duplicated information}}
 
If you are migrating from [[xinit]], you will notice that the display is not launched by your shell. This is because, as opposed to your shell starting the display (and the display inheriting the environment of your shell), LightDM starts your display and does not source your shell. LightDM launches the display by running a wrapper script and that finally exec's your graphic environment. By default, {{ic|/etc/lightdm/Xsession}} is run.
 
==== Environment variables ====
 
The script checks and sources {{ic|/etc/profile}}, {{ic|~/.profile}},  {{ic|/etc/xprofile}} and  {{ic|~/.xprofile}}, in that order. If you are using a shell that does not source any of these files, you can create an  {{ic|~/.xprofile}} to do so. (In this example, the login shell is [[zsh]])
 
{{hc|~/.xprofile|2=
#!/bin/sh
<nowiki>[ -f ~/.config/zsh/.zshenv ] && . ~/.config/zsh/.zshenv</nowiki>
}}
 
If you have shell variables that are important for your display (such as Gtk or QT themes, GNUPG location, configuration overrides, etc.) this will let your graphic environment have access to your environment without having to be launched by your login shell.
 
==== Keymap ====
 
The script runs [[Xkbmap]] with arguments provided in files {{ic|/etc/X11/Xkbmap}}, {{ic|~/.Xkbmap}}. If those files are not found, it runs [[xmodmap]] with {{ic|/etc/X11/Xmodmap}}, {{ic|~/.Xmodmap}}. If using xkbmap, the files are parsed using cat. The following example works
 
{{hc|~/.Xmodmap|2=
-model pc105 -layout us,us,tr -variant ,dvorak,f -option grp:caps_toggle
}}
 
Otherwise, the session inherits the system default mapping of X11. This mapping can be defined in the xorg configuration files, either manually or with {{ic|localectl set-x11-keymap}}. See [[Xorg/Keyboard configuration#Setting keyboard layout]].
 
==== Multiple keyboard layouts in lightdm-gtk-greeter ====
 
To enable users switch between pre-defined keyboard layouts on the log-in screen enable the drop-down menu and configure the layouts. Either use the {{Pkg|lightdm-gtk-greeter-settings}} gui or edit the configuration file directly:
 
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=
[greeter]
indicators = ~host;~spacer;~clock;~spacer;~layout;~language;~session;~a11y;~power
}}
 
Use [[Xorg/Keyboard configuration#Using localectl|localectl]] to set multiple layouts, e.g. de and its “variant” neo with the latter as primary:


{{AUR|lightdm-webkit2-greeter}}: {{ic|/etc/lightdm/lightdm-webkit2-greeter.conf}}
# localectl --no-convert set-x11-keymap de,de pc105 neo,


{{Pkg|lightdm-kde-greeter}}: {{ic|/etc/lightdm/lightdm-kde-greeter.conf}}
Note the trailing comma which implies a blank variant for the second de.


=== Changing background images/colors ===
=== Changing background images/colors ===
Line 85: Line 148:
You can set the background to a hex color or an image. Some greeters offer more robust background options like background selection from the login screen, random backgrounds, etc.
You can set the background to a hex color or an image. Some greeters offer more robust background options like background selection from the login screen, random backgrounds, etc.


==== GTK+ greeter ====
==== GTK greeter ====


You can use the {{Pkg|lightdm-gtk-greeter-settings}} gui.
You can use the {{Pkg|lightdm-gtk-greeter-settings}} gui.
Line 96: Line 159:


{{Note|It is recommended to place the PNG or JPG file in {{ic|/usr/share/pixmaps}} since the LightDM user needs read access to the wallpaper file.}}
{{Note|It is recommended to place the PNG or JPG file in {{ic|/usr/share/pixmaps}} since the LightDM user needs read access to the wallpaper file.}}
GTK3 themes can be specified with the {{ic|theme-name}} variable in the {{ic|[greeter]}} section. The icon and cursor theme can be set in the same way, as shown in the following example:
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=
[greeter]
theme-name = Tela
icon-theme-name = Tela
cursor-theme-name = Tela
cursor-theme-size = 32
font-name = Cantarell 20
}}


==== Webkit2 greeter ====
==== Webkit2 greeter ====


The {{AUR|lightdm-webkit2-greeter}} allows you to choose a background image directly on the login screen. It also offers an option to display a random image each time it starts. By default, images are sourced from {{ic|/usr/share/backgrounds}}. You can change the background images directory by editing {{ic|lightdm-webkit2-greeter.conf}}. For example:
The {{Pkg|lightdm-webkit2-greeter}} allows you to choose a background image directly on the login screen. It also offers an option to display a random image each time it starts if you use the [https://github.com/artur9010/lightdm-webkit-material Material theme]. By default, images are sourced from {{ic|/usr/share/backgrounds}}. You can change the background images directory by editing {{ic|lightdm-webkit2-greeter.conf}}. For example:
{{hc|/etc/lightdm/lightdm-webkit2-greeter.conf|2=
{{hc|/etc/lightdm/lightdm-webkit2-greeter.conf|2=
[branding]
[branding]
Line 105: Line 179:
}}
}}


{{Note|The background images directory must be accessible to the LightDM user so it should not be located anywhere under {{ic|/home}}. }}
{{Note|The background images directory must be accessible to the LightDM user so it should not be located anywhere under {{ic|/home}}.}}
 
==== Unity greeter ====
 
Users using the {{AUR|lightdm-unity-greeter}} must edit the {{ic|/usr/share/glib-2.0/schemas/com.canonical.unity-greeter.gschema.xml}} file and then execute:
# glib-compile-schemas /usr/share/glib-2.0/schemas/
 
According to [https://bbs.archlinux.org/viewtopic.php?id=149945 this] page.
 
==== KDE greeter ====
 
Go to ''System Settings > Login Screen (LightDM)'' and change the background image for your theme.
 
Alternatively, you can edit the {{ic|Background}} variable in {{ic|lightdm-kde-greeter.conf}} :


{{hc|/etc/lightdm/lightdm-kde-greeter.conf|2=
==== Slick Greeter ====
[greeter]
theme-name=classic


[greeter-settings]
Use the {{AUR|lightdm-settings}} GUI
Background=/usr/share/archlinux/wallpaper/archlinux-underground.jpg
BackgroundKeepAspectRatio=true
GreetMessage=Welcome to %hostname%
}}


=== Changing your avatar ===
=== Changing your avatar ===


{{Tip|If you are using KDE, you can change your avatar in KDE System Settings.}}
First, make sure the {{Pkg|accountsservice}} package is installed, then set it up as follows, replacing {{ic|''username''}} with the desired user's login name.
 
First, make sure the {{pkg|accountsservice}} package from the [[official repositories]] is installed, then set it up as follows, replacing {{ic|''username''}} with the desired user's login name. The ''.png'' file extension should not be included in the filename.


* Edit or create the file {{ic|/var/lib/AccountsService/users/''username''}}, and add the lines
* Create the file {{ic|/var/lib/AccountsService/icons/''username''.png}} using a 96x96 PNG image file. Different image file formats are possible too, e.g., JPEG.
* Alternatively, create the image file as {{ic|/home/''username''/.face}} and skip the next step if the defaults already point to the user home directory path
* Edit or create the account settings file {{ic|/var/lib/AccountsService/users/''username''}}, and add the lines


  [User]
  [User]
  Icon=/var/lib/AccountsService/icons/''username''
  Icon=/var/lib/AccountsService/icons/''username''.png


* Create the file {{ic|/var/lib/AccountsService/icons/''username''}} using a 96x96 PNG image file.
The filename here should point to the icon created in the first step, so adjust the filename extension if necessary.


{{Note|Make sure that both created files have 644 permissions, use [[chmod]] to correct them.}}
{{Note|Make sure that both created files have 644 permissions, use [[chmod]] to correct them.}}
Line 147: Line 202:
=== Sources of Arch-centric 64x64 icons ===
=== Sources of Arch-centric 64x64 icons ===


The {{AUR|archlinux-artwork}} package from the [[AUR]] contains some nice examples that install to {{ic|/usr/share/archlinux/icons}} and that can be copied to {{ic|/usr/share/icons/hicolor/64x64/devices}} as follows:
The {{AUR|archlinux-artwork}} package contains some nice examples that install to {{ic|/usr/share/archlinux/icons}} and that can be copied to {{ic|/usr/share/icons/hicolor/64x64/devices}} as follows:


  # find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;
  # find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;
Line 159: Line 214:
{{hc|/etc/lightdm/lightdm.conf|2=
{{hc|/etc/lightdm/lightdm.conf|2=
[Seat:*]
[Seat:*]
pam-service=lightdm
pam-autologin-service=lightdm-autologin
autologin-user=''username''
autologin-user=''username''
autologin-user-timeout=0
session-wrapper=/etc/lightdm/Xsession
}}
}}


LightDM goes through [[PAM]] even when {{ic|autologin}} is enabled. You must be part of the {{ic|autologin}} group to be able to login automatically without entering your password:
You must be part of the {{ic|autologin}} group to be able to login automatically without entering your password:


  # groupadd -r autologin
  # groupadd -r autologin
  # gpasswd -a ''username'' autologin
  # gpasswd -a ''username'' autologin
LightDM logs in using the session specified in the {{ic|~/.dmrc}} of the user getting logged in automatically. To override this file, specify {{ic|autologin-session}} in {{ic|lightdm.conf}}:
{{hc|/etc/lightdm/lightdm.conf|2=
[Seat:*]
autologin-user=''username''
autologin-session=''session''
}}
The list of valid session names can be found by listing {{ic|/usr/share/xsessions/*.desktop}} for X's sessions and {{ic|/usr/share/wayland-sessions/*.desktop}} for Wayland's.


{{Note|GNOME users, and by extension any gnome-keyring user will have to set up a blank password to their keyring for it to be unlocked automatically.}}
{{Note|GNOME users, and by extension any gnome-keyring user will have to set up a blank password to their keyring for it to be unlocked automatically.}}
Line 175: Line 236:
=== Enabling interactive passwordless login ===
=== Enabling interactive passwordless login ===


LightDM goes through PAM so you must configure the lightdm configuration of PAM:
LightDM goes through [[PAM]] so you must configure the lightdm configuration of PAM:


{{hc|/etc/pam.d/lightdm|2=
{{hc|/etc/pam.d/lightdm|2=
Line 184: Line 245:
}}
}}


You must then also be part of the {{ic|nopasswdlogin}} group to be able to login interactively without entering your password:
You must then also be part of the {{ic|nopasswdlogin}} group and the {{ic|autologin}} group to be able to login interactively without entering your password:


  # groupadd -r nopasswdlogin
  # groupadd -r nopasswdlogin
# groupadd -r autologin
  # gpasswd -a ''username'' nopasswdlogin
  # gpasswd -a ''username'' nopasswdlogin
# gpasswd -a ''username'' autologin


{{Note|GNOME users, and by extension any gnome-keyring user may have to follow the instructions at the end of the previous section on enabling autologin.}}
{{Note|GNOME users, and by extension any gnome-keyring user may have to follow the instructions at the end of the previous section on enabling autologin.}}
Line 194: Line 257:


  # useradd -mG autologin,nopasswdlogin -s /bin/bash ''username''
  # useradd -mG autologin,nopasswdlogin -s /bin/bash ''username''
=== Enabling guest sessions ===
{{Note|A guest user has passwordless access to your system after enabling this feature.}}
To enable guest sessions in LightDM (without changing your system configuration) you need at least two things:
# a '''guest-account-script''': defaults to {{ic|guest-account}} and accepts two commands:
#* '''add''' (to create a temporary guest system account and returns the user name of the created account)
#* '''remove''' ''account name''(to delete the corresponding account)
# an [[#Enabling autologin|'''autologin''']] group to which the created guest account must be added (cf. {{ic|/etc/pam.d/lightdm-autologin}})
There are two AUR packages that enable guest sessions in lightdm:
* {{aur|lightdm-guest}} which provides the (largely unmodified) upstream guest-session script as well as {{pkg|lightdm}} itself.
* {{aur|lightdm-guest-account}} which provides only a minimal version of the script.


=== Hiding system and services users ===
=== Hiding system and services users ===
To prevent system users from showing-up in the login, install the optional dependency {{Pkg|accountsservice}}, or add the user names to {{ic|/etc/lightdm/users.conf}} under {{ic|hidden-users}}. The first option has the advantage of not needing to update the list when more users are added or removed.
To prevent system users from showing-up in the login, install the optional dependency {{Pkg|accountsservice}}, or add the user names to {{ic|/etc/lightdm/users.conf}} under {{ic|hidden-users}}. The first option has the advantage of not needing to update the list when more users are added or removed.


=== Migrating from SLiM ===
=== Migrating from SLiM ===
{{Merge|Display Manager|Not LightDM specific (or even SLiM specific for that matter as [[XDM]] also uses [[xinitrc]]). Perhaps this merits a one-liner somewhere on the [[Display Manager]] page?}}


Move the contents of [[xinitrc]] to [[xprofile]], removing the call to start the [[window manager]] or [[desktop environment]].
Move the contents of [[xinitrc]] to [[xprofile]], removing the call to start the [[window manager]] or [[desktop environment]].
=== Login using ~/.xinitrc ===
See [[Display manager#Run ~/.xinitrc as a session]].


=== NumLock on by default ===
=== NumLock on by default ===


Install the {{Pkg|numlockx}} package and then edit {{ic|/etc/lightdm/lightdm.conf}}:
Install the {{Pkg|numlockx}} package and then edit {{ic|/etc/lightdm/lightdm.conf}}:
{{hc|/etc/lightdm/lightdm.conf|2=
{{hc|/etc/lightdm/lightdm.conf|2=
[Seat:*]
[Seat:*]
Line 210: Line 297:
}}
}}


=== User switching under Xfce4 ===
=== Default session ===
 
Lightdm, like other DMs, stores the last-selected xsession in {{ic|~/.dmrc}}. See [[Display manager#Session configuration]] for more info.
 
=== Adjusting the login window's position ===
 
==== GTK greeter ====
 
Users need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and enter a value for the {{ic|position}} variable. It accepts {{ic|x}} and {{ic|y}} values, either absolute (in pixels) or relative (in percent). Each value can also have an additional anchor location for the window, {{ic|start}}, {{ic|center}} and {{ic|end}} separated from the value by a comma.
 
Example:
 
position=200,start 50%,center
 
=== VNC Server ===
 
Lightdm can also be used to connect to via VNC. Make sure to install {{pkg|tigervnc}} on the server side and optionally as your VNC client on the client PC.
 
Setup an authentication password on the server as root:


If you use the [[Xfce]] desktop, the Switch User functionality of the Action Button found in your Application Launcher specifically looks for the ''gdmflexiserver'' executable in order to enable itself. If you provide it with an executable shell script {{ic|/usr/bin/gdmflexiserver}} consisting of
# vncpasswd /etc/vncpasswd


#!/bin/sh
Edit the LightDM configuration file as shown below. Note that {{ic|listen-address}} configures the VNC to only listen to connections from localhost. This is used to only allow connections via [[TigerVNC#On the client|SSH and port forwarding]]. On the SSH client, make sure that you use {{ic|localhost:5900}} for the tunnel destination; using {{ic|127.0.0.1:5900}} or {{ic|::1:5900}} is not reliable on dual stack network connections. If you want to allow insecure connections you can disable this setting.
/usr/bin/dm-tool switch-to-greeter


then user switching in Xfce should work with Lightdm.
{{hc|/etc/lightdm/lightdm.conf|2=
[VNCServer]
enabled=true
command=Xvnc -rfbauth /etc/vncpasswd
port=5900
listen-address=localhost
width=1024
height=768
depth=24
}}


Alternatively, if you use the Whisker Menu, you can go to Properties -> Commands and change the "Switch Users" command directly to:
Now open an SSH tunnel and connect to localhost as described in [[TigerVNC#On the client]].


  dm-tool switch-to-greeter
{{Note|If you get a blank screen upon opening the VNC connection, try a different LightDM greeter.}}


You can also switch users from the [[XScreenSaver]] lock screen - see [[XScreenSaver#LightDM]].
=== Lock the screen using light-locker ===


=== Default session ===
{{Pkg|light-locker}} is a simple screen locker using LightDM to authenticate the user. Once installed and running, you can lock your session via:


Lightdm, like other DMs, stores the last-selected xsession in {{ic|~/.dmrc}}. See [[Display manager#Session list]] for more info.
$ light-locker-command -l


=== Adjusting the login window's position ===
This requires {{ic|light-locker}} to be started at the beginning of your session. By default, this is enabled through [[XDG Autostart]]. See [[Autostarting]] for more options.


==== GTK+ greeter ====
=== Multiple-monitor setup ===


Users need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and enter a value for the {{ic|position}} variable. It accepts {{ic|x}} and {{ic|y}} values, either absolute (in pixels) or relative (in percent). Each value can also have an additional anchor location for the window, {{ic|start}}, {{ic|center}} and {{ic|end}} separated from the value by a comma.
Sometimes LightDM does not set the monitor resolution correctly on a multiple-monitor setup. The following Xorg configuration works with two monitors: a large primary screen on the left side, and a secondary smaller screen to its right. The order can be reversed and tweaked.


Example:
{{hc|/etc/X11/xorg.conf.d/52-resolution-fix.conf|2=
Section "Monitor"
    Identifier "DP1"
    Option "PreferredMode" "3840x2160"
    Option "Primary" "1"
EndSection
Section "Monitor"
    Identifier "eDP1"
    Option "PreferredMode" "1920x1080"
    Option "RightOf" "DP1"
EndSection
}}


position=200,start 50%,center
This makes the {{ic|display-setup-script}} tweaks from {{ic|/etc/lightdm/lightdm.conf}} redundant.


== Troubleshooting ==
== Troubleshooting ==
If you encounter consistent screen flashing and ultimately no LightDM on boot, ensure that you have defined the greeter correctly in LightDM's config file. And if you have correctly defined the GTK greeter, make sure the {{ic|xsessions-directory}} (default: {{ic|/usr/share/xsessions}}) exists and contains at least one .desktop file.
 
=== Autologin does not work ===
 
Ensure {{ic|1=autologin-user=}} in {{ic|/etc/lightdm/lightdm.conf}} contain the correct values. Trailing whitespace will cause errors.
 
If autologin fails with a blank screen or if the login screen immediately returns, you may need to set {{ic|1=logind-check-graphical=true}}.
 
You can also install {{AUR|lightdm-autologin-greeter-git}} for this special purpose.
 
=== Viewing current configuration ===
 
To view effective configuration, run:
 
$ lightdm --show-config
 
This will show current settings, with the configuration files these settings were read from.
 
=== LightDM not starting and screen flashing ===
 
If you encounter consistent screen flashing and ultimately no LightDM on boot, ensure that you have defined the greeter correctly in LightDM's configuration file. And if you have correctly defined the GTK greeter, make sure the {{ic|xsessions-directory}} (default: {{ic|/usr/share/xsessions}}) exists and contains at least one .desktop file.


The same error can happen on lightdm startup if the last used session is not available anymore (eg. you last used gnome and then removed the gnome-session package): the easiest workaround is to temporarily restore the removed package. Another solution might be:
The same error can happen on lightdm startup if the last used session is not available anymore (eg. you last used gnome and then removed the gnome-session package): the easiest workaround is to temporarily restore the removed package. Another solution might be:
Line 250: Line 393:
=== Wrong locale displayed ===
=== Wrong locale displayed ===


In case of your locale not being displayed correctly in Lightdm add your locale to {{ic|/etc/environment}}
In case of your locale not being displayed correctly in Lightdm add your locale to {{ic|/etc/environment}}:
  LANG=pt_PT.utf8
 
LANG=pt_PT.utf8
 
Alternatively if you want LightDM and its greeters to be in a language other than your set system locale, you can use the {{ic|1=Environment=}} option in [[Systemd#Drop-in files]].


=== Xresources not being parsed correctly ===
=== Unresponsive for a few minutes after startup ===


LightDM has an [https://bugs.launchpad.net/lightdm/+bug/1084885 upstream bug] where your [[Xresources]] file will not be loaded with a pre-processor. In practical terms, this means that variables set with {{ic|#define}} are not expanded when called later. You may see this reflected as an all-pink screen if using a custom color set with urxvt. To fix it, edit {{ic|/etc/lightdm/Xsession}} and search for the line:
You may have to download more entropy. Install and enable haveged, c.f. https://github.com/canonical/lightdm/issues/17
xrdb -nocpp -merge "$file"
Change it to read:
xrdb -merge "$file"
Your Xresources will now be pre-processed so that variables are correctly expanded.


=== Missing icons with GTK greeter ===
=== Missing icons with GTK greeter ===


If you're using {{Pkg|lightdm-gtk-greeter}} as a greeter and it shows placeholder images as icons, make sure valid icon themes and themes are installed and configured. Check the following file:
If you are using {{Pkg|lightdm-gtk-greeter}} as a greeter and it shows placeholder images as icons, make sure valid icon themes and themes are installed and configured. Check the following file:


{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=
Line 279: Line 421:
If you are using multiple monitors, LightDM may display in the wrong one (e.g. if your primary monitor is on the right). To force the LightDM login screen to display on a specific monitor, edit {{ic|/etc/lightdm/lightdm.conf}} and change the ''display-setup-script'' parameter like this:
If you are using multiple monitors, LightDM may display in the wrong one (e.g. if your primary monitor is on the right). To force the LightDM login screen to display on a specific monitor, edit {{ic|/etc/lightdm/lightdm.conf}} and change the ''display-setup-script'' parameter like this:
{{hc|/etc/lightdm/lightdm.conf|2=
{{hc|/etc/lightdm/lightdm.conf|2=
display-setup-script=xrandr --output ''HDMI1'' --primary
display-setup-script=xrandr --output ''HDMI-1'' --primary
}}
 
Replace ''HDMI-1'' with your real monitor ID, which you can find from '''xrandr''' command output.
 
Alternatively, if you are using the GTK greeter, you can edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} and add the ''active-monitor'' parameter like this:
{{hc|/etc/lightdm/lightdm-gtk-greeter.conf|2=
[greeter]
active-monitor=0
}}
}}


Replace ''HDMI1'' with your real monitor ID, which you can find from '''xrandr''' command output.
Replace 0 with the desired display number.
 
=== LightDM does not appear or monitor only displays TTY output ===
 
It may happen that your system boots so fast that LightDM service is started before your graphics drivers are properly loaded. If this is your case, you will want to add the following to your {{ic|lightdm.conf}} file:
 
{{hc|/etc/lightdm/lightdm.conf|2=
[LightDM]
logind-check-graphical=true
}}


=== LightDM doesn't appear ===
This setting will tell LightDM to wait until graphics devices are ready before spawning greeters/autostarting sessions on them. 


It may happen that your system boots so fast that LightDM service is started before your graphics drivers are properly loaded. If this is your case, you'll want to add the following config to your lightdm.conf file:
'''With newer versions of LightDM, this is now the default setting.'''  As a consequence, on some hardware, your graphics drivers may not be properly detected and LightDM may never attempt to launch a greeter--even after the system has stabilized after boot. If this occurs, setting this to false will disable the check and force LightDM to launch a greeter regardless.


    [LightDM]
=== LightDM is running with low FPS on Intel Graphics ===
    logind-check-graphical=true


This setting will tell LightDM to wait until graphics devices are ready before spawning greeters/autostarting sessions on them.
See [[Intel graphics#AccelMethod]].


=== Pulseaudio not starting automatically ===
=== Pulseaudio not starting automatically ===


See [[PulseAudio#Running]].
See [[PulseAudio#Running]].
=== Long pause before LightDM shows up when home is encrypted ===
Some LightDM themes try to access the user avatar located in HOME. If your HOME is encrypted, LightDM cannot access it and hangs. To prevent this from happening, you can either:
* Set your avatar as explained in [[#Changing your avatar]]
* for {{Pkg|lightdm-gtk-greeter}} only: {{Ic|<nowiki>hide-user-image = true</nowiki>}} in {{Ic|/etc/lightdm/lightdm-gtk-greeter.conf}}
=== Boot hangs on "[  OK  ] Reached target Graphical Interface." ===
There is a possibility that user and group lookups fail if you modified {{ic|/etc/nsswitch.conf}}. That happens when {{ic|nsswitch.conf}} group: includes {{ic|ldap}} without setting {{ic|nss_initgroups_ignoreusers ALLLOCAL}} in {{ic|/etc/nslcd.conf}}
=== Wayland session not working with duplicate GNOME entries in greeter ===
Some greeters ({{Pkg|lightdm-webkit2-greeter}} for example) do not support two sessions with the same name [https://github.com/canonical/lightdm/issues/16]. To check for duplicate entries:
$ ls -1 /usr/share/wayland-sessions /usr/share/xsessions
Rename the duplicate entry in {{ic|/usr/share/xsessions}}. For example:
# mv /usr/share/xsessions/gnome.desktop /usr/share/xsessions/gnome.desktop.disabled
=== Login always segfaults on first attempt ===
Set a hostname as described in [[Network configuration#Set the hostname|Network Page]]. See also {{Bug|47694}}.
=== Infinite login loop ===
If you get stuck in loop in which you type your correct username and password but the screen goes black and then you return to the login prompt after every attempt, running {{ic|rm ~/.Xauthority}} (or the stuck user's problematic {{ic|.Xauthority}}) may fix the issue.
Another reason for this may be that you tried to recreate your "lightdm.conf" from scratch and your version is missing this line:
session-wrapper=/etc/lightdm/Xsession
In that case, lightdm tries to use "lightdm-session" as the session-wrapper which does not exist on Arch Linux.
If your lightdm.conf file contains the intended session-wrapper but the lightdm logs indicate that the default session wrapper is being used instead, ensure that your lightdm.conf file is available during startup. For example, you may have created a symlink to a file in your home directory, but your home directory is not being mounted before the LightDM service started. In such cases LightDM will fall back to the default session wrapper.


== See also ==
== See also ==


* {{Pkg|light-locker}}, a screen locker using LightDM.
* [https://wiki.ubuntu.com/LightDM Ubuntu Wiki article]
* [https://wiki.ubuntu.com/LightDM Ubuntu Wiki article]
* [http://wiki.gentoo.org/wiki/LightDM Gentoo Wiki article]
* [[Gentoo:LightDM]]
* [https://launchpad.net/lightdm Launchpad Page]
* [https://launchpad.net/lightdm Launchpad Page] obsolete
* [http://www.mattfischer.com/blog/?tag=lightdm LightDM blog]
* https://wiki.ubuntu.com/MattFischer
* [https://github.com/CanonicalLtd/lightdm LightDM on GitHub]

Latest revision as of 01:15, 16 January 2024

LightDM is a cross-desktop display manager. Its key features are:

  • Cross-desktop - supports different desktop technologies.
  • Supports different display technologies (X, Mir, Wayland ...).
  • Lightweight - low memory usage and high performance.
  • Supports guest sessions.
  • Supports remote login (incoming - XDMCP, VNC, outgoing - XDMCP, PAM).
  • Comprehensive test suite.
  • Low code complexity.

More details about LightDM's design can be found here.

Installation

Install the lightdm package or lightdm-gitAUR for the development version.

Greeter

You will probably want to install a greeter. A greeter is a GUI that prompts the user for credentials, lets the user select a session, and so on. It is possible to use LightDM without a greeter, but only if an automatic login is configured; otherwise you will need to install xorg-server and one of the greeter packages below.

The official repositories contain the following greeters:

Other alternative greeters are available in the AUR:

You can set the default greeter by changing the [Seat:*] section of the LightDM configuration file, like so:

/etc/lightdm/lightdm.conf
[Seat:*]
...
greeter-session=lightdm-yourgreeter-greeter
...
Note: lightdm-pantheon-greeter's corresponding configuration file is io.elementary.greeter.conf, not lightdm-pantheon-greeter.conf

One way to check which greeters are available is to list the files in the /usr/share/xgreeters directory; each .desktop file represents an available greeter. In this example, the lightdm-gtk-greeter and lightdm-webkit2-greeter greeters are available:

$ ls -1 /usr/share/xgreeters/
lightdm-gtk-greeter.desktop
lightdm-webkit2-greeter.desktop

Enabling LightDM

Make sure to enable lightdm.service so LightDM will be started at boot; see also Display manager#Loading the display manager.

Command line tool

LightDM offers a command line tool, dm-tool, which can be used to lock the current seat, switch sessions, etc, which is useful with 'minimalist' window managers and for testing. To see a list of available commands, execute:

$ dm-tool --help

User switching

Warning: dm-tool (with dm-tool lock or dm-tool switch-to-greeter) can easily be bypassed and will not lock your session without light-locker or an other loginctl compatible screen locker. See XScreenSaver#User switching from the lock screen.

LightDM's dm-tool command can be used to allow multiple users to be logged in on separate ttys. The following will send a signal requesting that the current session be locked and then will initiate a switch to LightDM's greeter, allowing a new user to log in to the system.

$ dm-tool switch-to-greeter

Testing

First, install xorg-server-xephyr.

Then, run LightDM as an X application:

$ lightdm --test-mode --debug

Optional configuration and tweaks

LightDM can be configured by modifying its configuration file, /etc/lightdm/lightdm.conf.

Some greeters have their own configuration files. For example:

lightdm-gtk-greeter: /etc/lightdm/lightdm-gtk-greeter.conf (or you can use the lightdm-gtk-greeter-settings gui).

lightdm-webkit2-greeter: /etc/lightdm/lightdm-webkit2-greeter.conf

X session wrapper

This article or section is a candidate for merging with Xprofile.

Notes: Duplicated information (Discuss in Talk:LightDM)

If you are migrating from xinit, you will notice that the display is not launched by your shell. This is because, as opposed to your shell starting the display (and the display inheriting the environment of your shell), LightDM starts your display and does not source your shell. LightDM launches the display by running a wrapper script and that finally exec's your graphic environment. By default, /etc/lightdm/Xsession is run.

Environment variables

The script checks and sources /etc/profile, ~/.profile, /etc/xprofile and ~/.xprofile, in that order. If you are using a shell that does not source any of these files, you can create an ~/.xprofile to do so. (In this example, the login shell is zsh)

~/.xprofile
#!/bin/sh
[ -f ~/.config/zsh/.zshenv ] && . ~/.config/zsh/.zshenv

If you have shell variables that are important for your display (such as Gtk or QT themes, GNUPG location, configuration overrides, etc.) this will let your graphic environment have access to your environment without having to be launched by your login shell.

Keymap

The script runs Xkbmap with arguments provided in files /etc/X11/Xkbmap, ~/.Xkbmap. If those files are not found, it runs xmodmap with /etc/X11/Xmodmap, ~/.Xmodmap. If using xkbmap, the files are parsed using cat. The following example works

~/.Xmodmap
-model pc105 -layout us,us,tr -variant ,dvorak,f -option grp:caps_toggle

Otherwise, the session inherits the system default mapping of X11. This mapping can be defined in the xorg configuration files, either manually or with localectl set-x11-keymap. See Xorg/Keyboard configuration#Setting keyboard layout.

Multiple keyboard layouts in lightdm-gtk-greeter

To enable users switch between pre-defined keyboard layouts on the log-in screen enable the drop-down menu and configure the layouts. Either use the lightdm-gtk-greeter-settings gui or edit the configuration file directly:

/etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
indicators = ~host;~spacer;~clock;~spacer;~layout;~language;~session;~a11y;~power

Use localectl to set multiple layouts, e.g. de and its “variant” neo with the latter as primary:

# localectl --no-convert set-x11-keymap de,de pc105 neo,

Note the trailing comma which implies a blank variant for the second de.

Changing background images/colors

You can set the background to a hex color or an image. Some greeters offer more robust background options like background selection from the login screen, random backgrounds, etc.

GTK greeter

You can use the lightdm-gtk-greeter-settings gui.

Users wishing to customize the wallpaper on the greeter screen need to edit /etc/lightdm/lightdm-gtk-greeter.conf and define the background variable under the [greeter] section. For example:

/etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg
Note: It is recommended to place the PNG or JPG file in /usr/share/pixmaps since the LightDM user needs read access to the wallpaper file.

GTK3 themes can be specified with the theme-name variable in the [greeter] section. The icon and cursor theme can be set in the same way, as shown in the following example:

/etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
theme-name = Tela
icon-theme-name = Tela
cursor-theme-name = Tela
cursor-theme-size = 32
font-name = Cantarell 20

Webkit2 greeter

The lightdm-webkit2-greeter allows you to choose a background image directly on the login screen. It also offers an option to display a random image each time it starts if you use the Material theme. By default, images are sourced from /usr/share/backgrounds. You can change the background images directory by editing lightdm-webkit2-greeter.conf. For example:

/etc/lightdm/lightdm-webkit2-greeter.conf
[branding]
background_images = /usr/share/backgrounds
Note: The background images directory must be accessible to the LightDM user so it should not be located anywhere under /home.

Slick Greeter

Use the lightdm-settingsAUR GUI

Changing your avatar

First, make sure the accountsservice package is installed, then set it up as follows, replacing username with the desired user's login name.

  • Create the file /var/lib/AccountsService/icons/username.png using a 96x96 PNG image file. Different image file formats are possible too, e.g., JPEG.
  • Alternatively, create the image file as /home/username/.face and skip the next step if the defaults already point to the user home directory path
  • Edit or create the account settings file /var/lib/AccountsService/users/username, and add the lines
[User]
Icon=/var/lib/AccountsService/icons/username.png

The filename here should point to the icon created in the first step, so adjust the filename extension if necessary.

Note: Make sure that both created files have 644 permissions, use chmod to correct them.

Sources of Arch-centric 64x64 icons

The archlinux-artworkAUR package contains some nice examples that install to /usr/share/archlinux/icons and that can be copied to /usr/share/icons/hicolor/64x64/devices as follows:

# find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;

After copying, the archlinux-artworkAUR package can be removed.

Enabling autologin

Edit the LightDM configuration file and ensure these lines are uncommented and correctly configured:

/etc/lightdm/lightdm.conf
[Seat:*]
autologin-user=username

You must be part of the autologin group to be able to login automatically without entering your password:

# groupadd -r autologin
# gpasswd -a username autologin

LightDM logs in using the session specified in the ~/.dmrc of the user getting logged in automatically. To override this file, specify autologin-session in lightdm.conf:

/etc/lightdm/lightdm.conf
[Seat:*]
autologin-user=username
autologin-session=session

The list of valid session names can be found by listing /usr/share/xsessions/*.desktop for X's sessions and /usr/share/wayland-sessions/*.desktop for Wayland's.

Note: GNOME users, and by extension any gnome-keyring user will have to set up a blank password to their keyring for it to be unlocked automatically.

Enabling interactive passwordless login

LightDM goes through PAM so you must configure the lightdm configuration of PAM:

/etc/pam.d/lightdm
#%PAM-1.0
auth        sufficient  pam_succeed_if.so user ingroup nopasswdlogin
auth        include     system-login
...

You must then also be part of the nopasswdlogin group and the autologin group to be able to login interactively without entering your password:

# groupadd -r nopasswdlogin
# groupadd -r autologin
# gpasswd -a username nopasswdlogin
# gpasswd -a username autologin
Note: GNOME users, and by extension any gnome-keyring user may have to follow the instructions at the end of the previous section on enabling autologin.

To create a new user account that logs in automatically and additionally able to login again without a password the user can be created with supplementary membership of both groups, e.g.:

# useradd -mG autologin,nopasswdlogin -s /bin/bash username

Enabling guest sessions

Note: A guest user has passwordless access to your system after enabling this feature.

To enable guest sessions in LightDM (without changing your system configuration) you need at least two things:

  1. a guest-account-script: defaults to guest-account and accepts two commands:
    • add (to create a temporary guest system account and returns the user name of the created account)
    • remove account name(to delete the corresponding account)
  2. an autologin group to which the created guest account must be added (cf. /etc/pam.d/lightdm-autologin)

There are two AUR packages that enable guest sessions in lightdm:

Hiding system and services users

To prevent system users from showing-up in the login, install the optional dependency accountsservice, or add the user names to /etc/lightdm/users.conf under hidden-users. The first option has the advantage of not needing to update the list when more users are added or removed.

Migrating from SLiM

This article or section is a candidate for merging with Display Manager.

Notes: Not LightDM specific (or even SLiM specific for that matter as XDM also uses xinitrc). Perhaps this merits a one-liner somewhere on the Display Manager page? (Discuss in Talk:LightDM)

Move the contents of xinitrc to xprofile, removing the call to start the window manager or desktop environment.

Login using ~/.xinitrc

See Display manager#Run ~/.xinitrc as a session.

NumLock on by default

Install the numlockx package and then edit /etc/lightdm/lightdm.conf:

/etc/lightdm/lightdm.conf
[Seat:*]
greeter-setup-script=/usr/bin/numlockx on

Default session

Lightdm, like other DMs, stores the last-selected xsession in ~/.dmrc. See Display manager#Session configuration for more info.

Adjusting the login window's position

GTK greeter

Users need to edit /etc/lightdm/lightdm-gtk-greeter.conf and enter a value for the position variable. It accepts x and y values, either absolute (in pixels) or relative (in percent). Each value can also have an additional anchor location for the window, start, center and end separated from the value by a comma.

Example:

position=200,start 50%,center

VNC Server

Lightdm can also be used to connect to via VNC. Make sure to install tigervnc on the server side and optionally as your VNC client on the client PC.

Setup an authentication password on the server as root:

# vncpasswd /etc/vncpasswd

Edit the LightDM configuration file as shown below. Note that listen-address configures the VNC to only listen to connections from localhost. This is used to only allow connections via SSH and port forwarding. On the SSH client, make sure that you use localhost:5900 for the tunnel destination; using 127.0.0.1:5900 or ::1:5900 is not reliable on dual stack network connections. If you want to allow insecure connections you can disable this setting.

/etc/lightdm/lightdm.conf
[VNCServer]
enabled=true
command=Xvnc -rfbauth /etc/vncpasswd
port=5900
listen-address=localhost
width=1024
height=768
depth=24

Now open an SSH tunnel and connect to localhost as described in TigerVNC#On the client.

Note: If you get a blank screen upon opening the VNC connection, try a different LightDM greeter.

Lock the screen using light-locker

light-locker is a simple screen locker using LightDM to authenticate the user. Once installed and running, you can lock your session via:

$ light-locker-command -l

This requires light-locker to be started at the beginning of your session. By default, this is enabled through XDG Autostart. See Autostarting for more options.

Multiple-monitor setup

Sometimes LightDM does not set the monitor resolution correctly on a multiple-monitor setup. The following Xorg configuration works with two monitors: a large primary screen on the left side, and a secondary smaller screen to its right. The order can be reversed and tweaked.

/etc/X11/xorg.conf.d/52-resolution-fix.conf
Section "Monitor"
    Identifier "DP1"
    Option "PreferredMode" "3840x2160"
    Option "Primary" "1"
EndSection
Section "Monitor"
    Identifier "eDP1"
    Option "PreferredMode" "1920x1080"
    Option "RightOf" "DP1"
EndSection

This makes the display-setup-script tweaks from /etc/lightdm/lightdm.conf redundant.

Troubleshooting

Autologin does not work

Ensure autologin-user= in /etc/lightdm/lightdm.conf contain the correct values. Trailing whitespace will cause errors.

If autologin fails with a blank screen or if the login screen immediately returns, you may need to set logind-check-graphical=true.

You can also install lightdm-autologin-greeter-gitAUR for this special purpose.

Viewing current configuration

To view effective configuration, run:

$ lightdm --show-config

This will show current settings, with the configuration files these settings were read from.

LightDM not starting and screen flashing

If you encounter consistent screen flashing and ultimately no LightDM on boot, ensure that you have defined the greeter correctly in LightDM's configuration file. And if you have correctly defined the GTK greeter, make sure the xsessions-directory (default: /usr/share/xsessions) exists and contains at least one .desktop file.

The same error can happen on lightdm startup if the last used session is not available anymore (eg. you last used gnome and then removed the gnome-session package): the easiest workaround is to temporarily restore the removed package. Another solution might be:

# dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User.SetXSession string:xfce

This example sets the session "xfce" as default for the user 1000.

Wrong locale displayed

In case of your locale not being displayed correctly in Lightdm add your locale to /etc/environment:

LANG=pt_PT.utf8

Alternatively if you want LightDM and its greeters to be in a language other than your set system locale, you can use the Environment= option in Systemd#Drop-in files.

Unresponsive for a few minutes after startup

You may have to download more entropy. Install and enable haveged, c.f. https://github.com/canonical/lightdm/issues/17

Missing icons with GTK greeter

If you are using lightdm-gtk-greeter as a greeter and it shows placeholder images as icons, make sure valid icon themes and themes are installed and configured. Check the following file:

/etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
theme-name=mate      # this should be the name of a directory under /usr/share/themes/
icon-theme-name=mate # this should be the name of a fully featured icons set directory under /usr/share/icons/

LightDM freezes on login attempt

You may find that after entering the correct username and password and attempting to log in, LightDM freezes and you are unable to continue to the desktop. To fix the issue, reinstall the gdk-pixbuf2 package. See this forum thread.

LightDM displaying in wrong monitor

If you are using multiple monitors, LightDM may display in the wrong one (e.g. if your primary monitor is on the right). To force the LightDM login screen to display on a specific monitor, edit /etc/lightdm/lightdm.conf and change the display-setup-script parameter like this:

/etc/lightdm/lightdm.conf
display-setup-script=xrandr --output HDMI-1 --primary

Replace HDMI-1 with your real monitor ID, which you can find from xrandr command output.

Alternatively, if you are using the GTK greeter, you can edit /etc/lightdm/lightdm-gtk-greeter.conf and add the active-monitor parameter like this:

/etc/lightdm/lightdm-gtk-greeter.conf
[greeter]
active-monitor=0

Replace 0 with the desired display number.

LightDM does not appear or monitor only displays TTY output

It may happen that your system boots so fast that LightDM service is started before your graphics drivers are properly loaded. If this is your case, you will want to add the following to your lightdm.conf file:

/etc/lightdm/lightdm.conf
[LightDM]
logind-check-graphical=true

This setting will tell LightDM to wait until graphics devices are ready before spawning greeters/autostarting sessions on them.

With newer versions of LightDM, this is now the default setting. As a consequence, on some hardware, your graphics drivers may not be properly detected and LightDM may never attempt to launch a greeter--even after the system has stabilized after boot. If this occurs, setting this to false will disable the check and force LightDM to launch a greeter regardless.

LightDM is running with low FPS on Intel Graphics

See Intel graphics#AccelMethod.

Pulseaudio not starting automatically

See PulseAudio#Running.

Long pause before LightDM shows up when home is encrypted

Some LightDM themes try to access the user avatar located in HOME. If your HOME is encrypted, LightDM cannot access it and hangs. To prevent this from happening, you can either:

Boot hangs on "[ OK ] Reached target Graphical Interface."

There is a possibility that user and group lookups fail if you modified /etc/nsswitch.conf. That happens when nsswitch.conf group: includes ldap without setting nss_initgroups_ignoreusers ALLLOCAL in /etc/nslcd.conf

Wayland session not working with duplicate GNOME entries in greeter

Some greeters (lightdm-webkit2-greeter for example) do not support two sessions with the same name [1]. To check for duplicate entries:

$ ls -1 /usr/share/wayland-sessions /usr/share/xsessions

Rename the duplicate entry in /usr/share/xsessions. For example:

# mv /usr/share/xsessions/gnome.desktop /usr/share/xsessions/gnome.desktop.disabled

Login always segfaults on first attempt

Set a hostname as described in Network Page. See also FS#47694.

Infinite login loop

If you get stuck in loop in which you type your correct username and password but the screen goes black and then you return to the login prompt after every attempt, running rm ~/.Xauthority (or the stuck user's problematic .Xauthority) may fix the issue.

Another reason for this may be that you tried to recreate your "lightdm.conf" from scratch and your version is missing this line:

session-wrapper=/etc/lightdm/Xsession

In that case, lightdm tries to use "lightdm-session" as the session-wrapper which does not exist on Arch Linux.

If your lightdm.conf file contains the intended session-wrapper but the lightdm logs indicate that the default session wrapper is being used instead, ensure that your lightdm.conf file is available during startup. For example, you may have created a symlink to a file in your home directory, but your home directory is not being mounted before the LightDM service started. In such cases LightDM will fall back to the default session wrapper.

See also