Wayland will not start

I cannot get Wayland to start on logging into KDE. When I attempt to log into Plasma on Wayland, I get a black screen for a little while and then the login screen reappears. I can log into Plasma on X11 with no problem. In the warning log I receive many messages along the lines of :

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.#012#012Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
2024-02-07T11:04:43.922577-08:00 Beary xapp-sn-watcher[11216]: Authorization required, but no authorization protocol specified

I get this for virtually all KDE applications. Is there a way to fix the problem?

To start with, create another user account while in the X11 Plasma session, then log out, change to Wayland session and login as the new user. Does that work, or same issue?

I created the new user account and it came up in Wayland with no problems. The issue only comes up in my own user account.

Ok, that is useful to know. Likely a ‘problematic’ user configuration. You could try removing (or renaming) ~/.conifg/plasma-org.kde.plasma.desktop-appletsrc or ~/.config/kwinrc for the user account of concern perhaps. You can do that at runlevel 3 or while logged in as a Plasma X11 session. After logging out, try starting the Wayland session as that user again. Any different?

No joy. I moved each file to my temp directory separately and both together and had the same behavior. I do notice that after trying to login using Wayland, when I login using X11 immediately afterword there is a delay in Plasma showing up - as if something is running in the background - and when it does show up it is not quite right. Things like the speaker being muted and unable to unmute, on occasion window controls being missing and so forth. If I log out and login again to X11, everything is back to normal. This happens both with the unmodified system, after removing the files you mentioned, and after having restored the old files.

Just guessing here…the ~/.config/plasmarc file may also be worth checking.

You could get additional diagnostic information by starting the Plasma Wayland session by hand from a TTY (runlevel 3 logged in as user).

dbus-run-session startplasma-wayland > wayland.log

Returning to the output you shared in your opening post…

Does this arise from having used a different desktop environment sometime in the past? Can you stop it from starting up? Check ~/.config/autostart, although I’m only guessing about how it starts in the user’s session, but it could be impacting here.

https://forums.linuxmint.com/viewtopic.php?t=325557

I tried removing plasmarc with no effect. I had already checked .config/autostart and eliminated everything but knotes, korganizer, and Kmail. I have always used KDE/Plasma back to SUSE 11. Which brings up some ignorance: How to I boot to runlevel 3 so I can try your other suggestion?

  1. You can boot to it on a temporary basis via grub
    SDB:Making Temporary Changes to a GRUB 2 Menu - openSUSE Wiki

  2. You could also switch to a VT while at the login screen or while logged into the desktop eg press CTRL-ALT-F5. Login as a user, and do

sudo init 3

Then run the command posted earlier o start Plasma Wayland. The wayland.log can subsequently be reviewed for errors.

Or, even easier, at the boot screen hit the e key, scroll down to the line that begins with “Linux”, hit the END key, add a space and a 3, hit F10 to boot.

Yes, that is option 1 :wink:

1 Like

Duh! I should have clicked the link and looked, first. I thought it was going to say to alter the line in the bootloader in Yast or something and reboot. Sheesh!

Thanks, I did boot into level 3 and ran the dbus command. Unfortunately, it hung the system at one point and was waiting interminably for something to happen so it never wrote anything to wayland.log. I did take a picture of the screen while it was hung. Hopefully, this will help:

Hmmm…not sure what is going on there. It’s not even clear if this ultimately causes the wayland session to fail to start. You will likely need to search the errors online. FWIW, I found the following archlinux thread, but not sure about its relevance …
https://bbs.archlinux.org/viewtopic.php?id=279527

As it affects the only the primary user, it is likely to be related a session environment variable or user config, but could be tedious to identify. You could backup the entire ~/config directory as a blunt test. Hopefully others can chime in with further ideas.

Just as another piece of information. I created a new user, logout of my original user and logged into the new user under Wayland with no problem. I then logged out of the new user and logged back into my original user with X11. I su’d into a root version of dolphin, renamed the new user’s .config file to .config.bak. I then copied my original user’s .config file to the new user’s home directory, changing the permissions of the new user’s version to the new user’s name. I then logged out of the original user and logged into the new user using Wayland with no problem. Of I was asked a bunch of times for the old user’s password to run various things. The main thing is, whatever the problem is, it is not in the .config file.

You could also compare the environment variables for both users using the ‘env’ command. Any differences?

Maybe try removing the primary user’s cache (~/.cache) and ~/.local/share/kscreen/ as well.

1 Like

Problem solved, I think. I compared some of the configuration files in the new user to the old user and came across .profile. In my old configuration the file, for some obscure reason, contained the line:

export WAYLAND_DISPLAY=QT_QPA_PLATFORMTHEME=xcb

Clearly this is something that had been changed for some reason. Then new file simply has
test -z “$PROFILEREAD” && . /etc/profile || true.

Question: Is “test” then name of the user which was “Test” for the new user or the actual text of the file?

1 Like

Good result! That would have shown up in the ‘env’ output for this user.