How to enable pulseaudio module persistently

Hi, I have installed HAOS on a proxmox host. Unfortunately I can’t use PCI pass-through my soundcard to the HAOS VM, as it is in the same IO group as my network card. So I played with pulseaudio and installed that on the proxmox host. To get a connection from HAOS, I got two solutions:

My first solution is to create a virtual sound card for the VM. This can be done by manually editing the virtual host file and enter a line like:

args: -device ich9-intel-hda -audiodev pa,id=snd0,server=/run/pulse/native -device hda-output,audiodev=snd0

Then a sound device is detected in HAOS that will be used by home assistant OS-audio. I had to manually unmute the channels on the proxmox side, but besides that, the setup basically works. The unfortunate thing is, that you have to edit the vm file, this can’t be done with the proxmox UI.

My second solution was to enable network assess for the pulseaudio on the proxmox side. Then, on HA I could just load the pulseaudio tunnel module:

pactl load-module module-tunnel-sink server=xxx.yyy.zzz.aaa

and audio is transported just over the (virtual) network, without emulation of a virtual soundcard. But on every reboot, I have to load the module manually. I can’t edit /etc/pulse/* in the ssh docker (read only). If I docker exec to the home assistant OS-audio container, I can edit the file, but on a reboot, that configuration is gone. If I use an automation, I’m in the homeassistant container, that does nit have the pactl command. I might use ssh, but I hope, there is a somewhat simpler solution?

Can anybody give me a hint, how to make this pactl module-load for the pulseaudio server persistent?

best,
Olaf

Even if you make it persistent, then it will be overwritten in next HAOS update.