I'd like to try to get fedora to host a second headless Wayland session in the background for a remote user. I have a GPU but I want to share its render and compute, not the physical HDMI output, so I need a virtual Wayland session for the second seat.

Supposedly logind could handle the seat and udev permission issues clean enough, but headless use is still beyond me there.

I'd like a KDE Plasma environment running headless and then sunshine can just stream this session out using the war capture method. I just don't know how to start up a separate Wayland session under another linux user in the background with a plasma session drawing to an imaginary monitor.

There seem to be 2 ways of doing this.

  • wlheadless-run - a young project made to solve this particular problem
  • kwin --virtual can theoretically do this, but I'm not finding clear examples of it

all 11 comments

sorted by: hot top controversial new old
[–] 2 points 3 months ago* (last edited 3 months ago) (5 children)

If you log in (preferably as another user) to another tty (Cntrl + Alt + F2/3/4/5), and then run dbus-run-session startplasma-wayland, does that work?

Sometimes just startplasma-wayland works, which used to work for me but didn't work for me this time.

Then, you should be able to switch back to the original KDE session, which continues to work normally, at least it does for me. Both sessions should have shared access to the GPU, as well. You can then probably run sunshine in that second instance of KDE, while the monitor can be attached to tty1 or tty2, whichever one is the default where KDE is put.

Then, you would probably want to configure sunshine to work even when the screen is locked, that way you can lock the second session with Win + L, but it can still be interacted with remotely via sunshine.

EDIT: I only am somewhat confident that this setup will work, I haven't tested it personally.

  • source
  • hideshow 5 child comments
  • [–] [S] 1 point 3 months ago (4 children)

    I would need to use the headless backend in kwin, which apparently isn't something you can do from start plasma-wayland but you can do with kwin_wayland --virtual -s waylandR. I can give it a specific socket (waylandR) which lets me point sunshine at that, but I cannot get moonlight to accept a PIN that way. it seems mad about this setup and I'm not sure why.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 3 months ago (3 children)

    Do you actually need the headless backend? Or do you need a background session that doesn't interfere with the main session?

  • source
  • parent
  • hideshow 3 child comments
  • [–] [S] 1 point 3 months ago (2 children)

    the physical display output is claimed by something else totally separate.

    Anyway I did figure out how to the headless backend working, but I did not figure out the udev rules for this headless session

    Allows Sunshine to access /dev/uinput

    KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", GROUP="input", MODE="0660", TAG+="uaccess"

    Allows Sunshine to access /dev/uhid

    KERNEL=="uhid", GROUP="input", MODE="0660", TAG+="uaccess"

    Joypads

    KERNEL=="hidraw*", ATTRS{name}=="Sunshine PS5 (virtual) pad*", GROUP="input", MODE="0660", TAG+="uaccess" SUBSYSTEMS=="input", ATTRS{name}=="Sunshine X-Box One (virtual) pad*", GROUP="input", MODE="0660", TAG+="uaccess" SUBSYSTEMS=="input", ATTRS{name}=="Sunshine gamepad (virtual) motion sensors*", GROUP="input", MODE="0660", TAG+="uaccess" SUBSYSTEMS=="input", ATTRS{name}=="Sunshine Nintendo (virtual) pad*", GROUP="input", MODE="0660", TAG+="uaccess" SUBSYSTEMS=="input", ATTRS{name}=="Sunshine PS5 (virtual) pad*", GROUP="input", MODE="0660", TAG+="uaccess"

    this is....not enough

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 3 months ago* (1 child)

    the physical display output is claimed by something else totally separate.

    Yes, and the above solution I laid out is a way to get around that, that potentially dodges the complexity of configuring a truly headless session. It's possible to run two KDE sessions at once, next to eachother, and then simply put one on the main display, with the second being "headless", and not shown.

    I started fiddling with the above setup I described, actually installing and testing sunshine. Unfortunately I hit some hiccups. I got sunshine to run, but with no input, and then then it attached to the wrong KDE, even though it was streaming the correct one initially. Now I'm running the same KDE session as a different user (since I was on the same user before), but having pairing issues, but I suspect these are because moonlight is seeing the wrong SSL cert, since the sunshine as a new user generated a new cert.

  • source
  • parent
  • hideshow 1 child comment
  • [–] [S] 1 point 3 months ago

    Sunshine has some documentation gaps that are annoying to figure out but there enough there you can get it done with some effort. Moonlight feels really crunchy though. Edges are rough and it always felt unfinished. I really think selkies v2 is going to kill it.

    Sunshine+moonlight is better for an app based deployment, like set top boxes without web browsers. But if you have a browser available on the client, I can see some crazy possibilities with selkies.

    Gamesonwhales solves the sunshine multi user issue in a different way. It’s better for renting out your box as a node for cloud gaming. It’s damn near turnkey for that and super clever. But that’s not what I’m trying to do here so it’s just adding complexity.

  • source
  • parent
  • [–] 2 points 3 months ago (1 child)

    iirc for GPU acceleration you need to make the GPU pretend to use one of it’s ports (you don’t actually need to plug anything into it)

  • source
  • hideshow 1 child comment
  • [–] [S] 2 points 3 months ago

    nope I got around that. I don't need video, just the render node. dma-buf pulls it from render to encode without passing through the CPU or system ram.

    now I just need to figure out the udev multi seat crap. seats expect physical hardware to be assigned to them.

  • source
  • parent
  • [–] 1 point 3 months ago

    Just use wolf: https://games-on-whales.gitbook.io/wolf/stable/en/user/quickstart.md. Everything is ready out of the box. However, for a KDE session, you'll have to rebuild KDE in the container instead of wolf-ui.

  • source
  • [–] 1 point 3 months ago (1 child)

    Second comment:

    https://docs.lizardbyte.dev/projects/sunshine/v0.21.0/about/guides/linux/headless_ssh.html

    There is also this guide, but it is specific for Xorg and Nvidia gpus. But I suspect that if you replace the startx here with startplasma-wayland or dbus-run-session startplasma-wayland, then it will work. It would still be nvidia gpu specific though.

  • source
  • hideshow 1 child comment