Hello World,
We have noticed that a lot of people hit the same issue over and over again. When trying to connect via remote desktop protocol (rdp) to the Ubuntu machine, and after providing the credentials in the xRDP Login page, the user will only see a black screen displayed and the desktop interface is never loaded and displayed. This post will basically explain why this happens and how to reproduce the issue.
The “problem” is actually well known and there is really an simple and easy fix for that. So, let’s explain the situation…..
Overview
Reproducing the “Black Screen” Situation
Let’s assume that you have performed a successful xRDP installation (manually or using our famous xrdp-installer-xx.sh script) and you are ready to test your rdp connection to your Ubuntu machine. Let’s also assume that you are still logged on into your Ubuntu machine system locally with your user account (which could be called User1). So, you move to your Windows machine (or Linux machine), fire up your favorite remote desktop client and provide the ip address or the hostname
Click on picture for better Resolution
Since xRDP installation has been successful, you will be presented with the xRDP Login page where you will need to provide the user credentials on the Ubuntu machine. In our example, User1 (yes the one currently logged on locally on the ubuntu machine) account will be used
Click on picture for better resolution
If the credentials are correct, you will see your remote desktop session showing a black screen and that’s it !!!!! The desktop interface will never load within your remote session
Click on picture for better resolution
Black Screen situation Explained
As mentioned and explained multiple times, this situation will happen (or can happen) when the same user account is used concurrently locally and remotely. In other words, the problem is related to the fact that the same user account is already logged in locally and a remote connection is attempted at the same time. With xRDP software solution, a specific user account can be logged on either locally or remotely but not both….
The (Standard) Solution
To solve this issue, there is a simple fix. You need to ensure the account you are using to login via the remote desktop client is not currently logged on locally on the Ubuntu target machine. If this is the case, perform a logout operation as shown in the screenshot below….
Click on Picture for better Resolution
Try again the remote desktop session and you will see that magically, you will be able to perform your remote desktop connection and that your desktop interface will be loaded and made available for you
Click on Picture for better Resolution
As mentioned in the title, this is the most command and most standard approach to fix this issue. This is basically the recommended approach to be used.
However, there are other techniques (easier to implement that can be used) and we will share them with you soon…. In the next post, we will show you how to implement these techniques
Final Notes
Voilà ! This is it for today !
We hope that this post will be useful to all these people that have encountered the xRDP black screen situation. We have quickly and simply demonstrated how to overcome this minor but annoying xRDP “issue”. It’s important to understand how xRDP works and how sessions are created with the software. When using xRDP software, it will always create a new session for the logged on user. There is no way (as far as we know) to connect to the console session and start your session where you left it !
In a coming post, we will show you some tips and tricks that can be used to allow simultaneously local connections and remote connections…
Till next time
See ya
Thank you – you are AWESOME!!!
@Michael,
Thank you for your feedback and for visiting our blog. We are always happy when we can help in solving some issues with our modest blog 🙂
Till next time
See ya
I wouldn’t even consider myself a novice, but after I removed the group render from my pi user, xRDP would let me remote into my RPi via Windows Remote Desktop.
Larry
@Larry,
Thank you for the feedback and for visiting our blog. Since we are not working much with raspberry we cannot provide feedback here. Thank you for sharing the info; this might be valuable to others
Till next time
See ya
Thanks for taking the time to post this
@John,
Thank you for visiting our blog and providing positive feedback. Happy to see that the information can be useful and can help people out there 🙂
Till next time
See ya
Thanks, worked the 2nd option after a reboot.
@Sebastian,
Thank you for the feedback and for visiting our blog. Always nice to see that the info is helpful and nice to see that people confirm that the trick is working 🙂
Till next time
See ya
That’s a big help and simple! Thanks a lot!
@Betabbs,
Thank you for visiting our blog and providing feedback.. happy to see that you have been able to solve your issues 🙂
till next time
See ya
Thanks for the tips! I thought to try it other way around.
Perhaps I am wrong somewhere. Here is a list of stuffs I tried out.
-> launched an ubuntu instance in AWS
-> logging in to “user1” using CLI (success)
-> created a “user2” standard account using CLI
-> logging in over RDP using “user2” (success)
The RDP session gets launched with a CLI window opened.
however, the dreaded black screen sustains in background.
@Tapo,
Thank you for visiting our blog and sharing your experience. This is a known issue with xRDP… a single connection per user… You would have the same behavior if you login locally and quickly login through remote desktop. One session will get the full desktop the other will simply have a command line open and the black screen in background… There are some workarounds that you can use (see https://c-nergy.be/blog/?p=17371 and https://c-nergy.be/blog/?p=16698) but we do not recommend this because this workarounds can lead to other issues….
Hope this help
Till next time
See ya
This is great, oddly enough I AM able to simultaneously have an RDP session from my Windows and run an SSH session from my Windows Linux system at the same time as the same user and have both sessions open and active.
My colleague on the other hand from her MacBook is getting the Black Screen of Death….
@Anthony,
Thanks for sharing your findings and visiting our Blog… As explained in this post, black screen is usually due to the fact that the same user account is logged into the system (i.e. locally and remotely). We never tried ssh and at the same time DE for the same user but we think that should prevent user to login…(we will need to test)..;
We are really usin Macos systems so cannot tell if this is a problem or bug or even if it can be fixed… I would say restart everything and try again.;;first, connect using xrdp and then with ssh
hope this help
till next time
see ya
Doesn’t work. Even after reboot. Still a black screen. Ubuntu 20.04.
@Jonathan Baxter,
Thank you for visiting our blog and providing some feedback. Usually, Black screen have 2 main reasons…
either same user is logged on locally or remotely
or the ~/.xsessionrc file is not populated correctly
Since you are not providing any details about how you have performed your xrdp installation, we cannot really help you here. How did you perform the install ? have you checked the logs, do you have an .xsession or .xsessionrc file created, which Desktop interface are you using (we are assuming Gnome but might be different)
Till next time
See ya
Thank you for this help
Tried these workarounds but still black screen:
either same user is logged on locally or remotely (one use logs remotely)
or the ~/.xsessionrc file is not populated correctly (.xsessionrc file exists)
Install the script on KVM ubuntu18.04, use Windows 10 RDP
@Tyler,
Sorry for the late reaction but overloaded by work…
So you have manually install the xrdp package on your ubuntu 18.04 , right ? and now you have a black screen when you are trying to remote in, right ?
We are assuming that you are running Ubuntu 18.04 + Gnome Desktop interface
as mentioned, black screen usually is because the same user is logged on locally or remotely … The Black screen can also be generated by an error inside the ./xsessionrc file
Can you share the ./xsessionrc file ?
You have additional tricks to get multiple users connected to the same session but we do not recommend them because side issues will show up as well. .For you info, you can check
xRDP – Allow multiple sessions (local and remote) for the same user – HowTo
xRDP – Allow multiple sessions (local and remote) for the same user – More Option
Hope this help
Till next time
See ya
A simpler solution I found is to SSH in and exit out of the SSH session. The remote login works fine after that.
Hello,
Thank you for your great work. I have performed a -c installation.
I am facing an issue with the left toolbar not showing up with a rdp connection (it is present when I am logging to the linux computer).
This is pretty anoying as I have to clic on activies in order to see all the opened windows and switch to the one I want.
Do you have any idea on how to fix this issue ?
Thank you in advance
Regards,
Vincent
@Vincent,
Thank you for visiting our blog and providing some feedback. Sorry for the delay in our answer but we are really busy 🙂
We are assuming that you have run the script against an Ubuntu + Gnome desktop Version 18.04 or later (not Ubuntu 22.10 because we have not tested it yet against this release)
So, for your problem, if I understand correctly the Ubuntu Dock bar does not show up in xRDP session.
The easy solution would be to login remotely, check your settings (via App Tweak) for Ubuntu dock bar and make it visible.. You could use this post as base (https://c-nergy.be/blog/?p=11395)
The other solution is to double check the .xsessionrc content file and ensure that the correct code is present.. If you are using Ubuntu + gnome, it should look like this
echo export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
If this is not present, you will need to check the content of /etc/xrdp/startwm.sh and ensure that at top of the file, you have some code that looks like the following
cat < ~/.xsessionrc
echo export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
EOF
Thank you!!
@Ganesh,
Thank you for visiting our blog and providing feedback. Happy to see that the information provided was helpful
Till next time
See ya
Logged out and then use rdp to login and it still shows black screen
@Joe,
Thank you for visiting our blog and providing feedback. You do not provide any info in your comment… ? Please specify Ubuntu version, have you run the script, have you done a standard installation….Which desktop interface are you using
Waiting for your feedback
Till next time
See ya
Awesome, thanks for the clear guidance here.
Please update the post with the following info I discovered:
Black screen is caused when you login to an RDP session with a user that is already logged into the machine. To fix, simply use a different user to RDP into the machine, or alternatively, logout of the machine before you begin the RDP session.
Thanks again!
@Gee Dubz,
Thank you for visiting our blog and providing feedback. We have shared multiple time information about black screen with xRDP. We have written multiple posts about this one… We will evaluate if we need to update the post or not…
Thanks again
Till next time
See ya
Thanks!!
@Juan,
Thank you for visiting our blog and providing feedback… Happy to see that the information provided is helpful
Till next time
See ya
Thanx, it worked.