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.
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))
Why she get Black screen? I disabled Power management, because there were messages about it.
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.
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.
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.
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