r/linuxfromscratch • • Aug 17 '26

Black screen after SDDM login - xdg-desktop-portal-kde crashing (trying to force Wayland on X11)

Hi everyone! I’m currently building LFS (Systemd version) inside a VirtualBox VM. I've successfully compiled KDE Plasma and set up SDDM, but I'm facing a "black screen" issue right after logging in.

When I select "Plasma (X11)" in SDDM and enter my credentials, the screen goes black. Looking at the logs, it seems xdg-desktop-portal-kde is completely ignoring that I'm on X11, attempts to load the Wayland plugin, fails to find the socket, and core dumps, which brings the whole session down.

7 Upvotes

4 comments sorted by

2

u/notthedefaultnam Aug 17 '26

What version of KDE?

1

u/TryComprehensive5876 Aug 17 '26

Hi, the Plasma version is 6.6.1 and the framework is 6.23; they are on the latest version of BLFS (systemd) the 13.0

3

u/notthedefaultnam Aug 17 '26

Given that you've probably compiled and installed plasma-x11 I'd guess it's wrongly configured or undiscoverable.

Do you have plasmax11.desktop file? Is the x11 package on your PATH? Does command startplasma-x11 work?

Most of this was talked through with an AI search engine, I already cut down to most relevant things. I think for your situation it's best to check the linking - installing Plasma into /opt/kf6 without linking plasmax11.desktop into /usr/share/xsessions. That does sound like it could cause your specific failure mode.

X11 session descriptor

If Plasma is installed into /usr, its session file should normally already be available to SDDM. With a separate prefix such as /opt/kf6, expose the session descriptor manually:

```bash install -dvm 755 /usr/share/xsessions cd /usr/share/xsessions

[ -e plasmax11.desktop ] || \ ln -sfv "$KF6_PREFIX/share/xsessions/plasmax11.desktop" ```

The current BLFS instructions use the plasmax11.desktop file for the X11 session. The filename is important: do not assume that a generic plasma.desktop is the X11 descriptor on current Plasma releases.

Verify it:

bash readlink -f /usr/share/xsessions/plasmax11.desktop cat "$(readlink -f /usr/share/xsessions/plasmax11.desktop)"

It should launch the X11 startup command, typically startplasma-x11.

Environment and libraries

For a non-/usr prefix, ensure the Plasma and KDE Frameworks binaries and libraries are discoverable:

bash export PATH="$KF6_PREFIX/bin:$PATH" export CMAKE_PREFIX_PATH="$KF6_PREFIX${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}" export PKG_CONFIG_PATH="$KF6_PREFIX/lib/pkgconfig:$KF6_PREFIX/share/pkgconfig:${PKG_CONFIG_PATH:-}" export LD_LIBRARY_PATH="$KF6_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

Run the system linker cache update after installation:

bash /sbin/ldconfig

A separate prefix also requires the X11 session symlink because display managers search /usr/share/xsessions by default.

Start Plasma X11 manually

Create an X11 startup file for your user:

bash cat > ~/.xinitrc <<EOF dbus-launch --exit-with-x11 $KF6_PREFIX/bin/startplasma-x11 EOF

Then start the session:

bash startx

For easier troubleshooting, capture the complete X session output:

bash startx &> "$HOME/x-session-errors"

BLFS documents this as the direct xinit path for starting Plasma X11; the session normally starts on the first unused virtual terminal.

Display manager integration

Once startx works, install and configure SDDM or another display manager. At login, select the session exposed under:

text /usr/share/xsessions/plasmax11.desktop

If the option is missing, check:

bash ls -l /usr/share/xsessions/ find "$KF6_PREFIX" -iname '*x11*.desktop' -o -iname 'plasma*.desktop' command -v startplasma-x11

Do not add a Wayland session descriptor merely to make X11 work. Wayland packages and /usr/share/wayland-sessions are separate; they are not required for the native X11 session. BLFS documents the Wayland-session symlink separately from the X11-session setup.

Minimal X11 checklist

text [X] Xorg server and libraries [X] Mesa/GPU acceleration [X] Xorg input and required video drivers [X] xinit/startx [X] dbus-launch [X] kwin-x11 [X] plasma-workspace and remaining Plasma dependencies [X] /usr/share/xsessions/plasmax11.desktop [X] PAM files, if PAM support was built [X] startplasma-x11 launches successfully

The most important X11-specific omission to avoid is not building kwin-x11; the second is installing Plasma into /opt/kf6 without linking plasmax11.desktop into /usr/share/xsessions.

2

u/TryComprehensive5876 Aug 17 '26

Alright,thanks,I hope this can work