WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Blank screen on re-connect remote desktop: WSL + Ubuntu + xfce4 + xrdp

Open ericis opened this issue 6 years ago • 14 comments

Environment

Microsoft Windows [Version 10.0.19041.388]
Your Distribution version: Ubuntu 20.04.1 LTS (Focal Fossa)
WSL2: Linux version 4.19.104-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Feb 19 06:37:35 UTC 2020

Steps to reproduce

  1. Install WSL + Ubuntu + xfce4 + xrdp
  2. Connect via Windows Remote Desktop (success!)
  3. Close Remote Desktop
  4. Connect via Windows Remote Desktop (black, blank screen)

Manual work-around

The following might give some indication toward the cause.

  1. After experiencing the black, blank screen
  2. Close Remote Desktop connection
  3. Stop xrdp *hangs for several seconds
    $ sudo service xrdp stop
     *Stopping Remote Desktop Protocol server
    
  4. Re-start xrdp
    $ sudo /etc/init.d/xrdp start
     * Starting Remote Desktop Protocol server
    
  5. Check xrdp status
    $ service xrdp status
     * xrdp-sesman is running
     * xrdp is running
    
  6. Re-connect to remote desktop (works again, but what a pain!)

Expected behavior

Re-connecting to the Ubuntu instance through remote desktop always displays the OS.

Actual behavior

Black screen when re-connecting to the Ubuntu instance through remote desktop.

ericis avatar Aug 04 '20 22:08 ericis

After a tip, re-connecting works properly when using the "Log Out" menu option vs. simply closing the RDP window. Is this required?

ericis avatar Aug 04 '20 22:08 ericis

This is a good question for Ubuntu, xfce4, xrdp or other forums related to those third-party products. There is a MSFT RDP client Q&A forum here. n.b. If you use the Windows FreeRDP client, and the problem does turn out to be with the client (it might, but probably not), then you've got the option to send a PR that fixes it. Also reddit, serverfault.

Often it is best to frame the question in those forums as running on a headless Linux box (or VM) without systemd and no DRM, rather than 'WSL'.

GUI apps on WSL is on the way, subscribe #938.

therealkenc avatar Aug 04 '20 23:08 therealkenc

I think you'll find that whether the screen is black depends on whether its been idle for 10 minutes or more, and this is caused by the Xfce power manager. Go into the Xfce power manager and turn off, max out and disable all display and system time outs.

xpusostomos avatar Aug 21 '20 01:08 xpusostomos

I notice that anything that activates the lock screen, xflock4 also hangs xrdp. By default this includes ctrl-alt-del (activatede by ctrl-alt-end in rdp) and ctrl-alt-L, as seen in keyboard config in xfce4.

xpusostomos avatar Sep 14 '20 05:09 xpusostomos

Yep that was that! Thanks!! I turned everything to "never" in Power Management.

chaoscopia avatar Feb 03 '21 19:02 chaoscopia

I think you'll find that whether the screen is black depends on whether its been idle for 10 minutes or more, and this is caused by the Xfce power manager. Go into the Xfce power manager and turn off, max out and disable all display and system time outs.

@xpusostomos Thanks a lot for this solution. This issue was annoying me in the past week, now it's resolved. Such a nice trick, wow!

the-fejw avatar Jul 29 '22 07:07 the-fejw

After a lot of search I found this solution that worked for me (thanks to Luis Pereira https://askubuntu.com/a/1324767)

nano /etc/xrdp/startwm.sh Add in the very top:

unset DBUS_SESSION_BUS_ADDRESS unset XDG_RUNTIME_DIR then:

sudo systemctl restart xrdp

ANMahmood avatar Mar 20 '23 06:03 ANMahmood

@ANMahmood Thank you for your comment!! I have same issue so, I even tried reset my wsl2 environment!!!!! Your comment is very very helpful!!!!

lksj12 avatar Sep 19 '23 08:09 lksj12

@ANMahmood you save my day, thanks

dixancarballo avatar Sep 19 '23 15:09 dixancarballo

After a lot of search I found this solution that worked for me (thanks to Luis Pereira https://askubuntu.com/a/1324767)

nano /etc/xrdp/startwm.sh Add in the very top:

unset DBUS_SESSION_BUS_ADDRESS unset XDG_RUNTIME_DIR then:

sudo systemctl restart xrdp

29/10/2023 - Can confirm with Windows 11 WSL2 Ubuntu 22.04.06, this solution worked

Onik97 avatar Oct 29 '23 17:10 Onik97

After a lot of search I found this solution that worked for me (thanks to Luis Pereira https://askubuntu.com/a/1324767)

nano /etc/xrdp/startwm.sh Add in the very top:

unset DBUS_SESSION_BUS_ADDRESS unset XDG_RUNTIME_DIR then:

sudo systemctl restart xrdp

Thanks. Finally solve this problem..

golioss1886 avatar Apr 24 '24 19:04 golioss1886

@ANMahmood Thank you very very much indeed, I was about to bang my head against the wall :D. But I would like to understand why this code works. What does this code do?

system-linux avatar May 01 '24 16:05 system-linux

After a lot of search I found this solution that worked for me (thanks to Luis Pereira https://askubuntu.com/a/1324767)

nano /etc/xrdp/startwm.sh Add in the very top:

unset DBUS_SESSION_BUS_ADDRESS unset XDG_RUNTIME_DIR then:

sudo systemctl restart xrdp

Thx Bro You save my time... <3

Abdullasl321 avatar Sep 15 '24 06:09 Abdullasl321

@ANMahmood thank you for the solution. It help me a lot. I got w11 and wsl2 and it resolved the error.

daniram94 avatar May 28 '25 10:05 daniram94