I’m using sunshine for remote gaming on my Linux PC. Because I use Wayland and don’t have an Nvidia I use kmsgrab for capture (under the hood sunshine uses ffmpeg).
I have noticed that I can enter tty and kmsgrab will capture it as well. If it just captured after logging in my user I wouldn’t be surprised, but it also captures the login screen.
I autostart it at login using my systemd user configuration (not systemwide) so it should just have my user’s permission level. I get the same results if I put it in KDE’s autostart section, so it’s not a systemd thing.
Why does that work? Shouldn’t you need special privileges to capture everything?
The installation instructions tells you to do sudo setcap -r $(readlink -f $(which sunshine))
is this the reason why it works? What does the command do exactly?
setcap adds Linux capabilities to an executable. Capabilities are elevated privileged within the kernel for specific privileged “actions”.
https://docs.redhat.com/en/documentation/red_hat_enterprise_linux_atomic_host/7/html/container_security_guide/linux_capabilities_and_seccomp#linux_capabilities
https://man7.org/linux/man-pages/man7/capabilities.7.html