Sunshine Autostart not persisting between reboots

Hello, I'm trying to get sunshine to automatically start on reboot via the ujust setup-sunshine script. I'm pretty sure the autostart functionality is broken. After reboot the user service disappears and sunshine does not restart. Anyone know why systemd might not see the sunshine.service user service after reboot? The symlink is here: /home/bazzite/.config/systemd/user/xdg-desktop-autostart.target.wants/sunshine.service
15 Replies
drdoom
drdoomOPβ€’5mo ago
Well, the service is missing when I systemctl --user list-units. However it does exit when I do systemctl status sunshine but it's inactive:
bazzite@bazzite:~$ systemctl status --user sunshine
β—‹ sunshine.service - Self-hosted game stream host for Moonlight
Loaded: loaded (/usr/lib/systemd/user/sunshine.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/user/service.d
└─10-timeout-abort.conf
Active: inactive (dead)
bazzite@bazzite:~$ systemctl status --user sunshine
β—‹ sunshine.service - Self-hosted game stream host for Moonlight
Loaded: loaded (/usr/lib/systemd/user/sunshine.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/user/service.d
└─10-timeout-abort.conf
Active: inactive (dead)
Maybe it's something to do with the xdg-desktop-autostart.target not starting the service... I made a custom user service and changed WantedBy to graphical-session.target Seems to start fine now. Read-only service that's not starting after reboot:
[Unit]
Description=Self-hosted game stream host for Moonlight
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/bin/sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=xdg-desktop-autostart.target
[Unit]
Description=Self-hosted game stream host for Moonlight
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/bin/sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=xdg-desktop-autostart.target
New user service that restarts properly:
[Unit]
Description=Self-hosted game stream host for Moonlight
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/bin/sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=graphical-session.target
[Unit]
Description=Self-hosted game stream host for Moonlight
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/bin/sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=graphical-session.target
Could gnome not be triggering the autostart target properly?
wolfyreload
wolfyreloadβ€’5mo ago
Try run ujust setup-sunshine again after rebooting. Then select the option "toggle autostart" Nevermind, looks like you came right on your own. Saw the first message and didn't see your replies afterwards 🫒
HikariKnight
HikariKnightβ€’5mo ago
you need to find out why sunshine is dying on you
Rin
Rinβ€’5mo ago
I had to add Sunshine to autostart in Tweaks The service just didn't run for me
drdoom
drdoomOPβ€’5mo ago
@HikariKnight It's wasn't dying, there we no service logs. I think it was not even getting started.
HikariKnight
HikariKnightβ€’5mo ago
Must be though since it is enabled πŸ€”
Freddy
Freddyβ€’2mo ago
I'm running into this where my sunshine doesn't persist between boots as well, on the image below
No description
Rin
Rinβ€’2mo ago
Open Ignition app and add Sunshine to autostart
Freddy
Freddyβ€’2mo ago
Thanks, I've done this but have to start the service manually still too
Rin
Rinβ€’2mo ago
Oh weird
Freddy
Freddyβ€’2mo ago
No description
Freddy
Freddyβ€’2mo ago
I have to run this for it to actually start, as well. Clicking sunshine doesn't immediately open it, but restarting the service then it does
/usr/bin/env systemctl enable --u sunshine
/usr/bin/env systemctl stop --u sunshine
/usr/bin/env systemctl start --u sunshine
sunshine
/usr/bin/env systemctl enable --u sunshine
/usr/bin/env systemctl stop --u sunshine
/usr/bin/env systemctl start --u sunshine
sunshine
very weird, sunshine/moonlight used to work like it was supposed to on GNOME image for me and I have a friend on a ROG Ally doing the same I'm trying to get it working like it's supposed to for both of us. his is on a fresh gnome-deck-image
Rin
Rinβ€’2mo ago
Mine was starting well last time I checked, but I'm using a desktop image instead of deck
Freddy
Freddyβ€’2mo ago
Thanks for your input, I found another user who created an issue here with similar situation, also on gnome image https://github.com/ublue-os/bazzite/issues/2044
GitHub
Sunshine service failing to autostart on Bazzite gnome desktop imag...
Describe the bug It looks like there is a problem with sunshine failing to autostart on the desktop images of Bazzite. tested on bazzite-gnome-nvidia:testing-41.20250101 and bazzite-gnome:testing-4...
Freddy
Freddyβ€’2mo ago
just found that this actually works like this, just in the background and does not show up as an entry with an icon on the top right task bar(didn't know that) thanks

Did you find this page helpful?