Hi all,
I wanted to set up Sunshine, and run Steam alongside it on a Server of mine.
There i encountered the Problem that Sunshine needs the “cap_sys_admin+p” Capability, which can be set via the Sunshine Service Options here:
Which is in my understanding a Wrapper with the Root User, with that Capability.
This in itself works, but then the Problem arises that Sunshine runs as the Root User.
Which for me would be Totaly fine. But as Sunshine can be configured to start a Program. In my Use Case Steam (Big Picture), Steam runs into the Problem “cannot run as root user”.
How would I go about solving this Issue?
One Idea, of mine, would be adding the “cap_sys_admin+p” to my default User.
But I don’t know how I would do that Programmatically in Nix.
Another Option could be changing the User of the Wrapper so sunshine no longer runs as root, and allows Steam to start.
A third Option would be in my Understanding, a way to pass the User and start Steam as another User.
But i need Guidance on both too.
And would like to Learn, how you would solve this Problem.
Thanks for your Help.
Really enjoying Nix, and Happy to learn more about it.
(One other Person has encounterd the same Issue:
Reddit - The heart of the internet)
Just spitballing; I don’t really know anything about sunshine and haven’t tried it, but from the docs:
https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2app__examples.html#steam-big-picture
…I gather you have to configure the shell command for your applications. The setsid
in the docs already acts as a wrapper around steam that makes sure it will be running in a new session.
Assuming sudo
is in the service’s path, have you tried just configuring sudo -u myuser setsid steam steam://open/bigpicture
instead?
Thanks, this Actually Works and is a nice Workaround.
It’s a Very Specific Solution to a Specific Problem, that must be known, by the User, as the Sunshine Docu, don’t Mention the Prependix.
Would be probably a Good Idea to append it to the NixOS Wiki Entry.
Will do so after some Time, but im still happy to hear about other Solutions, that Could Save the User some Time Googling this Specific Problem, and make the Application Function as Expected without needing Specific NixOs Workarounds.
Thank you for taking Time for me, I appreciate your Answer a lot.
About the Sudo User Change, it Functioned Originally today without a Problem.
After some Time, an Audio Issue creeped in.
When starting Big Picture Manually, it Plays with Audio.
When Starting Big Picture from the Service as Root user, changed via Sudo -u too my User, Steam Reports
PulseAudio connect failed (used only for Mic Volume Control) with error: Access denied
PulseAudio context init failed
On top of that, when i try to manually Execute the Command:
sudo -u myuser setsid steam steam://open/bigpicture
, i doesn’t Work at all and fails with:
Unable to open a Connection with X.
Check your Display Environment Variable
Sorry, I’m not informed enough to be of any help with pulseaudio issues.
As for
From what I gather Steam currently still only supports Wayland through xwayland. My first guess would be that there might be an issue with that when you’re running the command yourself.
(I’m assuming you use wayland, because the reason for your need for cap_sys_admin+p
as cited by their docs is the KSM capture backend. For X11, they even state that you might have to remove these capabilities )