Bug 435338 - Krfb on Wayland doesn't accept remote keyboard input
Summary: Krfb on Wayland doesn't accept remote keyboard input
Status: RESOLVED FIXED
Alias: None
Product: krfb
Classification: Applications
Component: general (show other bugs)
Version: 22.04.1
Platform: unspecified Linux
: NOR major
Target Milestone: ---
Assignee: George Goldberg
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2021-04-04 08:07 UTC by Fushan Wen
Modified: 2023-02-16 08:29 UTC (History)
26 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.04


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fushan Wen 2021-04-04 08:07:33 UTC
SUMMARY
When Wayland is enabled, keyboard is unusable on remote desktop.

STEPS TO REPRODUCE
1. Run Krfb to enable remote desktop server, allow mouse and keyboard control.
2. Connect to the server using any VNC client.
3. Press any key in any text field (e.g. Lock screen password field).

OBSERVED RESULT
No keyboard input on remote desktop

EXPECTED RESULT
Keyboard input on remote desktop

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 21.04
KDE Plasma Version: 5.21.3
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
$ sudo apt-cache policy krfb
krfb:
  Installed: 4:20.12.3-0ubuntu1
  Candidate: 4:20.12.3-0ubuntu1
  Version table:
 *** 4:20.12.3-0ubuntu1 500
        500 https://mirrors.tuna.tsinghua.edu.cn/ubuntu hirsute/universe amd64 Packages
        100 /var/lib/dpkg/status
Comment 1 Buovjaga 2021-05-09 08:34:15 UTC
I reproduce this with Arch Linux, Plasma Wayland on both server and client, PipeWire, xdg-desktop-portal and xdg-desktop-portal-kde. Connecting via krdc client.
Comment 2 Alexey Min 2021-05-23 23:02:13 UTC
I vaguely remember that this is simply not implemented on compositor side (kwin)
Comment 3 Matt 2022-03-28 00:44:13 UTC
has this been fixed? I noticed that its no longer on the Wayland Show stoppers list and the pipewire portal window has UI exposed for sharing mouse, keyboard and touch?
https://i.imgur.com/4aZMh23.png

However when I tried VNCing to my workstation from my phone, keyboard input from the vnc app still didnt work
Comment 4 Yulian Kuncheff 2022-04-13 03:18:29 UTC
Has there been any update on this? This feels somewhat urgent as its currently the only real way to remote desktop into a Wayland Plasma setup.

Teamviewer doesn't support Wayland
Anydesk doesn't support Wayland
Rustdesk doesn't support Wayland KDE
Wayvnc only supports wlroots wayland
NX says they support it, but it doesn't actually work when I last tried it.

The closest I have gotten to it is with Sunshine + Moonlight. But Sunshine currently has a segfault bug with KDE Wayland on AMD graphics cards, so it doesn't work there either.
Comment 5 Paul Chaffey 2022-04-14 09:03:25 UTC
Kubuntu Beta 22.04 and krfb 22.12.3 in Wayland - keyboard and mouse don't work on the client
Comment 6 Paul Chaffey 2022-04-14 09:04:01 UTC
Kubuntu Beta 22.04 and krfb 22.12.3 in Wayland - keyboard and mouse don't work on the client
Comment 7 Paul Chaffey 2022-04-14 10:08:23 UTC
(In reply to Yulian Kuncheff from comment #4)
> Has there been any update on this? This feels somewhat urgent as its
> currently the only real way to remote desktop into a Wayland Plasma setup.
> 
> Teamviewer doesn't support Wayland
> Anydesk doesn't support Wayland
> Rustdesk doesn't support Wayland KDE
> Wayvnc only supports wlroots wayland
> NX says they support it, but it doesn't actually work when I last tried it.
> 
> The closest I have gotten to it is with Sunshine + Moonlight. But Sunshine
> currently has a segfault bug with KDE Wayland on AMD graphics cards, so it
> doesn't work there either.

I feel your pain Yulian - this is one of the bugs I need fixed urgently.
Comment 8 Josh 2022-04-14 12:47:39 UTC
Issue is only when connecting to a wayland session, not from. Sorely affected by this as well and have been for some time. Is there a wl-roots standard that would assist us in resolving this problem?
Comment 9 Bogdan Bivolaru 2022-05-02 17:09:21 UTC
(In reply to Josh from comment #8)
> Issue is only when connecting to a wayland session, not from. Sorely
> affected by this as well and have been for some time. Is there a wl-roots
> standard that would assist us in resolving this problem?

I _guess_ this is relevant here:
Wayvnc is a VNC server for WL-roots based compositor https://github.com/any1/wayvnc/tree/master/protocols:
at minimum I guess we would need virtual-keyboard-unstable-v1.xml and wlr-virtual-pointer-unstable-v1.xml

Gnome VNC source code confuses me a lot, I do not understand if this feature is implemented or not: https://gitlab.gnome.org/search?search=keyboard&group_id=&project_id=12409&scope=&search_code=true&snippets=false&repository_ref=master&nav_source=navbar

I would have hoped that all the remote desktop streams would be handled via pipewire eventually. My logic is that all stream types need buffering and to be routed from a producer node to a consumer. Since some are more latency dependent than others it would be great if there was a panel where mixing and matching streams could be made... say like WirePlumber session manager. I don't see why video, audio streams need to be managed separately from keyboard, mouse, clipboard, other data event streams.
Comment 10 Bogdan Bivolaru 2022-05-06 23:26:05 UTC
(In reply to Bogdan Bivolaru from comment #9)
> (In reply to Josh from comment #8)
> > Issue is only when connecting to a wayland session, not from. Sorely
> > affected by this as well and have been for some time. Is there a wl-roots
> > standard that would assist us in resolving this problem?
> 
> I _guess_ this is relevant here:
> Wayvnc is a VNC server for WL-roots based compositor
> https://github.com/any1/wayvnc/tree/master/protocols:
> at minimum I guess we would need virtual-keyboard-unstable-v1.xml and
> wlr-virtual-pointer-unstable-v1.xml
> 
> Gnome VNC source code confuses me a lot, I do not understand if this feature
> is implemented or not:
> https://gitlab.gnome.org/
> search?search=keyboard&group_id=&project_id=12409&scope=&search_code=true&sni
> ppets=false&repository_ref=master&nav_source=navbar
> 
> I would have hoped that all the remote desktop streams would be handled via
> pipewire eventually. My logic is that all stream types need buffering and to
> be routed from a producer node to a consumer. Since some are more latency
> dependent than others it would be great if there was a panel where mixing
> and matching streams could be made... say like WirePlumber session manager.
> I don't see why video, audio streams need to be managed separately from
> keyboard, mouse, clipboard, other data event streams.

UPDATE: comment from the  Elsie Hupp, author of (any1)[https://github.com/any1/wayvnc/discussions/93#discussioncomment-741946]
I wouldn't be opposed to a PR implementing Gnome support, but I'd much rather that the Gnome people implement proper wayland protocols for screen capturing instead of putting everything on dbus
Comment 11 Bogdan Bivolaru 2022-05-17 17:39:14 UTC
Here https://wayland.app/protocols/virtual-keyboard-unstable-v1 is a more authoritative source on the Wayland virtual keyboard protocol (there is a similar one for pointers, I do not know about virtual touch). 
I also find such a protocol useful for software testing.
Comment 12 Paul Chaffey 2022-06-08 12:19:07 UTC
A small update, I have moved to pipewire in Kubuntu 22.04.
Running krfb on the server with keyboard and mouse enabled.

Now on the remote client, the mouse is working, but still no keyboard.

Does this mean anything to anyone ?
Comment 13 Buovjaga 2022-06-08 12:34:52 UTC
(In reply to Paul Chaffey from comment #12)
> A small update, I have moved to pipewire in Kubuntu 22.04.
> Running krfb on the server with keyboard and mouse enabled.
> 
> Now on the remote client, the mouse is working, but still no keyboard.
> 
> Does this mean anything to anyone ?

It means you have reached the same level of features as the original reporter and us commenters.
Comment 14 Orlando Rodriguez 2022-08-04 16:51:34 UTC
Same issue here. Unfortunately, no other Desktop Sharing app is working for me (Teamviewer added experimental support for Wayland but It did not work for me), so this is my only way in wayland to share desktop between computers.
Comment 15 Andrea Frati 2022-09-13 17:23:36 UTC
I confirm this behavior on Arch Linux, Plasma Wayland, PipeWire, xdg-desktop-portal and xdg-desktop-portal-kde.
Linux 5.19.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 05 Sep 2022 18:09:09
wayland: 1.21.0-1
pipewire-git: 0.3.57.31.ga79b5c86e-1
krfb: 22.08.1-1
Comment 16 Paul Chaffey 2023-02-06 17:27:42 UTC
It would be great to see some progress here...

Shouldn't this be sorted out for KDE6 ?

Or, has anyone got another wayland solution working for remote login ?
Comment 17 Buovjaga 2023-02-10 16:03:56 UTC
Paul: you changed the status to REOPENED. Does this mean you have built Krfb from source, tested this and found that it is not working?
Comment 18 Paul Chaffey 2023-02-10 16:06:00 UTC
Somehow this was closed - sorry everyone I want to reopen this. I have tried this out on
 version 5.26.5 and its still not working for me - am I missing something obvious ?
Comment 19 Buovjaga 2023-02-10 16:14:33 UTC
(In reply to Paul Chaffey from comment #18)
> Somehow this was closed - sorry everyone I want to reopen this. I have tried
> this out on
>  version 5.26.5 and its still not working for me - am I missing something
> obvious ?

Yes, you missed that the fix is not yet in any release: https://invent.kde.org/network/krfb/-/merge_requests/44

See also the "Version Fixed In" field.
Comment 20 Bogdan Bivolaru 2023-02-14 13:46:38 UTC
(In reply to Buovjaga from comment #19)
> (In reply to Paul Chaffey from comment #18)
> > Somehow this was closed - sorry everyone I want to reopen this. I have tried
> > this out on
> >  version 5.26.5 and its still not working for me - am I missing something
> > obvious ?
> 
> Yes, you missed that the fix is not yet in any release:
> https://invent.kde.org/network/krfb/-/merge_requests/44
> 
> See also the "Version Fixed In" field.

I think it was merged into the master branch on 2023-02-07 (Feb 2nd). In my opinion that means it hasn't been included even in the Plasma 5.27.0 release. For any other release than 6.0.0 or 5.27.x this needs backporting. Even I'm not sure it will be included in 5.27.x. I'm not sure if the 5.27 branch was cut from master already or not.
Comment 21 Bogdan Bivolaru 2023-02-14 13:52:49 UTC
(In reply to Bogdan Bivolaru from comment #20)
> (In reply to Buovjaga from comment #19)
> > (In reply to Paul Chaffey from comment #18)

I made a donkey of myself, version fixed is actually 23.04 - sometime in April there is a new release scheduled. Schedules could change, but that's the plan at the moment.
Comment 22 Paul Chaffey 2023-02-14 14:03:28 UTC
(In reply to Bogdan Bivolaru from comment #21)
> (In reply to Bogdan Bivolaru from comment #20)
> > (In reply to Buovjaga from comment #19)
> > > (In reply to Paul Chaffey from comment #18)
> 
> I made a donkey of myself, version fixed is actually 23.04 - sometime in
> April there is a new release scheduled. Schedules could change, but that's
> the plan at the moment.

Very cool - I will check it out when it arrives, or build it from source if I need it before.
I will try moving to wayland on a full time basis from now onwards...
 
No Donkeys were harmed in replying to this comment 😂😂😂