Bug 490665

Summary: RDP Server is initiated at startup and I can't changed that, options in Settings is not working.
Product: [KDE Neon] neon Reporter: paninomaninodesu
Component: Packages Unstable EditionAssignee: Neon Bugs <neon-bugs>
Status: RESOLVED FIXED    
Severity: major CC: ahiemstra, akselmo, benedict.hewson, guillermorojo42, jr, kde, kevindu52defargoth, neon-bugs, ray
Priority: HI    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: remote desktop settings screenshot

Description paninomaninodesu 2024-07-22 19:10:08 UTC
Created attachment 171902 [details]
remote desktop settings screenshot

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY


STEPS TO REPRODUCE
1. Go to Remote Desktop category into Settings
2. Click on "Autostart on login"
3. 

OBSERVED RESULT
The checkbox does not respond.

EXPECTED RESULT
The checkbox to work so I could chose if I wanted the Remote Desktop option to auto start or not.
Currently I don't want it, but it starts at login even with the option unchecked.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Neon User
(available in About System)
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4
Qt Version: 6.7.0

ADDITIONAL INFORMATION
Comment 1 guillermorojo42 2024-07-30 13:14:44 UTC
Steps to reproduce:

1.System Settings->Remote Desktop: click ‘Enable RDP server’ (Effect: toggle button becomes activated, ‘xdg-desktop-portal-kde’ and ‘RDP server’ icons appears in taskbar)

2. System Settings->Remote Desktop: click Enable RDP server (Effect: toggle button becomes deactivated)

3. Click on ‘xdg-desktop-portal-kde’ in taskbar and choose End (Effect: ‘RDP Server’ icon in taskbar disappears, along with ‘xdg-desktop-portal-kde’).

4. Restart system.

5. After logging in, both ‘xdg-desktop-portal-kde’ and ‘RDP server’ icons appear in taskbar and toggle button ‘Enable RDP server’ is activated in System Settings->Remote Desktop.
Comment 2 paninomaninodesu 2024-07-31 22:40:59 UTC
System updated, not it has Qt 6.7.2 among other things.

Now in the System Settings the toggle to start the RDP Service works. When I click on it the RDP Server icon appears on the Notification Area. If I right click on it "Quit", the RDP Service stops, though the System Settings page doesn't update in real time, I have to leave the page and enter it again to see that the toggle is off.

But my "problem persists".
Even if I leave the RDP Service disable in the System Settings, every time I restart Neon the RDP Server Icon is there on the Notification Are. Is that how it's supposed to be? Leaving the Service disabled I expected not to see that Icon there.
Comment 3 Ben 2024-08-03 10:31:37 UTC
I have exactly the same problem.

I enabled the "Enabled RDP server" switch to test.

Now every time I login the RDP server is started automatically which I don't want.  
The "Autostart on login" check box is not checked and is greyed out regardless of if the "Enable RDP server" is enabled or disabled.

 If  into the Settings and turn off "Enable RDP server", log out then back in, the RDP server is starting again. If I check back in the settings "Enable RDP server" is checked again.   This setting is not getting saved.

It seems that once this feature has been enabled, you can't disable it.  This is clearly a bug.
Comment 4 Arjen Hiemstra 2024-08-05 07:56:26 UTC
What does `systemctl --user status plasma-krdp_server.service` output?

I suspect Neon has KRdp enabled by default and the KCM is failing to detect that.
Comment 5 Ben 2024-08-05 08:04:20 UTC
I believe it was enbaled, obviously because it kept starting

However doing 

systemctl --user disable --now plasma-krdp_server.service

to disable it, and it was still being enabled the next time I logged in.
It is a bit pointless having a disable switch in settings if it doesn't disable the service.

In the end I deleted /usr/lib/systemd/user/plasma-krdp_server.service
Not sure if any updates will reinstall the file though.
Comment 6 Akseli Lahtinen 2024-08-05 10:18:46 UTC
I am unable to reproduce this issue on my system

Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.9.12-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600

However there is a merge request for allowing changing settings even when server is on: https://invent.kde.org/plasma/krdp/-/merge_requests/57

I will try this inside a Neon VM and see if I can repro it there.
Comment 7 Akseli Lahtinen 2024-08-05 10:47:03 UTC
I can confirm this only happens on KDE Neon User.

Will investigate further why exactly, but the autostart on login is not supposed to be on by default..
Comment 8 Akseli Lahtinen 2024-08-05 10:54:55 UTC
On Neon, if i toggle it off from settings, it still autostarts. It's like forced to autostart on Neon?
Comment 9 Ben 2024-08-05 12:03:19 UTC
I am running Neon.  

I think this auto starting only started after the recent update.  But I am not 100% sure on that.  I can't remember exactly when I enabled and then disabled the RDP server in the settings. 

Operating System: KDE neon 6.0
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.5.0-45-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 31.2 GiB of RAM
Comment 10 Ben 2024-08-19 07:56:16 UTC
Just updated Neon this morning now at

Operating System: KDE neon 6.0
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.8.0-40-generic (64-bit)
Graphics Platform: Wayland

Remote desktop is starting automatically again when I login.
Once logged in, if I go to settings and turn off "Enable RDP server", logout and then login in again it is always enabled.
I have a second account created when Neon was installed and never used.  This account has never had Remote Desktop enabled. Logging in with this account does not start Remote Desktop and checking in Settings it is not enabled.

So where is the "Enable RDP server" setting stored ?  Because it would seem that it is never changed once enabled.
I have had a look through the various config files but can't find anything obvious.
Comment 11 Ben 2024-08-19 08:21:14 UTC
(In reply to Ben from comment #10)
> Just updated Neon this morning now at
> 
> Operating System: KDE neon 6.0
> KDE Plasma Version: 6.1.4
> KDE Frameworks Version: 6.5.0
> Qt Version: 6.7.2
> Kernel Version: 6.8.0-40-generic (64-bit)
> Graphics Platform: Wayland
> 
> Remote desktop is starting automatically again when I login.
> Once logged in, if I go to settings and turn off "Enable RDP server", logout
> and then login in again it is always enabled.
> I have a second account created when Neon was installed and never used. 
> This account has never had Remote Desktop enabled. Logging in with this
> account does not start Remote Desktop and checking in Settings it is not
> enabled.
> 
> So where is the "Enable RDP server" setting stored ?  Because it would seem
> that it is never changed once enabled.
> I have had a look through the various config files but can't find anything
> obvious.

  **** EDIT *****
Ok after loging in and then out on the second account the RDP server is also being automatically started on this account as well.
Comment 12 David Edmundson 2024-08-19 09:47:48 UTC
We have a working theory. 

Can you run

`find / -name plasma-krdp_server.service 2> /dev/null`

and report back.
Comment 13 Ben 2024-08-19 10:02:11 UTC
(In reply to David Edmundson from comment #12)
> We have a working theory. 
> 
> Can you run
> 
> `find / -name plasma-krdp_server.service 2> /dev/null`
> 
> and report back.

OK found this.

/var/lib/systemd/deb-systemd-user-helper-enabled/graphical-session.target.wants/plasma-krdp_server.service
/etc/systemd/user/graphical-session.target.wants/plasma-krdp_server.service
Comment 14 David Edmundson 2024-08-19 11:09:06 UTC
It'll need a Neon fix, fortunately it only affected users running git master. Moving to Neon and writing some notes for them:

 - krdp installed a file into /etc/systemd/user/graphical-session.target.wants/plasma-krdp_server.service  
 
 - krdp then stopped installing it there, because it's the wrong place
 - some users who ran master for a while still have the file there

lingering systemd file in /etc need to be removed using rm_conffile in package.maintscript 
https://manpages.debian.org/buster/dpkg/dpkg-maintscript-helper.1.en.html#Removing_a_conffile https://manpages.debian.org/buster/debhelper/dh_installdeb.1.en.html#FILES"
Comment 15 Jonathan Riddell 2024-08-19 13:45:29 UTC
Fix in building now...
remote: The commits in this series can be viewed at:
remote: https://invent.kde.org/neon/neon-packaging/krdp/-/commit/6d8912be05d8df9709f3df1067b1a663227d8f19
remote: https://invent.kde.org/neon/neon-packaging/krdp/-/commit/309f988838d3b550dad1da618e5df3de98f240db
Comment 16 Jonathan Riddell 2024-08-19 14:30:41 UTC
I checked in a docker and that file is now removed on upgrade

Thanks for helping diagnose it David and Ben
Comment 17 Akseli Lahtinen 2024-09-02 08:07:56 UTC
*** Bug 492224 has been marked as a duplicate of this bug. ***
Comment 18 David Edmundson 2024-09-16 10:38:40 UTC
*** Bug 492690 has been marked as a duplicate of this bug. ***