Remote Desktop from Windows onto Ubuntu 22.04 takes me to a XRDP login then a blank screen
I’m trying to get the Remote Desktop feature working on Ubuntu (Desktop) 22.04, but I can’t seem to connect to my Ubuntu desktop from a Windows (10) PC. I’m using these instructions:
- https://help.ubuntu.com/stable/ubuntu-help/sharing-desktop.html.en
- https://linuxconfig.org/ubuntu-22-04-remote-desktop-access-from-windows-10
I’ve enabled Remote Desktop in the (Ubuntu) Sharing Settings, however when I run the Remote Desktop client (i.e. the standard mstsc.exe client) on Windows and connect to the IP address of the Ubuntu server, I get this login dialog:
The Session dropdown has 4 options:
- Xorg
- Xvnc
- vnc-any
- neutrinordp-any
Selecting Xorg and some login credentials causes the window to close. If I leave the credentials blank I get an Ok dialog with this message:
Connecting to sesman ip 127.0.0.1 port 3350
sesman connect ok
sending login info to session manager, please wait...
login failed for display 0
If I click Ok the it takes me back to the login dialog.
If I select Xvnc and some credentials then I get a blank green screen.
I get similar behaviour if I disable Remote Desktop in the Sharing settings.
I tried the same thing with a second Ubuntu 22.04 host and get the same thing.
You have to be logged out of your account on ubuntu desktop. Else RDP on windows will keep quitting.
You need to Export follwing enviorment variables
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
Either do sudo nano .xsessionrc
or sudo nano /etc/xrdp/startwm.sh
and place the above two lines at the very start and reboot your pc.
this problem can be solved by disabling Enhanced session in hyper-v. hope it helps someone
The before response works for me: Disabling Enhanced session in hyper-v. You can do it by going to the view menu at the top of the hyper-v window of this virtual machine and deselecting the Enhanced session. The login screen appears and you can log in.
(I’ll update it with more information after I gain a greater understanding)
This seemed to be the problem on my fresh Ubuntu 22.04 installation.
Cause
In ~/.xsession-errors
:
# Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Failed to execute child process “dbus-launch” (No such file or directory)
dbus-update-activation-environment: error: unable to connect to D-Bus: /usr/bin/dbus-launch terminated abnormally without any error message
dbus-update-activation-environment: error: unable to connect to D-Bus: /usr/bin/dbus-launch terminated abnormally without any error message
Solution
sudo apt install dbus-x11
dbus-launch
Credits: https://c-nergy.be/blog/?p=16698
I didn’t need this on Ubuntu 20
Maybe it’s related to your nvidia drivers, please try:
- add your user to groups: tty, render, gdm, input
- change permissions to chmod ug+x /usr/lib/xorg/Xorg
- add below lines to /etc/xrdp/sesman.ini [Xorg] section:
param=-configdir param=/
After encountering a blank screen issue while using XRDP on Ubuntu, I spent some time troubleshooting and managed to find a straightforward solution. Here are the steps to resolve the problem:
-
Install XRDP:
Run the following commands on your Ubuntu machine to install XRDP:sudo apt install xrdp sudo systemctl enable --now xrdp
-
Allow Port 3389:
Open the firewall to allow traffic on port 3389 (XRDP default port):sudo ufw allow from any to any port 3389 proto tcp
-
Modify startwm.sh:
Edit the XRDP startwm.sh script:sudo vi /etc/xrdp/startwm.sh
Inside the script, add the following line:
export $(dbus-launch)
Ensure that the line is added before the following lines:
test -x /etc/X11/Xsession && exec /etc/X11/Xsession exec /bin/sh /etc/X11/Xsession
Save the changes and exit the editor.
-
Restart XRDP:
Restart the XRDP service to apply the changes:sudo systemctl restart xrdp
Following these steps should resolve the blank screen issue encountered Remote Desktop from Windows onto Ubuntu.