Bug 377911 - [Wayland] KRDC should use libfreerdp instead of embedding the client (doesn't work properly under Wayland)
Summary: [Wayland] KRDC should use libfreerdp instead of embedding the client (doesn't...
Status: RESOLVED FIXED
Alias: None
Product: krdc
Classification: Applications
Component: RDP (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Urs Wolfer
URL:
Keywords: wayland
: 395693 436554 475315 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-03-22 05:30 UTC by sunwebrw
Modified: 2024-03-08 01:13 UTC (History)
20 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
wayland.patch (659 bytes, patch)
2019-01-28 23:34 UTC, Andrius Štikonas
Details
Can't run "wlfreerdp". Check the installation of that program (30.72 KB, image/png)
2021-11-27 16:29 UTC, Andrey E.
Details
attachment-14233-0.html (2.77 KB, text/html)
2021-12-27 17:25 UTC, Tony Murray
Details
wlfreerdp missing in wayland (49.50 KB, image/png)
2022-06-13 06:26 UTC, johnathan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sunwebrw 2017-03-22 05:30:08 UTC
KRDC version 16.12.3
freerdp version 1.2.0_20170201

It shows an error that says:
"The version of "xfreerdp" you are using is too old.
xfreerdp 1.0.2 or greater is required."
Comment 1 Urs Wolfer 2017-04-06 20:25:43 UTC
What version of xfreerdp do you have installed? Most probably it is too old as the error message says.
Comment 2 sunwebrw 2017-04-13 18:03:45 UTC
(In reply to Urs Wolfer from comment #1)
> What version of xfreerdp do you have installed? Most probably it is too old
> as the error message says.

It is in my original message - 1.2.0
Comment 3 sunwebrw 2017-08-23 07:28:32 UTC
Its freerdp 2.0 already and KRDC still gives me the same error message. Remmina works, KRDC doesn't.
Comment 4 Tony Murray 2017-11-20 18:00:45 UTC
Are you using wayland?

I've noticed that xembed is failing under wayland (xwayland).

Which triggers this error message with misleading text in this case:
https://github.com/KDE/krdc/blob/af24d8d45ce74c299bd13bd1b881bc967f8f482f/rdp/rdpview.cpp#L447
Comment 5 Michael 2018-01-02 13:38:02 UTC
I have noticed the same issue. It's worth to mention that this is only wayland related - a regular x session does not lead to this error.

krdc 17.12.0
FreeRDP version 2.0.0-rc1
Comment 6 Knut Andre Tidemann 2018-04-12 17:46:19 UTC
As a workaround until this gets fixed, you can start KRDC like this to run it under XWayland:

QT_QPA_PLATFORM=xcb krdc

This works in Arch Linux at least.
Comment 7 Markus Rathgeb 2018-04-26 14:42:10 UTC
Same here.
It does not work if QT_QPA_PLATFORM is set to wayland, but it works if QT_QPA_PLATFORM is set to xcb.
If wayland is used it complains about a too old xfreerdp version (comment 1), but it does not complain if X11 is used. The used version of freerdp on my system is 2.0.0_rc1-r1 (Gentoo package version).
Comment 8 Markus Rathgeb 2018-05-02 11:23:16 UTC
Urs Wolfer, on my system freerdp comes with two binaries:
/usr/bin/xfreerdp
/usr/bin/wlfreerdp

I assume for Wayland we should use wlfreerdp for Wayland.

Do you work on KRDC on Wayland support?
Comment 9 Urs Wolfer 2018-05-02 18:20:16 UTC
> Do you work on KRDC on Wayland support?

No, I do not work on it. I'm happy to review such a change though. Feel free to create one and push it to reviewboard: https://git.reviewboard.kde.org/r/
Comment 10 Alexander Mentyu 2018-06-21 19:20:40 UTC
*** Bug 395693 has been marked as a duplicate of this bug. ***
Comment 11 Andrius Štikonas 2019-01-28 23:34:29 UTC
Created attachment 117710 [details]
wayland.patch

Perhaps something like this to start with.

It still doesn't embed window on Wayland but at least it shows it in the external window.
Comment 12 Andrius Štikonas 2019-02-12 23:40:43 UTC
I've pushed improved patch as:

https://cgit.kde.org/krdc.git/commit/?id=94c7c9ada2103ef8274dd6046e69fe82d7b755d2

I'll leave the bug open until somebody fixes embedding wayland RDP window into krdc.
Comment 13 Tony Murray 2019-02-14 13:48:34 UTC
Wayland does not support embedding one process' window in another.

To fix this, it probably needs to use the xfreerdp libraries and draw into the krdc window.
Comment 14 Andrius Štikonas 2019-02-15 11:37:50 UTC
> --- Comment #13 from Tony Murray <murraytony@gmail.com> ---
> Wayland does not support embedding one process' window in another.
> 
> To fix this, it probably needs to use the xfreerdp libraries and draw 
> into the
> krdc window.

Is this really the case? I haven't looked at Wayland in enough detail to 
know.

it might be worth looking at what mpv does on Wayland. There is 
something here:
https://github.com/mpv-player/mpv/commit/8d8d4c5cb1b3553215a8ba547d4db463fdc88831
Comment 15 Andrius Štikonas 2019-02-16 18:37:07 UTC
Lowering priority to Normal since part of functionality is restored.
Comment 16 Andrey E. 2021-11-27 16:29:06 UTC
Created attachment 144003 [details]
Can't run "wlfreerdp". Check the installation of that program

KRDC works fine at X11 session, but shows that bug at Wayland session.

Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-40-generic (64-bit)
Graphics Platform: Wayland
Processors: 6 × AMD Ryzen 5 4500U with Radeon Graphics
Memory: 5.7 ГиБ of RAM
Graphics Processor: AMD RENOIR
Comment 17 Andrius Štikonas 2021-11-27 16:31:28 UTC
(In reply to Andrey E. from comment #16)
> Created attachment 144003 [details]
> Can't run "wlfreerdp". Check the installation of that program
> 
> KRDC works fine at X11 session, but shows that bug at Wayland session.
> 
> Operating System: KDE neon 5.23
> KDE Plasma Version: 5.23.3
> KDE Frameworks Version: 5.88.0
> Qt Version: 5.15.3
> Kernel Version: 5.11.0-40-generic (64-bit)
> Graphics Platform: Wayland
> Processors: 6 × AMD Ryzen 5 4500U with Radeon Graphics
> Memory: 5.7 ГиБ of RAM
> Graphics Processor: AMD RENOIR

Can you start RDP using wlfreerdp directly (without KRDC)?
Comment 18 Andrey E. 2021-11-27 16:43:19 UTC
(In reply to Andrius Štikonas from comment #17)
> (In reply to Andrey E. from comment #16)
> Can you start RDP using wlfreerdp directly (without KRDC)?

At first time Bash did not found 'wlfreerdp' command.
After installation of 'freerdp2-wayland' via apt error message in KRDC disappeared, but KRDC doesn't show my guest session.
There are two windows like on Bug #436554: https://bugs.kde.org/show_bug.cgi?id=436554
Comment 19 Andrius Štikonas 2021-11-27 19:37:08 UTC
(In reply to Andrey E. from comment #18)
> (In reply to Andrius Štikonas from comment #17)
> > (In reply to Andrey E. from comment #16)
> > Can you start RDP using wlfreerdp directly (without KRDC)?
> 
> At first time Bash did not found 'wlfreerdp' command.
> After installation of 'freerdp2-wayland' via apt error message in KRDC
> disappeared, but KRDC doesn't show my guest session.
> There are two windows like on Bug #436554:
> https://bugs.kde.org/show_bug.cgi?id=436554

So first one (missing wlfreerdp) is distro issue. You can report it to packagers of your distro. Second one was already discussed in this thread, that's expected with the current code. Embedding would be nice to get working but it's not implemented.
Comment 20 Andrius Štikonas 2021-11-27 19:37:27 UTC
*** Bug 436554 has been marked as a duplicate of this bug. ***
Comment 21 Krisztián Szegi 2021-12-10 06:27:48 UTC
Hi all,
Excuse me for the heresy but:

For two weeks, KRDC just crashed akonadi when connecting to a remote with RDP on wayland, so I had to look at different solutions: I used Remmina!
I did not test KRDC regularily, but now it is "working" again. My takeaway from this experience however:
 - Remmina uses libfreerdp2-2, and mostly "just works"
 - UI-vise, KRDC is a bit outdated (indirectly, but relevant)

Tony Murray
> To fix this, it probably needs to use the xfreerdp libraries and draw into the krdc window.

I think that is the only way forward. Embedding freerdp or wlfreerdp is, and was - IMO - a bad design decision. But I presume a thin wrapper around (wl)freerdp was the easiest initial solution to a GUI app. Now wayland is just making this more apparent. 
Remmina spawns a new Remmina for each connection, (each with a connection control interface of its own, similari to Teamviewer's or Windows RDC's interface), that is just not trivially possible with the current KRDC arch on wayland.
Comment 22 Tony Murray 2021-12-27 17:25:10 UTC
Created attachment 144898 [details]
attachment-14233-0.html

KRDC originally used rdesktop for rdp, which did not have a library, so the
only option was to xembed.
When KRDC switched to FreeRDP, the easiest option was to map the existing
xembed to the xfreerdp client, this worked well initially.

Basically, the best (but most difficult) path forward is to create a new
rdp backend utilizing libfreerdp2.  Unfortunately, KRDC has no active
maintainer currently. (My time is otherwise occupied and I am not a very
good C++ coder)

On Fri, Dec 10, 2021 at 12:27 AM Krisztián Szegi <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=377911
>
> Krisztián Szegi <crossszegi@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |crossszegi@gmail.com
>
> --- Comment #21 from Krisztián Szegi <crossszegi@gmail.com> ---
> Hi all,
> Excuse me for the heresy but:
>
> For two weeks, KRDC just crashed akonadi when connecting to a remote with
> RDP
> on wayland, so I had to look at different solutions: I used Remmina!
> I did not test KRDC regularily, but now it is "working" again. My takeaway
> from
> this experience however:
>  - Remmina uses libfreerdp2-2, and mostly "just works"
>  - UI-vise, KRDC is a bit outdated (indirectly, but relevant)
>
> Tony Murray
> > To fix this, it probably needs to use the xfreerdp libraries and draw
> into the krdc window.
>
> I think that is the only way forward. Embedding freerdp or wlfreerdp is,
> and
> was - IMO - a bad design decision. But I presume a thin wrapper around
> (wl)freerdp was the easiest initial solution to a GUI app. Now wayland is
> just
> making this more apparent.
> Remmina spawns a new Remmina for each connection, (each with a connection
> control interface of its own, similari to Teamviewer's or Windows RDC's
> interface), that is just not trivially possible with the current KRDC arch
> on
> wayland.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 23 Shmerl 2022-01-06 20:36:43 UTC
Just to confirm, I tired it with krdc 21.12.0 and freerdp  2.4.1 (from Debian testing).

Most of the time it fails to do anything in Wayland session. One time it somehow managed to open a separate window for freerdp client.

When running as QT_QPA_PLATFORM=xcb krdc it works fine.
Comment 24 johnathan 2022-06-13 06:25:37 UTC
i am on latest kde neon and i am facing the same bug. krdc refuses to work on wayland while on x11 it works perfectly.

attaching screenshot

Operating System: KDE neon 5.24
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
Kernel Version: 5.13.0-48-generic (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz
Memory: 7.7 GiB of RAM
Graphics Processor: Mesa DRI Intel® HD Graphics 4400
Comment 25 johnathan 2022-06-13 06:26:11 UTC
Created attachment 149655 [details]
wlfreerdp missing in wayland
Comment 26 Andrius Štikonas 2022-06-16 09:30:58 UTC
(In reply to johnathan from comment #24)
> i am on latest kde neon and i am facing the same bug. krdc refuses to work
> on wayland while on x11 it works perfectly.
> 
that's not krdc bug. You can report it to neon if you want but it's simply an issue of missing runtime dependencies.
Comment 27 Malte S. Stretz 2023-10-13 15:41:02 UTC
(In reply to Andrius Štikonas from comment #12)
> I'll leave the bug open until somebody fixes embedding wayland RDP window
> into krdc.

KRDC 23.08.2 works fine for me apart from the separate window for the client. I changed the bug summary to reflect the outstanding change.
Comment 28 Malte S. Stretz 2023-10-13 15:41:45 UTC
*** Bug 475315 has been marked as a duplicate of this bug. ***
Comment 29 Tony Murray 2024-03-08 01:13:56 UTC
This is fixed by https://invent.kde.org/network/krdc/-/merge_requests/58

Unfortunately, there is still a lot of missing functionality.  Any help restoring/adding that is appreciated.