Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LightDM cannot launch KDE Plasma (Wayland) [Solved]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2052
Location: United Kingdom

PostPosted: Wed Jul 05, 2023 8:18 pm    Post subject: LightDM cannot launch KDE Plasma (Wayland) [Solved] Reply with quote

My Compal NBLB2 laptop* runs Gentoo Linux (~amd64) with OpenRC and elogind. It uses SDDM as the display manager, and KDE Plasma as the desktop environment. It can launch a desktop session with either KDE Plasma (X11) or with KDE Plasma (Wayland).
* Intel Core i7-720QM Clarksfield 1st Generation i7 CPU and ATI Mobility Radeon HD 5650 GPU.

My Clevo W230SS laptop** runs Gentoo Linux (amd64) with OpenRC and elogind. It uses the LightDM display manager, and KDE Plasma as the desktop environment. It can only launch a desktop session with KDE Plasma (X11). Trying to launch KDE Plasma (Wayland) results in a blank screen with a blinking cursor in the top left corner.
** Intel Core i7-4810MQ Haswell 4th Generation i7 CPU with Intel HD Graphics 4600 GT2 IGP, and NVIDIA Optimus with NVIDIA GeForce GTX 860M GPU.

I have been investigating the problem with the installation on the Clevo W230SS laptop. I have no need to run Plasma (Wayland); I am just curious as to why LightDM cannot launch a Plasma Wayland session on that laptop. The versions of the relevant packages are as follows:

Code:
# eix -I plasma-meta
[I] kde-plasma/plasma-meta
     Available versions:  (5) 5.27.5 ~5.27.6
       {accessibility bluetooth +browser-integration colord +crash-handler crypt +desktop-portal discover +display-manager +elogind +firewall grub gtk +handbook +kwallet +legacy-systray +networkmanager plymouth pulseaudio +sddm sdk +smart systemd thunderbolt +wallpapers}
     Installed versions:  5.27.5(5)(15:05:09 24/06/23)(bluetooth browser-integration crash-handler crypt desktop-portal display-manager elogind gtk handbook kwallet legacy-systray networkmanager pulseaudio smart wallpapers -accessibility -colord -discover -firewall -grub -plymouth -sddm -sdk -systemd -thunderbolt)
     Homepage:            https://kde.org/plasma-desktop/
     Description:         Merge this to pull in all Plasma 5 packages


Code:
# eix -I lightdm
[I] acct-group/lightdm
     Available versions:  0-r1
     Installed versions:  0-r1(18:50:26 24/05/22)
     Description:         A group for x11-misc/lightdm

[I] acct-user/lightdm
     Available versions:  0
     Installed versions:  0(19:14:14 24/05/22)
     Description:         A user for x11-misc/lightdm

[I] x11-misc/lightdm
     Available versions:  1.32.0-r2^t {audit elogind +gnome +gtk +introspection non-root qt5 systemd vala}
     Installed versions:  1.32.0-r2^t(03:16:59 04/05/23)(elogind gtk introspection qt5 -audit -gnome -non-root -systemd -vala)
     Homepage:            https://github.com/canonical/lightdm
     Description:         A lightweight display manager

[I] x11-misc/lightdm-gtk-greeter
     Available versions:  2.0.8-r1 {appindicator branding}
     Installed versions:  2.0.8-r1(16:51:33 23/06/23)(-appindicator -branding)
     Homepage:            https://github.com/Xubuntu/lightdm-gtk-greeter
     Description:         LightDM GTK+ Greeter

Found 4 matches


The Desktop Configuration Files are what I would have expected:

Code:
# ls /usr/share/xsessions/
Xsession.desktop  plasma.desktop

Code:
# grep Exec /usr/share/xsessions/plasma.desktop
Exec=/usr/bin/startplasma-x11
TryExec=/usr/bin/startplasma-x11


Code:
# ls /usr/share/wayland-sessions/
plasmawayland.desktop

Code:
# grep Exec /usr/share/wayland-sessions/plasmawayland.desktop
Exec=/usr/lib64/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland
TryExec=/usr/bin/startplasma-wayland


LightDM uses the plasmawayland.desktop file to (try to) launch the Plasma Wayland session.

LightDM and the LightDM GTK Greeter are currently configured as follows:

Code:
# grep -v "^#\|^$\|^\[" /etc/lightdm/lightdm.conf
greeter-session=lightdm-gtk-greeter
session-wrapper=/etc/lightdm/Xsession


Code:
# grep -v "^#\|^$\|^\[" /etc/lightdm/lightdm-gtk-greeter.conf
background=/usr/share/wallpapers/larry-the-cow/gentoo-cow-gdm-remake-1920x1080.png
indicators=~host;~spacer;~clock;~spacer;~session;~language;~power


(Other distributions, such as Debian and Arch Linux, also use an Xsession script as the session wrapper in LightDM, yet those distributions are apparently able to launch a Wayland session.)

If I select 'Plasma (X11)' in the Sessions menu on the LightDM greeter, LightDM can successfully launch a Plasma X11 desktop on VT7. However, if I select 'Plasma (Wayland)' in the Sessions menu on the LightDM greeter, a blank screen with blinking cursor in the top left corner is displayed. (The same type of display occurs on VT7 to VT11).

If I switch to e.g. VT2 (Ctrl+Alt+F2) and login to my user account, I can successfully launch a Plasma Wayland desktop on VT2 by entering the following on the command line:

Code:
$ dbus-launch --exit-with-session startplasma-wayland

The above command works irrespective of whether or not LightDM is running on VT7 (I can stop LightDM running by using the command 'rc-service display-manager stop' on a VT as root user).

Although LightDM itself uses the X Server, apparently it can still be used to launch a Wayland session, as others have done. See, for example:

https://github.com/canonical/lightdm/issues/63#issuecomment-497987787

Stephane Chauveau wrote:
Remark: If I remember well, Lightdm on Debian starts its Wayland sessions exactly like regular X11 sessions by calling the script /etc/Xsession which itself executes everything in /etc/Xsession.d/* and eventually calls the program specified in the session file.


See also the Arch Linux Wiki page for LightDM (albeit Arch Linux uses systemd rather than OpenRC): https://wiki.archlinux.org/title/LightDM

Similarly, LightDM in Arch Linux uses a session wrapper script named /etc/lightdm/Xsession.

LightDM in Gentoo Linux also uses a session-wrapper script named /etc/lightdm/Xsession. Although the session wrapper should be generic to cater for both X11 and Wayland, I do not think the existing X11-specific Xsession script is the cause of the problem, especially given what Stephane Chauveau wrote (see quote above). If I remove the Xsession file, selecting 'Plasma (X11)' on the LightDM greeter can still launch a Plasma X11 desktop, but selecting 'Plasma (Wayland)' still results in a blank screen with a blinking cursor.

Below are the contents of the file /var/log/lightdm/lightdm.log immediately after rebooting the laptop and before attempting to login to a 'Plasma (Wayland)' session via the LightDM greeter on VT7:

Code:
[+0.04s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.04s] DEBUG: Starting Light Display Manager 1.32.0, UID=0 PID=3381
[+0.04s] DEBUG: Loading configuration dirs from /etc/eselect/wine/share/lightdm/lightdm.conf.d
[+0.04s] DEBUG: Loading configuration dirs from /usr/share/lightdm/lightdm.conf.d
[+0.04s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d
[+0.04s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d
[+0.04s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf
[+0.04s] DEBUG: Registered seat module local
[+0.04s] DEBUG: Registered seat module xremote
[+0.04s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.04s] DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’
[+0.04s] DEBUG: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
[+0.42s] DEBUG: Monitoring logind for seats
[+0.42s] DEBUG: New seat added from logind: seat0
[+0.43s] DEBUG: Seat seat0: Loading properties from config section Seat:*
[+0.43s] DEBUG: Seat seat0 has property CanMultiSession=no
[+0.43s] DEBUG: Seat seat0: Starting
[+0.43s] DEBUG: Seat seat0: Creating greeter session
[+0.49s] DEBUG: Seat seat0: Creating display server of type x
[+0.50s] DEBUG: Could not run plymouth --ping: Failed to execute child process “plymouth” (No such file or directory)
[+0.50s] DEBUG: Using VT 7
[+0.50s] DEBUG: Seat seat0: Starting local X display on VT 7
[+0.50s] DEBUG: XServer 0: Logging to /var/log/lightdm/x-0.log
[+0.56s] DEBUG: XServer 0: Writing X server authority to /var/run/lightdm/root/:0
[+0.56s] DEBUG: XServer 0: Launching X Server
[+0.56s] DEBUG: Launching process 3460: /usr/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
[+0.56s] DEBUG: XServer 0: Waiting for ready signal from X server :0
[+0.56s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.56s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+1.47s] DEBUG: Loading users from org.freedesktop.Accounts
[+1.47s] DEBUG: User /org/freedesktop/Accounts/User1001 added
[+2.70s] DEBUG: User /org/freedesktop/Accounts/User1000 added
[+8.49s] DEBUG: Got signal 10 from process 3460
[+8.49s] DEBUG: XServer 0: Got signal from X server :0
[+8.49s] DEBUG: XServer 0: Connecting to XServer :0
[+8.70s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+8.70s] DEBUG: Session pid=3509: Started with service 'lightdm-greeter', username 'root'
[+8.96s] DEBUG: Session pid=3509: Authentication complete with return value 0: Success
[+8.96s] DEBUG: Seat seat0: Session authenticated, running command
[+8.96s] DEBUG: Session pid=3509: Running command /usr/sbin/lightdm-gtk-greeter
[+8.96s] DEBUG: Creating shared data directory /var/lib/lightdm-data/root
[+8.96s] DEBUG: Session pid=3509: Logging to /var/log/lightdm/seat0-greeter.log
[+9.01s] DEBUG: Activating VT 7
[+9.01s] DEBUG: Activating login1 session 3
[+9.01s] DEBUG: Seat seat0 changes active session to 3
[+9.01s] DEBUG: Session 3 is already active
[+11.12s] DEBUG: Greeter connected version=1.32.0 api=1 resettable=false
[+13.41s] DEBUG: Greeter start authentication for fitzcarraldo
[+13.41s] DEBUG: Session pid=3552: Started with service 'lightdm', username 'fitzcarraldo'
[+13.47s] DEBUG: Session pid=3552: Got 1 message(s) from PAM
[+13.47s] DEBUG: Prompt greeter with 1 message(s)
[+18.17s] DEBUG: Seat seat0 changes active session to
[+24.64s] DEBUG: Seat seat0 changes active session to 4


Below are the contents of /var/log/lightdm/lightdm.log after attempting to login to a 'Plasma (Wayland)' session via the LightDM greeter on VT7:

Code:
[+0.04s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.04s] DEBUG: Starting Light Display Manager 1.32.0, UID=0 PID=3381
[+0.04s] DEBUG: Loading configuration dirs from /etc/eselect/wine/share/lightdm/lightdm.conf.d
[+0.04s] DEBUG: Loading configuration dirs from /usr/share/lightdm/lightdm.conf.d
[+0.04s] DEBUG: Loading configuration dirs from /usr/local/share/lightdm/lightdm.conf.d
[+0.04s] DEBUG: Loading configuration dirs from /etc/xdg/lightdm/lightdm.conf.d
[+0.04s] DEBUG: Loading configuration from /etc/lightdm/lightdm.conf
[+0.04s] DEBUG: Registered seat module local
[+0.04s] DEBUG: Registered seat module xremote
[+0.04s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.04s] DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’
[+0.04s] DEBUG: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
[+0.42s] DEBUG: Monitoring logind for seats
[+0.42s] DEBUG: New seat added from logind: seat0
[+0.43s] DEBUG: Seat seat0: Loading properties from config section Seat:*
[+0.43s] DEBUG: Seat seat0 has property CanMultiSession=no
[+0.43s] DEBUG: Seat seat0: Starting
[+0.43s] DEBUG: Seat seat0: Creating greeter session
[+0.49s] DEBUG: Seat seat0: Creating display server of type x
[+0.50s] DEBUG: Could not run plymouth --ping: Failed to execute child process “plymouth” (No such file or directory)
[+0.50s] DEBUG: Using VT 7
[+0.50s] DEBUG: Seat seat0: Starting local X display on VT 7
[+0.50s] DEBUG: XServer 0: Logging to /var/log/lightdm/x-0.log
[+0.56s] DEBUG: XServer 0: Writing X server authority to /var/run/lightdm/root/:0
[+0.56s] DEBUG: XServer 0: Launching X Server
[+0.56s] DEBUG: Launching process 3460: /usr/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
[+0.56s] DEBUG: XServer 0: Waiting for ready signal from X server :0
[+0.56s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.56s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+1.47s] DEBUG: Loading users from org.freedesktop.Accounts
[+1.47s] DEBUG: User /org/freedesktop/Accounts/User1001 added
[+2.70s] DEBUG: User /org/freedesktop/Accounts/User1000 added
[+8.49s] DEBUG: Got signal 10 from process 3460
[+8.49s] DEBUG: XServer 0: Got signal from X server :0
[+8.49s] DEBUG: XServer 0: Connecting to XServer :0
[+8.70s] DEBUG: Seat seat0: Display server ready, starting session authentication
[+8.70s] DEBUG: Session pid=3509: Started with service 'lightdm-greeter', username 'root'
[+8.96s] DEBUG: Session pid=3509: Authentication complete with return value 0: Success
[+8.96s] DEBUG: Seat seat0: Session authenticated, running command
[+8.96s] DEBUG: Session pid=3509: Running command /usr/sbin/lightdm-gtk-greeter
[+8.96s] DEBUG: Creating shared data directory /var/lib/lightdm-data/root
[+8.96s] DEBUG: Session pid=3509: Logging to /var/log/lightdm/seat0-greeter.log
[+9.01s] DEBUG: Activating VT 7
[+9.01s] DEBUG: Activating login1 session 3
[+9.01s] DEBUG: Seat seat0 changes active session to 3
[+9.01s] DEBUG: Session 3 is already active
[+11.12s] DEBUG: Greeter connected version=1.32.0 api=1 resettable=false
[+13.41s] DEBUG: Greeter start authentication for fitzcarraldo
[+13.41s] DEBUG: Session pid=3552: Started with service 'lightdm', username 'fitzcarraldo'
[+13.47s] DEBUG: Session pid=3552: Got 1 message(s) from PAM
[+13.47s] DEBUG: Prompt greeter with 1 message(s)
[+18.17s] DEBUG: Seat seat0 changes active session to
[+24.64s] DEBUG: Seat seat0 changes active session to 4
[+277.37s] DEBUG: Seat seat0 changes active session to 3
[+277.69s] DEBUG: Session 3 is already active
[+288.22s] DEBUG: Continue authentication
[+288.28s] DEBUG: Session pid=3552: Authentication complete with return value 0: Success
[+288.28s] DEBUG: Authenticate result for user fitzcarraldo: Success
[+288.28s] DEBUG: User fitzcarraldo authorized
[+288.28s] DEBUG: Greeter sets language en_GB.utf8
[+288.40s] DEBUG: Greeter requests session plasmawayland
[+288.50s] DEBUG: Writing /home/fitzcarraldo/.dmrc
[+288.63s] DEBUG: Seat seat0: Creating display server of type wayland
[+288.63s] DEBUG: Using VT 8
[+288.63s] DEBUG: Seat seat0: Display server ready, running session
[+288.63s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session0
[+288.63s] DEBUG: Session pid=3552: Running command /etc/lightdm/Xsession /usr/lib64/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland
[+288.63s] DEBUG: Creating shared data directory /var/lib/lightdm-data/fitzcarraldo
[+288.63s] DEBUG: Session pid=3552: Logging to .xsession-errors
[+288.67s] DEBUG: Activating VT 8
[+288.95s] DEBUG: Seat seat0: Stopping greeter
[+288.95s] DEBUG: Terminating login1 session 3
[+288.95s] DEBUG: Session pid=3509: Sending SIGTERM
[+288.95s] DEBUG: Activating login1 session 6
[+288.97s] DEBUG: Seat seat0 changes active session to 6
[+288.97s] DEBUG: Session 6 is already active
[+289.30s] DEBUG: Greeter closed communication channel
[+289.30s] DEBUG: Session pid=3509: Exited with return value 0
[+289.30s] DEBUG: Seat seat0: Session stopped
[+289.30s] DEBUG: Seat seat0: Stopping display server, no sessions require it
[+289.30s] DEBUG: Sending signal 15 to process 3460
[+289.55s] DEBUG: Process 3460 exited with return value 0
[+289.55s] DEBUG: XServer 0: X server stopped
[+289.55s] DEBUG: Releasing VT 7
[+289.55s] DEBUG: XServer 0: Removing X server authority /var/run/lightdm/root/:0
[+289.55s] DEBUG: Seat seat0: Display server stopped
[+299.07s] DEBUG: Seat seat0 changes active session to 4


The above output shows that LightDM did run the commands '/etc/lightdm/Xsession' and '/usr/lib64/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland' as expected. It also shows that LightDM attempted to display the Plasma Wayland session on VT8, as I would expect given that the LightDM greeter was displayed on VT7.

Stephane Chauveau in the aforementioned LightDM Issue #63 ('Missing some input devices in wayland session') mentions that he added a delay using 'sleep 1' to allow LightDM to exit before the Wayland compositor starts. I tried doing that as well, but it did not make any apparent difference. By the way, he also stated that it does not matter that LightDM runs under X11:

Stephane Chauveau wrote:
...running LigthDM under X11 or Wayland probably does not matter here because LightDM terminates its own session before starting Sway in a different VT.

That appears to be corroborated in the contents of lightdm.log shown above.

Anyway, I'm stumped. Do any of you launch Plasma (Wayland) from LightDM? If so, do you have any idea why my installation cannot do that? (I'm not interested in trying SDDM on that laptop; I would like to find out why LightDM is not able to launch Plasma Wayland). Thanks in advance for any ideas.

Edit 2023-07-12: Added '[Solved]' to Subject.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog


Last edited by Fitzcarraldo on Wed Jul 12, 2023 11:05 am; edited 1 time in total
Back to top
View user's profile Send private message
tomtom69
Apprentice
Apprentice


Joined: 09 Nov 2010
Posts: 251
Location: Bavaria

PostPosted: Mon Jul 10, 2023 7:44 pm    Post subject: Reply with quote

Hi,

I am facing the same problem. Your post encouraged me to look at the login screen options of lightdm and I tried to use wayland - with the same result.
My first assumption was that your problem is related to nvidia, but I am using radeon graphics, so it seems not to be related on graphics card.
I am also able to start a plasma wayland session using
dbus-launch --exit-with-session startplasma-wayland
on my setup, so the issue seems to be related on lightdm.
Sorry for not being able to really help here, but I am also interested in any solution to use lightdm with plasma/wayland

Tom
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2052
Location: United Kingdom

PostPosted: Wed Jul 12, 2023 11:03 am    Post subject: Reply with quote

Well, after a lot of searching and experimenting, I found a solution that works in my case. Ironically, I found it in a 2020 SDDM bug report ('Plasma 5.20 has Black desktop screen when using wayland in conjunction with SDDM #1335'):

https://github.com/sddm/sddm/issues/1335#issuecomment-743933731

I tried the same approach as SDDM user torokati44; I edited /usr/share/wayland-sessions/plasmawayland.desktop and replaced the line:
Code:
Exec=/usr/lib64/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland

by:
Code:
Exec=/usr/bin/dbus-run-session /usr/bin/startplasma-wayland

I then logged out of the Plasma (X11) session, selected Plasma (Wayland) on the LightDM GTK Greeter screen and can now log in to a Plasma (Wayland) session. Konsole confirms that it is a Plasma Wayland session:

Code:
fitzcarraldo@clevow230ss ~ $ echo $XDG_SESSION_TYPE
wayland

See if that works for you as well, tomtom69.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Back to top
View user's profile Send private message
tomtom69
Apprentice
Apprentice


Joined: 09 Nov 2010
Posts: 251
Location: Bavaria

PostPosted: Thu Jul 13, 2023 10:35 am    Post subject: Reply with quote

With the modified /usr/share/wayland-sessions/plasmawayland.desktop file it works.

I also looked at the /usr/share/wayland-sessions/plasmawayland.desktop file, but instead of changing the Exec line, I changed into a terminal after boot and entered the command
Code:
/usr/lib64/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland

manually, which also started a plasma-wayland session just like
Code:
/usr/bin/dbus-run-session /usr/bin/startplasma-wayland

in the terminal.
So I assumed the command itself to be working which was not the case.

Thank you Fitzcarraldo! :-)
Back to top
View user's profile Send private message
acmondor
n00b
n00b


Joined: 08 Aug 2014
Posts: 62
Location: Canadian Prairies

PostPosted: Mon Nov 04, 2024 10:37 pm    Post subject: Reply with quote

This problem still seems to exist in Plasma6 and the solution presented here works, even though the file was changed to /usr/share/wayland-sessions/plasma.desktop.

Was there ever anything done to find a permanent solution so one does not have to edit that file every time kde-plasma/plasma-workspace is updated or reinstalled?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum