mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.68k stars 379 forks source link

Pulseaudio setup not works, while creating container from linux service #489

Closed yuraSomatic closed 1 year ago

yuraSomatic commented 1 year ago

I created linux service, that runs docker run command with pulseaudio setup from your tutorual. It works good, when started from user terminal, but fails when started from service. I think it maybe related to "Container user must be same as on host" requirement, or I need to add something like After=pulseaudio to my service file Please, give me some hint if you know what it may be.

yuraSomatic commented 1 year ago

Solved, by adding 2 env vars to the service file. Solution from this source. You can add this to your docker sound tutorual for completeness.

[Service]
Environment="XDG_RUNTIME_DIR=/run/user/1000"
Environment="PULSE_RUNTIME_PATH=/run/user/1000/pulse/"