Overview
Sunshine can run as a systemd service on Linux, providing automatic startup, process management, and logging integration. Two service types are available:- sunshine.service - Unprivileged service for XDG Portal or X11 capture
- sunshine-kms.service - Privileged service for KMS (Kernel Mode Setting) capture
Prerequisites
- Linux system with systemd
- Sunshine installed from package manager
- User account with appropriate permissions
Service Types
User Service (Recommended)
Runs as your user account with access to your display session. Best for:- Desktop installations
- X11 or Wayland capture
- Standard gaming setups
System Service
Runs as a system service with elevated privileges. Best for:- Headless servers
- KMS capture
- Multi-user environments
Installation
Service Configuration
Standard Service (sunshine.service)
Example service file for unprivileged capture:sunshine.service
KMS Service (sunshine-kms.service)
Example service file for KMS capture:sunshine-kms.service
Custom Service File
To customize the service, create an override:Service Management
Enable Service (Start on Boot)
Start Service Immediately
Enable and Start Together
Stop Service
Restart Service
Disable Service
Monitoring
Check Service Status
View Service Logs
Log Filtering
Troubleshooting
Service Won’t Start
Display Not Available
Service Crashes on Start
Increase startup delay:Permission Denied Errors
Add user to required groups:Service Stops After Logout
Enable lingering for your user:Advanced Configuration
Resource Limits
Control resource usage:Restart Behavior
Environment Variables
Dependencies
Control service startup order:Multiple Instances
Run multiple Sunshine instances:Create Instance Service
sunshine@.service

