Bug 453679 - kcmshell5 is unable to display via SSH.
Summary: kcmshell5 is unable to display via SSH.
Status: RESOLVED INTENTIONAL
Alias: None
Product: kde-cli-tools
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.24.5
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-11 23:42 UTC by Roke Julian Lockhart Beedell
Modified: 2022-11-13 15:52 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roke Julian Lockhart Beedell 2022-05-11 23:42:38 UTC
STEPS TO REPRODUCE
1. Invoke "ssh root@localhost ~]#", whereby "root" is merely any account that is not the account that is logged-into directly. It need not be the superuser nor named specifically "root".

OBSERVED RESULT
Invocation of "root@BEEDELLROKEJULIANLOCKHART ~]# kcmshell5" presents
"qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)"

EXPECTED RESULT
"kcmshell5
Usage: kcmshell5 [options] module
A tool to start single system settings modules

Options:
  -h, --help                 Displays help on commandline options.
  --help-all                 Displays help including Qt specific options.
  -v, --version              Displays version information.
  --author                   Show author information.
  --license                  Show licence information.
  --desktopfile <file name>  The base file name of the desktop entry for this
                             application.
  --list                     List all possible modules
  --lang <language>          Specify a particular language
  --silent                   Do not display main window
  --args <arguments>         Arguments for the module
  --icon <icon>              Use a specific icon for the window
  --caption <caption>        Use a specific caption for the window

Arguments:
  module                     Configuration module to open".

SOFTWARE/OS VERSIONS
Windows: Negative.
macOS: Negative.
Linux/KDE Plasma: Positive.
KDE Plasma Version: 5.24.5.
KDE Frameworks Version: 5.93.0.
Qt Version: 5.15.3.
Comment 1 Aleix Pol 2022-05-12 00:12:23 UTC
kcmshell shouldn't be doing anything special here as far as I remember.

Can you confirm that it's working for other applications like systemsettings or dolphin?
Comment 2 Roke Julian Lockhart Beedell 2022-05-12 01:07:42 UTC
(In reply to Aleix Pol from comment #1)
> kcmshell shouldn't be doing anything special here as far as I remember.
> 
> Can you confirm that it's working for other applications like systemsettings
> or dolphin?

No graphical software operates, but because kcmshell5 is textual, I consider this to be erroneous, because all alternative textual software operates correctly. Is this opinion mistaken?
Comment 3 Aleix Pol 2022-05-12 02:53:38 UTC
kcmshell5 isn't textual, it opens a window with a specific configuration module.

What are you trying to achieve?
Comment 4 Roke Julian Lockhart Beedell 2022-05-12 13:13:47 UTC
(In reply to Aleix Pol from comment #3)
> kcmshell5 isn't textual, it opens a window with a specific configuration
> module.
> 
> What are you trying to achieve?

I want to list the KConfig modules that are installed by invoking "kcmshell5 -list". I am able to understand any inability to communicate with my display-server via SSH if instruct it invoke any of the modules.
Comment 5 Roke Julian Lockhart Beedell 2022-05-12 13:49:33 UTC
*if I instruct it to
Apologies.
Comment 6 Aleix Pol 2022-05-30 13:07:00 UTC
You can try running it with QT_QPA_PLATFORM=offscreen.

Alternatively you can connect with "ssh -X" for X11 forwarding.
Comment 7 Roke Julian Lockhart Beedell 2022-05-30 13:09:35 UTC
(In reply to Aleix Pol from comment #6)
> You can try running it with QT_QPA_PLATFORM=offscreen.
> 
> Alternatively you can connect with "ssh -X" for X11 forwarding.

Yes, that certainly remediates the problem, but not well, because kcmshell5 should not require a display-server to textually present which modules are available. Thanks, however.
Comment 8 Aleix Pol 2022-05-30 13:38:04 UTC
I am not entirely sure that it should work. Can you please elaborate on the use-case?
Comment 9 Roke Julian Lockhart Beedell 2022-05-30 13:49:13 UTC
(In reply to Aleix Pol from comment #8)
> I am not entirely sure that it should work. Can you please elaborate on the
> use-case?

I want to run automated tests that ensure that everything is configured correctly on a remote machine and subsequently provide the output to my console. If, for instance, I want to do this via my smartphone, using SSH to invoke an X Session and then manually invoking a graphical terminal is entirely unnecessarily difficult, and anyway breaks the automation of the process.
Comment 10 Nicolas Fella 2022-11-13 15:52:15 UTC
This use case is too niche to do anything about it. Aleix already told you a workaround you can use