The repo maintainers for Sunshine only build for the LTS versions of Ubuntu. Which is fair enough.
I run Kubuntu 25.04 on my desktop at time of writing, and the LTS build versions of Sunshine would not work. It expected certain libraries to be a certain version and it just wouldn't start. The AppImage and Flatpak versions had their own problems. Documentation on building and its challenges were decently sparse but some sharp Google-fu despite Google's lobotomization enlightened me to the solutions.
I write my experiences here in case it helps anyone who needs it.
First, I created an Ubuntu Server 25.04 VM on my Proxmox server. That's just me, you don't have to do that, I'm just insane.
I began by cloning the repo like the instructions say. The flag is important because there's third party libraries and things that I won't get if I skip it. I need cmake as well.
sudo apt install cmake
git clone https://github.com/lizardbyte/sunshine.git --recurse-submodules
cd sunshine
mkdir buildNow I elevate to root and continue to try to build.
sudo -i
cd /home/username/sunshine/
./scripts/linux_build.shEventually after cuda has downloaded and the build proceeds, the build fails because cospi, sinpi, cospif and sinpif math functions in cuda error out.
As per this StackOverflow question, I need to add noexcept (true) to the end of each of these methods. In my case, the error message told me the math_functions.h file in question can be found at sunshine/build/cuda/bin/../targets/x86_64-linux/include/crt/math_functions.h.
I open this file with nano and search for cospi, sinpi, cospif and sinpif methods. I alter them by adding noexcept (true) at the end.
Example before:
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x);
Example after:
extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x) noexcept(true);
I had to do this for all four of the math functions mentioned in the error.
When this was done, I could try building again. I went back and ran ./scripts/linux_build.sh and at this point all should be well and a Sunshine.deb package should be generated in /sunshine/build/cpack_artifacts/.
I could also as per the instructions go back to the root sunshine folder and run these commands to build.
cmake -B build -G Ninja -S .
ninja -C build
cpack -G DEB --config ./build/CPackConfig.cmake
After that I could find sunshine-0.0.0.deb in the build folder.
After installing the new Sunshine deb-package with sudo apt install ./Sunshine.deb on my desktop and setting it up the way I like it, everything was fine and working at first test. Finally I had Sunshine on my Linux partition!
But when I rebooted, things were very strange with my NVIDIA drivers. My second monitor wouldn't work and GPU Screen Recorder kept complaining. I don't know what Sunshine did exactly but it appears my drivers were outdated perhaps because sudo ubuntu-drivers install and flatpak update and a reboot solved all of this.
While Sunshine was just peachy, I use the DualSense PS5 controller on my Moonlight home theater PC client and I want all functionality in the Sunshine end as well. It appears to be emulating an Xbox Series S controller. In the Sunshine web UI settings I switch the controller to PS5 and start Steam through my Moonlight client.
There is no controller input.
I go back to Sunshine and check the logs. Warning: Unable to create virtual DualShock 5 controller: Permission denied.
Some more Googling leads me to this GitHub issue. Through the very helpful comments I run a series of commands to remedy the situation.
sudo setfacl -m g:input:rw /dev/uhid
echo "uhid" | sudo tee /etc/modules-load.d/uhid.conf
sudo modprobe uhidThis was not enough however as it appears I needed the udev rules from the repo. I downloaded this 60-sunshine.rules file and placed it in the /usr/lib/udev/rules.d/ as per the issue comments and rebooted my system.
Now I have a working Sunshine for my Kubuntu 25.04 system with working DualSense support.
I hope this is helpful for anyone who needs it.
I tried to pull and build the latest nightly today (2025-09-17) and had some problems, after they had bumped the cuda version to 12.9 and the necessary gcc version etc. For one, cuda wouldn't download properly.
Ensure there is enough space in /tmp and that the installation package is not corrupt.
My /tmp partition has 7.6G available but apparently that wasn't enough.
I could fix this by editing the /scripts/linux_build.sh file and adding the --tmpdir="${build_dir}/cudatemp" flag to the run command under the install_cuda() function. You'll know the line because it starts with "${build_dir}/cuda.run". I also added a mkdir ${build_dir}/cudatemp just before the run command.
That did allow me to download and run cuda however building failed because update-alternatives refused to use gcc-14.
I could fix this by removing gcc-11 from update-alternatives.
update-alternatives --remove gcc /usr/bin/gcc-11Now I could build on the latest nightly once again.
Is there any difference in building in the same machine or in a different one? Maybe I should just create a VM to build it 😆