Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ericis opened this issue Aug 4, 2020 · 12 comments
Closed

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

ericis opened this issue Aug 4, 2020 · 12 comments

Comments

@ericis
Copy link

ericis commented Aug 4, 2020

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
Copy link
Author

ericis commented Aug 4, 2020

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

@therealkenc
Copy link
Collaborator

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.

@xpusostomos
Copy link

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
Copy link

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.

@chaoscopia
Copy link

chaoscopia commented Feb 3, 2021

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

@the-fejw
Copy link

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!

@ANMahmood
Copy link

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

@lksj12
Copy link

lksj12 commented Sep 19, 2023

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

@dixancarballo
Copy link

@ANMahmood you save my day, thanks

@OnikNoor97
Copy link

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

@golioss1886
Copy link

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..

@system-linux
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests