The Output Volume resets to zero each time I restart Ubuntu. But I can turn the volume up and the speakers work just fine. I’ve googled the problem and the result don’t seem to fit this problem. There is an article where a guy had the same problem. But that only happened after he remotely helped his mom and I’ve never remotely connected to another computer from home
If you’re comfortable doing some scripting, I have a solution. I’ve confirmed it working on two Ubuntu 26.04 VMs on UTM. I tried to do the same for my Fedora 44 VM, but I wasn’t able to figure it out. Both are using Gnome.
- Create the directory to store the script
mkdir -p ~/.local/bin
- Create the script. I used nano to create a file.
nano ~/.local/bin/set-volume.sh
- Copy the script below into the blank file you created above. To save the file use CTL + o and enter, then use CTL + x to exit.
#!/bin/bash
sleep 3
# Unmute the master hardware channel in ALSA
amixer -q sset Master unmute
# Set the digital volume scale to 80% via PipeWire
wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.80
- Set the script to executable.
chmod +x ~/.local/bin/set-volume.sh
- Next create the directory for the autostart script. This will run the script we just created once you login to your Ubuntu session.
mkdir -p ~/.config/autostart
- Use nano again to create a file.
nano ~/.config/autostart/set-volume.desktop
- Copy this into the blank file.
[Desktop Entry]
Type=Application
Exec=/bin/bash -c “sh /home/$USER/.local/bin/set-volume.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Force Audio Volume
Comment=Fixes UTM Apple Virtualization zero volume bug
- Do the same as above to save and quit nano. Now reboot your Ubuntu VM. Login and see if the volume is set to 80%.
I prefer to use the Terminal. I’ll type the script when I get home from work. Thanks for your efforts on this.
If you don’t mind, can I post your solution to Linux.org?
I don’t mind as long as you give me credit.
Of course. To do otherwise would be plagiarism. My only thought in posting it on the other site is to help anyone who has the same or similar problem through the sharing of knowledge. But I understand and respect your statement. That’s why I asked your permission rather than just do it. The answer is yours to give, not mine.