Skip to content

Instantly share code, notes, and snippets.

@awidegreen
Last active January 20, 2024 15:10
Show Gist options
  • Star 25 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save awidegreen/6003640 to your computer and use it in GitHub Desktop.
Save awidegreen/6003640 to your computer and use it in GitHub Desktop.
systemd definition for pulseaudio in system-mode (example for archlinux). The pulseaudio developers explicitly recommend to NOT run pulseaudo system-mode!
# systemd service spec for pulseaudio running in system mode -- not recommended though!
# on arch, put it under /etc/systemd/system/pulseaudio.service
# start with: systemctl start pulseaudio.service
# enable on boot: systemctl enable pulseaudio.service
[Unit]
Description=Pulseaudio sound server
After=avahi-daemon.service network.target
[Service]
ExecStart=/usr/bin/pulseaudio --system --disallow-exit --disallow-module-loading
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
@dbinfl
Copy link

dbinfl commented Aug 26, 2021

@janvda
Hello! I have a server with 3 VMs that I want to have sound-enabled. In particular I wanted the VM running my music server to start on boot, and with sound enabled. The audio part of that solution evaded me until I found your post. I i implemented it as described, except for using a different account, and it works beautifully.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment