Black screen (of death) on Ubuntu server 26.04 with LXQT

Few months ago I installed Ubuntu server 26.04. LTS with LXQt Desktop on it.
This Server is serving max 14 people. All of them are working on Windows PC and with xrdp remotely connecting to Ubuntu server.
One Person has problem with Black screen. It happens every 10 -12 days. The person was connected to server, working without problems. Later mostly 6:40 - 6:55 connection with the server is lost. When she try to connect, there is a black screen and i must use “pkill -u” command.

  1. Why is connection lost with the server? - This happens to more users (also to me, when i am away for more then 30 minutes (I think so))
  2. Why she get Black screen? I disabled Power management, because there were messages about it.

I hope you could understand my problem.

I take it the black screen is in the xrdp window, not in Windows itself?

I think I would be looking for some sort of timeout phenomenon.
How is the server in Ubuntu configured?
Can you rule out network issues?

What do you mean by that “How is server in Ubuntu configured”?
I don’t think that’s a network issue. I think it is something with xrdp for “Black screen” and Windows problem for connection problem.

Sorry that is a bit vague… I mean you need to look at the xrdp config files in Ubuntu. … you might find some setting for timeouts.

I dont know the details, I have never used xrdp … but it seems obvious that this could be a timeout issue because it is intermittant and it only affects one user at any given time.

There are other possibilities …like the user may be doing something which triggers it… but it seems from what you say that the user is idle when it happens.

Thd xrdp daemon cant be failing, because that would affect all users.

I have no experience with this type of set up. But I do like to perform searches on the web or with AI to see if I can provide some help. Copilot seem to possibly have an solution to your question.

I can’t post the entire output from AI for this forum frowns on posting long AI output.
Here is a brief part of the output from Copilot. Also note AI is not always correct.

The user’s XRDP session is not fully closing when disconnected. When [the person] 
reconnects, XRDP tries to attach to a dead/locked session, resulting in a black
 screen.

Does Copilot say how to fix it?
Do we need to fix Win or Ubuntu?

Yes, it does but it is quite long.

Why connections are being lost

These are the three most common causes on Ubuntu Server + XRDP:
1. XRDP idle timeout

Ubuntu’s XRDP defaults often kill or freeze sessions after ~30 minutes
 of inactivity.

Check:
Code

/etc/xrdp/sesman.ini

Look for:
Code

IdleTimeLimit=
DisconnectedTimeLimit=

If these are low (e.g., 30 minutes), XRDP will drop the session.
2. systemd-logind seat conflicts

XRDP creates a virtual seat (seat0 or seat1).
If the user disconnects abruptly, logind may leave the seat in a “closing” state.

Then on reconnect, XRDP tries to reuse the seat → black screen.

You can confirm this by checking:
Code

loginctl list-sessions

You’ll see the user still has a session even though they’re “disconnected”.
3. LXQt session not terminating cleanly

LXQt is lightweight, but not the most stable under XRDP.
If LXQt crashes or hangs, XRDP will show a black screen instead 
of a desktop.

You’ll see errors in:
Code

~/.xsession-errors

🖥️ Why this one user gets black screen every 10–12 days

This is almost always caused by:
✔ A “zombie” XRDP session that never fully closed

The user reconnects → XRDP tries to attach →
 LXQt cannot start → black screen.

Your workaround (pkill -u username) works because it kills the zombie 
session.

But the root cause is XRDP session persistence.
🔧 Fixes (in order of effectiveness)
1. Force XRDP to always start a fresh session

Edit:
Code

/etc/xrdp/sesman.ini

Set:
Code

KillDisconnected=true
DisconnectedTimeLimit=60

This ensures that after 60 seconds of disconnect, the session is fully 
terminated.
2. Disable systemd-logind seat reuse

Create:
Code

/etc/systemd/logind.conf.d/xrdp.conf

Add:
Code

[Login]
KillUserProcesses=yes

Then:
Code

systemctl restart systemd-logind

This prevents zombie sessions.
3. Switch LXQt → XFCE (recommended for XRDP)

LXQt is known to cause black screens under XRDP.
XFCE is the most stable remote desktop environment on Linux.

Install:
Code

sudo apt install xfce4

Then set in ~/.xsession:
Code

startxfce4

This alone fixes 80% of XRDP black-screen issues.
4. Disable screensaver + power management inside LXQt

Even though you disabled power management globally, LXQt has its own:

Disable:

    LXQt Power Manager

    LXQt Screensaver

    LXQt Session Lock

These can freeze XRDP sessions.
5. Check for PAM conflicts

Ensure /etc/pam.d/xrdp-sesman contains:
Code

session required pam_systemd.so

Missing this causes seat confusion → black screen.
🧪 Diagnostic commands you should run

To see if the user has a stuck session:
Code

loginctl list-sessions
loginctl session-status <session-id>

To see XRDP errors:
Code

journalctl -u xrdp -u xrdp-sesman

To see LXQt errors:
Code

cat ~/.xsession-errors

🧠 Most likely root cause in your case

Based on your description:

XRDP is dropping idle sessions, but LXQt is not closing cleanly, leaving a 
zombie session. When the user reconnects, XRDP attaches to the dead
 session → black screen.

This is exactly the scenario that requires pkill -u.

Wow it is long. I think it was worth posting… really helpful.
I think I would change to Xfce.
Interesting … the timeout setting is in Windows.

Just a stab in the dark here - but given it’s Ubu 26.04 - is it possibly a Wayland issue?

Can you disable Wayland and force xorg / x11 ?

Yeah, anything that affects networking could cause it.

I wonder if he solved the problem.

Thank you for your answers.

Till now I did not change anything.
It so configured at the moment
IdleTimeLimit=0
DisconnectedTimeLimit=0

Tomorrow I am going to made 2 remote connections with the server with two different user, wait over 30 minutes and see what happens.

I made two remote desktop connections to the server. After 30-50 minutes, my account has lost connection to the server. The other one lief without problems.

I created ~/.xsession and wrote:

#!/bin/sh
export XDG_CURRENT_DESKTOP=LXQt
export DESKTOP_SESSION=lxqt

// Deactivated DPMS (Display Power Management Signaling) and Screensaver
xset s off
xset s numpy
xset -dpms

exec startlxqt

Tomorrow I am going to see if it’s helped or not

You need to systematically check all 5 fixes listed in reply No 8., plus the Wayland suggestion in reply No 9.

Do them one at a time and make notes. This is not going to be easy.

Thank you Neville. I am going to do like you said.

Blockquote

Why connections are being lost

These are the three most common causes on Ubuntu Server + XRDP:
1. XRDP idle timeout

Ubuntu’s XRDP defaults often kill or freeze sessions after ~30 minutes
 of inactivity.

Check:
Code

/etc/xrdp/sesman.ini

Look for:
Code

IdleTimeLimit=
DisconnectedTimeLimit=

If these are low (e.g., 30 minutes), XRDP will drop the session.

Both are disabled:
IdleTimeLimit=0
DisconnectedTimeLimit=0