Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sesman does not separate sessions per application (Start-up program in Remmina) #3333

Open
albert-a opened this issue Dec 7, 2024 · 6 comments

Comments

@albert-a
Copy link

albert-a commented Dec 7, 2024

xrdp version

0.10.80

Detailed xrdp version, build options

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

  Configure options:
      --enable-fuse
      --enable-jpeg
      --enable-rfxcodec
      --enable-mp3lame
      --enable-vsock
      --enable-painter

  Compiled with OpenSSL 3.3.1 4 Jun 2024

Operating system & version

Ubuntu 24.10

Installation method

git clone & make install

Which backend do you use?

xorgxrdp

What desktop environment do you use?

openbox

Environment xrdp running on

Incus container

What's your client?

org.remmina.Remmina - 1.4.35 (git n/a)

Area(s) with issue?

Session manager (sesman)

Steps to reproduce

Create two or more connections within Remmina UI with all parameters equal except Advanced -> Start-up program. For example:

  • 1st connection with Start-up program: xterm
  • 2nd connection with Start-up program: chromium-browser

Start 1st connection, xterm opens. Then start 2nd connection.

✔️ Expected Behavior

2nd connection starts with chromium-browser open. 1st connection should be left open intact.

❌ Actual Behavior

When you start 2nd connection, 1st connection closes and appears in place of second connection with xterm open. Furthermore the same happens when you start Desktop session (with empty Start-up program).

Anything else?

I think any two sessions should be separated if their Start-up program is different, regardless of the Policy parameter. Just like it is implemented in Windows servers.

Current workaround is to specify different screen resolution for each connection and set Policy=UBD in sesman.ini

I also tested 0.10.1 and 0.9.24 versions. The described behavior was also observed.

@albert-a albert-a added the bug label Dec 7, 2024
@matt335672
Copy link
Member

This could be implemented, but there's a significant limitation on many Linuxes which makes it virtually unusable.

In general, one user cannot have multiple graphical sessions open in Ubuntu, or indeed any system using systemd --user. This is a consequence of the way systemd is designed and not anything which we could fix within xrdp. See this related entry in the FAQ.

You might get away with it for an xterm and a browser, but two complex programs could not be supported using the same user.

Another significant problem is we don't support RAIL, so each program will appear in its own desktop.

@albert-a
Copy link
Author

albert-a commented Dec 8, 2024

Thanks for the info, I actually read the FAQ. But I don't quite understand what might not work.

I'm currently testing this with two different programs and everything is quite good.
Two applications is currently separated by the workaround with display resolution. Could you please explain or point me to an explanation of what issues I can expect with this approach?

Another significant problem is we don't support RAIL, so each program will appear in its own desktop

This is exactly what I want. I need each application to run in a separate desktop, I just created a script to run appliations, I named it openbox-one-app:

#!/bin/sh
openbox &
"$@"
openbox --exit

then I specify Start-up program in Remmina as openbox-one-app chromium-browser
This way the applications get resized automatically, since I configured openbox to open applications maximized, and in pair with setting DisconnectedTimeLimit in sesman.ini you can just close the connection to close application. Very convenient. No need to use RAIL.

@matt335672
Copy link
Member

It's a bit complex. The FAQ only covers the main case which affects us.

Each user can only have on instance of systemd --user running at any one time. This instance can only have one DISPLAY variable set, so if anything is running under systemd --user, it can't be shared between sessions.

One example of this is gnome-terminal. I'm running on Ubuntu 22.02 with XFCE here. I can start multiple terminal windows, but they are all implemented by gnome-terminal-server which runs under systemd --user:-

$ systemctl --user status gnome-terminal-server.service
● gnome-terminal-server.service - GNOME Terminal Server
     Loaded: loaded (/usr/lib/systemd/user/gnome-terminal-server.service; stati>
     Active: active (running) since Mon 2024-12-09 13:36:59 GMT; 2min 35s ago
   Main PID: 2697 (gnome-terminal-)
      Tasks: 4 (limit: 9437)
     Memory: 14.2M
        CPU: 350ms
     CGroup: /user.slice/user-1001.slice/[email protected]/app.slice/app-org.gn>
             └─2697 /usr/libexec/gnome-terminal-server

Dec 09 13:36:59 xrdp-test systemd[1990]: Starting GNOME Terminal Server...
Dec 09 13:36:59 xrdp-test systemd[1990]: Started GNOME Terminal Server.

As a result, although I suspect with your setup you can start multiple GNOME terminals, they will all appear to be in the same session. With the way you're using openbox (which I think is very nice), this will be fairly clear.

If this does work for you however, have a look at Policy=Separate for xrdp 0.10.x and later. I think this does pretty much what you want without messing about with resolutions.

@albert-a
Copy link
Author

albert-a commented Dec 11, 2024

Thanks for your explanation, I've checked the gnome-terminal and I see what you mean, I can confirm that when you open the terminal in the second session it opens in first, next to already opened terminal.

But this is absolutely OK for the most of applications, because I usually don't want multiple instances of the same application, but rather a single instance of different applications. Furthermore everything else that I tried except gnome-terminal work even in multiple desktops.

Thanks for your hint about Policy=Separate but unfortunately it is not quite what I wanted.

  1. If I forget, that the application is already open, I would like to return to it rather than open it second time.
  2. When you accidentally close the connection, it may lead to a data loss.

I think the feature in the request is indeed very handy and will work for the majority of cases (at least for me), and make XRDP consistent with Windows RDS, why not?

Anyway, If you think that it does not worth the effort, we still have the display resolution hack. But if it was implemented it would be cleaner and easier, not to keep in mind what resolutions are already taken for the other apps :)

@matt335672
Copy link
Member

It's not for me to say how people should use the product - I'm just a developer.

In any case, we've had a good discussion about this, and I think you've made a great case so I've marked it as a suggestion.

@albert-a
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants