Announcement

Collapse
No announcement yet.

How to start KDE plasma manually from remote ssh?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to start KDE plasma manually from remote ssh?

    Hi -- if I boot my computer, but do not log in, and instead ssh remotely to it, how can I start a regular KDE session over ssh? (Long story, but I want to do this because I have some remote desktop tools I want to use this way occasionally -- I know there are other ways to accomplish all this, but I'm curious about this particular question.)

    I've searched around and tried various types of startx, startplasma-x11, using DISPLAY=:0, etc, but I'm not doing something right.

    Basically, I want to achieve the same end as if I was at the computer and logged in, or something analogous. I can enter the password over ssh, of course. AFAIK I just need to know the right scripts in the right order with the right env variables... ?

    Thanks!

    #2
    Depends on exactly why you want to do this, but this will never be a good solution IMO. Too much overhead.

    Have you tried this: https://askubuntu.com/questions/3040...ng-through-ssh

    Please Read Me

    Comment


      #3
      Thanks -- the VNC stuff already works great (I'm using krfb), but I can't run it unless I have logged in via the sddm GUI on the physical computer. Then I can ssh in and start krfb just fine. The trouble is that if I don't have a session started already, krfb won't start (which makes sense -- there's no desktop to show, and I don't know if X is even going at that point). Thus my desire to start a session via the CLI over ssh. Maybe loginctl could be related to this?

      Maybe the rephrase is "how to manually effect an sddm login"?

      Obviously I'm not super clear on how to correctly ask this question. :-) (And/or maybe I have missed the point of your link.)

      Comment


        #4
        I found this in a forum:
        DISPLAY=:0 kstart5 plasma-desktop
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Well, if sddm is the block, try this:

          log in via ssh, kill sddm, then start X:

          sudo systemctl stop sddm
          startx

          Please Read Me

          Comment


            #6
            So, with

            DISPLAY=:0 kstart5 plasma-desktop

            I get "could not connect to display :0
            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."

            I don't know if sddm is blocking anything (?) but this:

            sudo systemctl stop sddm
            startx

            ...gives the same error from when I tried to startx before:

            "Only console users are allowed to run the X server."

            Comment


              #7
              Hmm, so if I change /etc/X11/Xwrapper.config to be "allowed_users=anybody" (with awareness that this can cause issues if not careful), then I can call startx over ssh and the plasma desktop appears on the screen! Progress.

              But... it pops up a policykit dialog because network configuration isn't apparently permitted. So I think I need to sort that out? Maybe a tweak to a policy?

              If I enter my password in that dialog (on the computer, obviously, not over ssh), and then try to start krfb over ssh (which again, normally works if I had logged in normally on the computer), krfb gives the same error as above: "Could not load the Qt platform plugin "xcb""...

              So that's two hurdles I maybe should figure out next?
              Last edited by chconnor; May 14, 2021, 12:43 PM.

              Comment


                #8
                Ok, some progress: after changing Xwrapper.config as described above I can then start krfb this way:

                Code:
                export DISPLAY=:1.0
                startx &
                sleep 5
                xhost +local:
                krfb --nodialog &
                This works! However it's not a totally 'normal' login, so i'm clearly still missing something in terms of the session creation. Namely, PolicyKit pops up dialogs for stuff: starting networking manager, refreshing package list, etc, and other things aren't quite right (e.g. ~/.profile doesn't seem to have been run).

                Comment

                Working...
                X