19

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.

5 Answers5

23

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.

4

(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

3

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.

1

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

  • 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 Jul 28 '22 at 10:55
-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=/
kowal
  • 1