4

According to xrdp docs it should be possible to connect remotely without using a local VNC server:

xrdp can connect to a locally created X.org session with the xorgxrdp drivers [my emphasis], to a VNC X11 server, and forward to another RDP server.

I can connect with RDP from Windows:

enter image description here

Then I select Xorg session and supply username and password. After some timeout an error pops up about an unknown connection problem.

enter image description here

This is tail /var/log/xrdp.log and tail /var/log/xrdp-sesman.log output:

[DEBUG] Closed socket 17 (AF_UNIX)  
...  
[DEBUG] Closed socket 17 (AF_UNIX) 
[DEBUG] xrdp_wm_log_msg: some problem  
[DEBUG] xrdp_mm_module_cleanup  
[DEBUG] Closed socket 16 (AF_INET6 ::1 port 38094)

enter image description here

dmesg doesn't show any problems nor references to Xorg or similar. ps -A | grep rdp shows xrdp and xrdp-sesman processes running. Tried connecting with Windows 7 to Debian: same problem. xrdp.ini and sasman.ini:

In sesman.ini the AlwaysGroupCheck=false. The startwm.sh:

startwm.sh

Any ideas? Running on a virtualized minimal, clean Debian 9.1 installation. Only only lxde-core and xrdp installed with apt-get. (No errors during installation.) xorgxrdp drivers installed (since they depend on xrdp).

Davor Josipovic
  • 341
  • 1
  • 3
  • 13
  • Did you compile xrdp and xorgxrdp from source? xrdp must be compiled and installed before xorgxrdp. If not what versions? What desktop are you using? You may want to install lxde desktop to help with debugging. `xrdp.ini` and `sesman.ini` using default settings? What about `var/log/xrdp-sesman.log` Strange error in xrdp log "some problem"... Does dmesg have any useful info? – jc__ Aug 29 '17 at 14:40
  • @jc__, I didn't compile. I first installed `lxde-core`. Then, once logged in, installed `xrdp` which has a dependency on `xorgxrdp`. I'll update the question with other logs. – Davor Josipovic Aug 29 '17 at 15:27
  • Lets do some background checking: Verify the services are running `ps -A | grep rdp`. You should see both `xrdp` and `xrdp-sesman`. You are using the selection Xorg, so check the Xorg in `xrdp.ini`. Should be `libxup.so` library, `ip=127.0.0.1` `port=-1` then check the Xorg section in `sesman.ini` these are the parameters passed to Xorg. Note the log name. `param=.xorgxrdp.%s.log`. see your home directory for that log. – jc__ Aug 29 '17 at 17:44
  • In `sesman.ini` verify the `AlwaysGroupCheck=` if `false` the login user does not need to be in the group assigned by `TerminalServerUsers=` – jc__ Aug 29 '17 at 17:46
  • Oh yeah, What version of windows are you connecting with? If its above 7.. might be a problem. I had to compile with the `--enable-painter` option to make work with Win10. – jc__ Aug 29 '17 at 17:53
  • ` --> --> ` The log entry: `X server for display 10 startup timeout` makes me think that sesman is not calling Xorg correctly. Poke around the sesman.ini `UserWindowManager=startwm.sh` startwm.sh script. – jc__ Aug 29 '17 at 17:58
  • @jc__ I have updated the question with more info. What I can not find are the `.xorgxrdp.%s.log` files. I figured out that I have to add `param=-logfile` and `param=.xorgxrdp.%s.log` below `[Xorg]`, but still, no log files. Any ideas? – Davor Josipovic Aug 29 '17 at 19:00
  • According to `xorg` [manual](https://manpages.debian.org/stretch/xserver-xorg-core/Xorg.1.en.html) even without `-logfile` parameters the logs should be written to `$XDG_DATA_HOME/xorg/Xorg.n.log`. But I find nothing. Also, setting `-logverbose` has no effect. I have a feeling `xorg` is never run? – Davor Josipovic Aug 29 '17 at 19:42
  • Note that the `.xorgxrdp.%s.log` is a "hidden" file, starts with a ".", and the `$XDG_DATA_HOME/xorg/Xorg.n.log` log is xorg log not xorgxdp. You shoud have both. I think you are correct that X is not starting. The `startwm.sh` script is where sesman starts X. Changes there may be required. You are looking at xorg, I think that is the right place to be. See here for some changes in [startwm.sh](https://askubuntu.com/questions/135483/how-to-configure-xrdp-to-start-cinnamon-as-default-desktop-session) – jc__ Aug 29 '17 at 20:27
  • @jc__ I have found [this bug report](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=849342) which shows the exact same symptoms. The solution is to purge the `xserver-xorg-legacy`. I did that and it NOW WORKS!! And yes, I can see hidden files with `PCManFM`. – Davor Josipovic Aug 29 '17 at 20:31
  • BTW: I just custom compiled xrdp and xorgxrdp for Mint 18 (Ubuntu 16 based) It was the closest I had to debian 9, and after installing a couple of dependencies it went really smooth. Sometimes the repo versions are a few versions behind. You could always look [there](https://github.com/neutrinolabs) for help on configuring too. – jc__ Aug 29 '17 at 20:34
  • @jc__ Thanks for the help. Doubt I have gotten this far without you! You can post an answer and I'll accept. I'll leave this discussion. It certainly will help someone in the future. I just wonder now whether purging `xserver-xorg-legacy` is the right thing to do. Will it break anything else? – Davor Josipovic Aug 29 '17 at 20:37
  • Am I correct in thinking that the `startwm.sh` script is basically what it takes to start a desktop from the command line. So if you made your pc boot to terminal not GUI and then what ever you need to type on the cli to get the GUI started would be the same as what sesman needed? – jc__ Aug 29 '17 at 20:38
  • `xserver-xorg-legacy` I really do not know. Oh wait you said it now works!. – jc__ Aug 29 '17 at 20:40
  • @jc__ yes, it works after purging `xserver-xorg-legacy` like described in that bug report. – Davor Josipovic Aug 29 '17 at 20:41
  • Now just tear it all down and do it again with a step by step as an answer. I will vote for it. – jc__ Aug 29 '17 at 20:44
  • @jc__ yes, good idea. Back to the first snapshot... – Davor Josipovic Aug 29 '17 at 20:47
  • @jc__ Ok, so it seems that `xserver-xorg-legacy` was installed with `lxde-core`. So I purged the `xserver-xorg-legacy` and installed `xrdp` and I could immediately login -- no reboot required. What a first experience with Debian 9... :( Anyway, I'll answer. Feel free to edit as you see fit. You have much more experience than me. And thanks again! – Davor Josipovic Aug 29 '17 at 21:03

3 Answers3

9

This bug report has the same symptoms as described in the question. Seems xserver-xorg-legacy package is the culprit. So to make it work, it boils down to the following two commands:

apt-get purge xserver-xorg-legacy
apt-get install xrdp

The required services are started automatically after install. No need to reboot. Connecting and authenticating should automatically show the desktop.

I do not know though what the consequences are of removing xserver-xorg-legacy. In the bug report it is mentioned to remove if not needed.

Davor Josipovic
  • 341
  • 1
  • 3
  • 13
0

You can refer to the question!

Attention: you need to use dpkg-reconfigure xserver-xorg-legacy command to change the setting in debian 9.

  • 1
    Welcome to StackExchange. Your referenced questions doesn't contain the quoted text. Can you explain why `dpkg-reconfigure xserver-xorg-legacy` is needed? – Davor Josipovic Oct 25 '18 at 19:35
0

Initially, I could only access my Debian 9.6.0 LXDE desktop with tigervnc using the Xvnc settings until I changed the file /etc/X11/Xwrapper.config from:

allowed_users = console

to

allowed_users = anybody

Now, I can RDP using the Xorg settings without the tigervnc. Hope this will be helpful to someone.

There was no need to use any of the recommended answers here...

And don't forget...

sudo service xrdp restart

...to restart the xrdp service after editing the Xwrapper.config file.

sdittmar
  • 121
  • 6