neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.7k stars 1.73k forks source link

UBUNTU VM - Could not open connection to the host, on port 3389: Connect failed #3192

Closed eliassal closed 2 months ago

eliassal commented 2 months ago

xrdp version

09.17

Detailed xrdp version, build options

xrdp 0.9.17
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2020 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --enable-ipv6
      --enable-jpeg
      --enable-fuse
      --enable-rfxcodec
      --enable-opus
      --enable-painter
      --enable-vsock
      --build=x86_64-linux-gnu
      --prefix=/usr
      --includedir=${prefix}/include
      --mandir=${prefix}/share/man
      --infodir=${prefix}/share/info
      --sysconfdir=/etc
      --localstatedir=/var
      --disable-silent-rules
      --libdir=${prefix}/lib/x86_64-linux-gnu
      --libexecdir=${prefix}/lib/x86_64-linux-gnu
      --disable-maintainer-mode
      --disable-dependency-tracking
      --with-socketdir=/run/xrdp/sockdir
      build_alias=x86_64-linux-gnu
      CFLAGS=-g -O2 -ffile-prefix-map=/build/xrdp-asBei3/xrdp-0.9.17=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security
      LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed
      CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 -Wno-error=deprecated-declarations
      PKG_CONFIG_PATH=/build/xrdp-asBei3/xrdp-0.9.17/pkgconfig

  Compiled with OpenSSL 3.0.2 15 Mar 2022

Operating system & version

Ubuntu 22.04

Installation method

dnf / apt / zypper / pkg / etc

Which backend do you use?

default

What desktop environment do you use?

xfce4

Environment xrdp running on

VM

What's your client?

MobaXterm and win RDP

Area(s) with issue?

Network

Steps to reproduce

After setting up a fresh new Ubuntu VM in hyper-V, installed xrdp, I cant connect using mobaxterm or win rdp client, connection is right away disconnected. When I telnet on the VM itself to port 3389 it responds but not from any other machines. I disabled firewall it did not help. Renabled firewall with the following rules

sudo ufw allow from 192.168.1.0/24 to any port 3389
sudo ufw allow 3389

it did not help. I checked the 3 log files

~/.xsession-errors /var/log/xrdp.log /var/log/xrdp-sesman.log

nothing is indicated

What might be missing? Thanks for your help.

✔️ Expected Behavior

RDP ubuntu VM as other machines

❌ Actual Behavior

Not being able to RDP to ubuntu machine using xrdp

Anything else?

Here is the log for xrdp.log

[20240802-13:16:06] [INFO ] starting xrdp with pid 913 [20240802-13:16:06] [INFO ] address [0.0.0.0] port [3389] mode 1 [20240802-13:16:06] [INFO ] listening to port 3389 on 0.0.0.0 [20240802-13:16:07] [INFO ] xrdp_listen_pp done [20240802-14:11:44] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:192.168.1.16 port 45444 [20240802-14:11:44] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem [20240802-14:11:44] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem [20240802-14:13:21] [ERROR] libxrdp_force_read: Can't read PDU [20240802-14:13:21] [ERROR] [ITU-T X.224] Connection Sequence: CR-TPDU (Connection Request) failed [20240802-14:13:21] [ERROR] xrdp_sec_incoming: xrdp_iso_incoming failed [20240802-14:13:21] [ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed [20240802-14:13:21] [ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed [20240802-14:13:22] [ERROR] xrdp_iso_send: trans_write_copy_s failed [20240802-14:13:22] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed [20240802-14:13:53] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:192.168.1.16 port 43502 [20240802-14:13:53] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem [20240802-14:13:53] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem [20240802-14:16:13] [ERROR] libxrdp_force_read: Can't read PDU [20240802-14:16:13] [ERROR] [ITU-T X.224] Connection Sequence: CR-TPDU (Connection Request) failed [20240802-14:16:13] [ERROR] xrdp_sec_incoming: xrdp_iso_incoming failed [20240802-14:16:13] [ERROR] xrdp_rdp_incoming: xrdp_sec_incoming failed [20240802-14:16:13] [ERROR] xrdp_process_main_loop: libxrdp_process_incoming failed [20240802-14:16:13] [ERROR] xrdp_iso_send: trans_write_copy_s failed [20240802-14:16:13] [ERROR] Sending [ITU T.125] DisconnectProviderUltimatum failed [20240802-14:33:16] [INFO ] Received termination signal, stopping the server accept new connections thread [20240802-14:33:28] [INFO ] address [0.0.0.0] port [3389] mode 1 [20240802-14:33:28] [INFO ] listening to port 3389 on 0.0.0.0 [20240802-14:33:28] [INFO ] xrdp_listen_pp done [20240802-14:33:30] [INFO ] starting xrdp with pid 3242 [20240802-14:33:30] [INFO ] address [0.0.0.0] port [3389] mode 1 [20240802-14:33:30] [INFO ] listening to port 3389 on 0.0.0.0 [20240802-14:33:30] [INFO ] xrdp_listen_pp done

Here is the log xrdp-sesman.log

[20240801-18:34:45] [INFO ] starting xrdp-sesman with pid 31086 [20240801-19:20:56] [INFO ] shutting down sesman 1 [20240801-19:21:25] [INFO ] starting xrdp-sesman with pid 710 [20240801-22:25:19] [INFO ] shutting down sesman 1 [20240801-22:25:53] [INFO ] starting xrdp-sesman with pid 806 [20240802-12:51:26] [INFO ] shutting down sesman 1 [20240802-12:51:26] [INFO ] starting xrdp-sesman with pid 5217 [20240802-13:15:28] [INFO ] shutting down sesman 1 [20240802-13:16:02] [INFO ] starting xrdp-sesman with pid 877 [20240802-14:33:16] [INFO ] shutting down sesman 1 [20240802-14:33:28] [INFO ] starting xrdp-sesman with pid 3232

and lastlu xorg.conf

Section "ServerLayout" Identifier "X11 Server" Screen "Screen (xrdpdev)" InputDevice "xrdpMouse" "CorePointer" InputDevice "xrdpKeyboard" "CoreKeyboard" EndSection

Section "ServerFlags"

This line prevents "ServerLayout" sections in xorg.conf.d files

# overriding the "X11 Server" layout (xrdp #1784)
Option "DefaultServerLayout" "X11 Server"
Option "DontVTSwitch" "on"
Option "AutoAddDevices" "off"

EndSection

Section "Module" Load "dbe" Load "ddc" Load "extmod" Load "glx" Load "int10" Load "record" Load "vbe" Load "glamoregl" Load "xorgxrdp" Load "fb" EndSection

Section "InputDevice" Identifier "xrdpKeyboard" Driver "xrdpkeyb" EndSection

Section "InputDevice" Identifier "xrdpMouse" Driver "xrdpmouse" EndSection

Section "Monitor" Identifier "Monitor" Option "DPMS" HorizSync 30-80 VertRefresh 60-75 ModeLine "1920x1080" 138.500 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync ModeLine "1280x720" 74.25 1280 1720 1760 1980 720 725 730 750 +HSync +VSync Modeline "1368x768" 72.25 1368 1416 1448 1528 768 771 781 790 +hsync -vsync Modeline "1600x900" 119.00 1600 1696 1864 2128 900 901 904 932 -hsync +vsync EndSection

Section "Device" Identifier "Video Card (xrdpdev)" Driver "xrdpdev" Option "DRMDevice" "/dev/dri/renderD128" Option "DRI3" "1" EndSection

Section "Screen" Identifier "Screen (xrdpdev)" Device "Video Card (xrdpdev)" Monitor "Monitor" DefaultDepth 24 SubSection "Display" Depth 24 Modes "640x480" "800x600" "1024x768" "1280x720" "1280x1024" "1600x900" "1920x1080" EndSubSection EndSection

matt335672 commented 2 months ago

This looks a bit like a networking problem.

What does this mean exactly?

but not from any other machines.

eliassal commented 2 months ago

Hi matt, yes, it was an issue with the networking of the VM. I reinstalled ubuntu 24, then ran apt install xrdp and xordxrdp, and hop everything went through right away and I was able to RDP. Thanks for your response

matt335672 commented 2 months ago

Great - glad you got it working.