Sunshine: Difference between revisions
Correct information about GameStream protocol (Moonlight is an open-source implementation) |
m →Install: Since the pr got merged into unstable, the snippet applies for <26.05 Tags: Mobile edit Mobile web edit Visual edit |
||
| (12 intermediate revisions by 5 users not shown) | |||
| Line 2: | Line 2: | ||
== Install == | == Install == | ||
{{file| | |||
To install Sunshine and enable it you can use the following snippet: | |||
{{file|3=<nowiki> | |||
services.sunshine = { | |||
services | |||
enable = true; | enable = true; | ||
autoStart = true; | |||
capSysAdmin = true; # only needed for Wayland -- omit this when using with Xorg | |||
openFirewall = true; | |||
}; | }; | ||
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}} | |||
==== Uinput setup ==== | |||
To permit sunshine to emulate input devices, for example to create a virtual mouse and keyboard, add yourself to the <code>uinput</code> group<ref>https://github.com/NixOS/nixpkgs/pull/493109</ref><ref>https://github.com/NixOS/nixpkgs/issues/455737#issuecomment-3451112321</ref>{{File|3=users.users.myuser = { | |||
extraGroups = [ "uinput" ]; | |||
};|name=/etc/nixos/configuration.nix|lang=nix}} | |||
For <26.05 stable branch system versions, you need to also enable and create the <code>uinput</code> kernel module and user group. | |||
{{File|3=hardware.uinput.enable = true;|name=/etc/nixos/configuration.nix|lang=nix}} | |||
== Connecting to the host == | == Connecting to the host == | ||
Sunshine needs to be started with the < | When installed via the NixOS module, Sunshine is configured as a Systemd user unit, and will start automatically on login to a graphical session. Note that a logout/login or restart may be required for Sunshine to start after initially adding it to your configuration due to limitations of NixOS' handling of user units with <code>nixos-rebuild</code>. | ||
If <code>services.sunshine.autoStart</code> is set to <code>false</code>, Sunshine needs to be started with the <code>sunshine</code> command. | |||
You may have to manually add the host running Sunshine to your Moonlight client. This, thankfully, is not hard to do. | You may have to manually add the host running Sunshine to your Moonlight client. This, thankfully, is not hard to do. | ||
| Line 47: | Line 37: | ||
If this doesn’t work you should double check the port in the Sunshine’s WebGUI. You can access this from the Host PC in a web browser <code>https://localhost:47990</code> | If this doesn’t work you should double check the port in the Sunshine’s WebGUI. You can access this from the Host PC in a web browser <code>https://localhost:47990</code> | ||
== | == Limitations == | ||
At the time of writing Sunshine is unable to wake sleeping display<ref>https://github.com/orgs/LizardByte/discussions/439</ref> (e.g. when screen is locked), which makes impossible to connect to the main session of your host PC. Can be somehow avoided by creating a virtual display and running Sunshine through it. | |||
== Troubleshooting == | |||
=== Running Steam Big Picture on Wayland === | |||
While using Wayland on non-wlroots compositors, [https://docs.lizardbyte.dev/projects/sunshine/latest/md_docs_2getting__started.html you need to have] <code>capSysAdmin = true;</code> in Sunshine config for KMS to capture screen properly. But this parameter breaks any custom applications that should be started from your main user, not super-user. To avoid such issues, you need to prepend all needed commands with <code>sudo -u <username></code> <ref>https://discourse.nixos.org/t/give-user-cap-sys-admin-p-capabillity/62611/3?u=dmchmk</ref>: | |||
Before: <syntaxhighlight lang="json"> | |||
{ | |||
"name": "Steam Big Picture", | |||
"detached": [ | |||
"setsid steam steam://open/bigpicture" | |||
], | |||
"prep-cmd": [ | |||
{ | |||
"do": "", | |||
"undo": "setsid steam steam://close/bigpicture" | |||
} | |||
], | |||
"image-path": "steam.png" | |||
} | |||
</syntaxhighlight>After: <syntaxhighlight lang="json"> | |||
{ | |||
"name": "Steam Big Picture", | |||
"detached": [ | |||
"sudo -u venya setsid steam steam://open/bigpicture" | |||
], | |||
"prep-cmd": [ | |||
{ | |||
"do": "", | |||
"undo": "sudo -u venya setsid steam steam://close/bigpicture" | |||
} | |||
], | |||
"image-path": "steam.png" | |||
} | |||
</syntaxhighlight> | |||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Gaming]] | [[Category:Gaming]] | ||