25

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:

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:

XRDP Login

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.

6 Answers 6

25

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.

7
  • 1
    I added those two lines to ~/.xsessionrc and rebooted. It hasn't any difference.
    – jon hanson
    Commented Apr 25, 2022 at 10:12
  • Did you logout the user you are trying to login with on ubuntu ?
    – someTechno
    Commented Apr 25, 2022 at 13:46
  • I rebooted the (Ubuntu) pc.
    – jon hanson
    Commented Apr 25, 2022 at 16:58
  • 1
    Keep the pc on. But log out. One more thing. Did you run this command -> sudo adduser xrdp ssl-cert and then reboot.
    – someTechno
    Commented Apr 26, 2022 at 17:11
  • 2
    Ok, that did work. Is there a way to log into the existing session?
    – jon hanson
    Commented Apr 26, 2022 at 22:21
5

(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

4

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.

2

this problem can be solved by disabling Enhanced session in hyper-v. hope it helps someone

1
  • 4
    A working solution has been provided. You need to provide more details about how to disable that feature, and indicate the precise results. Are you saying that you can login to an active session on xrdp in this way? I didn't think the protocol allowed for that.
    – pbhj
    Commented Jul 28, 2022 at 10:55
0

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:

  1. Install XRDP: Run the following commands on your Ubuntu machine to install XRDP:

    sudo apt install xrdp
    sudo systemctl enable --now xrdp
    
  2. 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
    
  3. 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.

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

2
  • 1
    Can you explain exactly what this is doing? Commented Apr 10 at 23:27
  • 1
    the last sentence sounds like an output from chatgpt or similar Commented Apr 18 at 4:07
-1

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=/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .