3

I have KDE on my Ubuntu and I have installed XRDP. I have startkde in my .xsession but I cannot login into it remotely unless I logout from it first.

The same is true vice-versa. If I logout and then connect using XRDP, I cannot login locally...

Is there any way I can stay logged in and remotely login with the same user?

-- EDIT --

I have a user that is always logged in on my NUC and is running a bunch of applications I need running 24/7. If I set that user to logout after 15 minutes (screen lock) I cannot access my applications (specifically, QBitTorrent Web UI).

I would also like to login to my NUC remotely so I setup OpenVPN and I am trying to login using XRDP. I can ofcourse access QBitTorrent Web UI, for an example, but I would sometimes like to install more applications.

My problem is that I cannot login using XRDP because the user is constantly logged in and running. Dropping a session would also make my applications unavailable after I logout from XRDP, wouldn't it?

2
  • You want to have two separate xrdp windows, with two separate ubuntu sessions running at the same time, but as the same user? Or do you want to "suspend" a session, then pick it up again later?
    – Xen2050
    Commented Dec 29, 2018 at 1:42
  • To be honest, I am a very basic Linux user so it is entirely possible I have a bad setup. I don't know WHAT I really wan't to do, but I know what is bothering me, so I put that in the question, hope that helps...
    – alturkovic
    Commented Dec 29, 2018 at 10:35

1 Answer 1

0

You haven't mentioned the systemd linger setting, well more precisely, logind, so this might be helpful.

It sounds appropriate for your use-case, to run these as systemd services, at the user or system level, instead of needing a session, which serves as a user login environment and process namespace.

Write service files for your services!

See

Running user processes (services*?) independent from session state (logged in/out)

From man loginctl:

   enable-linger [USER...], disable-linger [USER...]
       Enable/disable user lingering for one or more users. If enabled for a specific user, a user manager is
       spawned for the user at boot and kept around after logouts. This allows users who are not logged in to run
       long-running services. Takes one or more user names or numeric UIDs as argument. If no argument is specified,
       enables/disables lingering for the user of the session of the caller.

       See also KillUserProcesses= setting in logind.conf(5).

On systemd services started this way, ArchWiki warns:

Warning: systemd services are not sessions, they run outside of logind. Do not use lingering to enable automatic login as it will break the session.

It also talks about killing users processes on logout: how this breaks tmux/screen, which should be run differently, and [email protected] will be killed when all user sessions are logged out unless lingering is enabled.

Running multiple sessions

Found some indication in:

which are bi-directionally linked.

More about remote login solutions, and relation to loginctl:

You must log in to answer this question.

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