[GH-ISSUE #3891] How to allow firefox (or any sandbox) to access the pulseaudio process? #2441

Closed
opened 2026-05-05 09:07:36 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @ibhagwan on GitHub (Jan 13, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3891

Perhaps more of a usage / understanding issue rather than a bug.

Running latest firejail version 0.9.64 on Void Linux and I get no sound using Firefox, I believe it's due to firefox unable to access PulseAudio (v14.0.3).

My pulse audio is started by running start-pulseaudio-x11 within my ~/.xprofile.

I looked into all past issues regarding PulseAudio and different apps and tried many different suggestions, the latest "no sound in Zoom" issue suggested that pulse isn't running inside the sandbox and here is where I got confused as it seems that running firejail sh -c "ps -ef" returns only the process of the shell - so how does firefox (or any other app for that matter) access pulse or any other process?

I tried many different troubleshooting steps I found in other issues:

  • --noprofile
  • --nopulseauto
  • --allusers
  • different --no-blacklist switches
  • firecfg --fix-sound
  • adding enable-memfd = yes to my ~/.config/pulse/client.conf (even though it's the pulse default anyway...)
  • un-comment the private-etc line containing pulse in /etc/firejail/firefox-common.profile

None of the above resulted in sound within firefox.

The below is my attempt to communicate with the pulse daemon using the pacmd from within a firejail:

~ ❯ ps -ef | grep pulse
bhagwan  26298     1  0 11:18 ?        00:00:00 /usr/bin/pulseaudio --start --log-target=syslog
bhagwan  26307 26298  0 11:18 ?        00:00:00 /usr/libexec/pulse/gsettings-helper
bhagwan  26727  1346  0 11:18 pts/1    00:00:00 grep --color=auto pulse
~ ❯ pacmd
Welcome to PulseAudio 14.0! Use "help" for usage information.
>>> ^C
~ ❯ firejail --noautopulse --noprofile pacmd
Parent pid 26805, child pid 26806
Child process initialized in 3.57 ms
No PulseAudio daemon running, or not running as session daemon.

Parent is shutting down, bye...
~ ❯ firejail pacmd
Reading profile /etc/firejail/default.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc

** Note: you can use --noprofile to disable default.profile **

Parent pid 26912, child pid 26913
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Child process initialized in 41.52 ms
No PulseAudio daemon running, or not running as session daemon.

Parent is shutting down, bye...
~ ❯ firejail --noautopulse --noprofile sh -c "ps -ef | grep pulseaudio"
Parent pid 26958, child pid 26959
Child process initialized in 3.55 ms
bhagwan      1     0  0 11:19 pts/1    00:00:00 firejail --noautopulse --noprofile sh -c ps -ef | grep pulseaudio
bhagwan      2     1  0 11:19 pts/1    00:00:00 sh -c ps -ef | grep pulseaudio
bhagwan      5     2  0 11:19 pts/1    00:00:00 grep pulseaudio

Parent is shutting down, bye...
~ ❯ ps -ef | grep pulse
bhagwan  26298     1  0 11:18 ?        00:00:00 /usr/bin/pulseaudio --start --log-target=syslog
bhagwan  26307 26298  0 11:18 ?        00:00:00 /usr/libexec/pulse/gsettings-helper
bhagwan  27031  1346  0 11:19 pts/1    00:00:00 grep --color=auto pulse
~ ❯ pacmd
Welcome to PulseAudio 14.0! Use "help" for usage information.
>>> ^C

Does anyone know what I got wrong or how to allow the sandbox access to an already existing pulse audio daemon?

Originally created by @ibhagwan on GitHub (Jan 13, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/3891 Perhaps more of a usage / understanding issue rather than a bug. Running latest firejail version 0.9.64 on Void Linux and I get no sound using Firefox, I believe it's due to firefox unable to access PulseAudio (v14.0.3). My pulse audio is started by running `start-pulseaudio-x11` within my `~/.xprofile`. I looked into all past issues regarding PulseAudio and different apps and tried many different suggestions, the latest "no sound in Zoom" issue suggested that pulse isn't running inside the sandbox and here is where I got confused as it seems that running `firejail sh -c "ps -ef"` returns only the process of the shell - so how does firefox (or any other app for that matter) access pulse or any other process? I tried many different troubleshooting steps I found in other issues: - `--noprofile` - `--nopulseauto` - `--allusers` - different `--no-blacklist` switches - `firecfg --fix-sound` - adding `enable-memfd = yes` to my `~/.config/pulse/client.conf` (even though it's the pulse default anyway...) - un-comment the `private-etc` line containing `pulse` in `/etc/firejail/firefox-common.profile` None of the above resulted in sound within firefox. The below is my attempt to communicate with the pulse daemon using the `pacmd` from within a firejail: ``` ~ ❯ ps -ef | grep pulse bhagwan 26298 1 0 11:18 ? 00:00:00 /usr/bin/pulseaudio --start --log-target=syslog bhagwan 26307 26298 0 11:18 ? 00:00:00 /usr/libexec/pulse/gsettings-helper bhagwan 26727 1346 0 11:18 pts/1 00:00:00 grep --color=auto pulse ~ ❯ pacmd Welcome to PulseAudio 14.0! Use "help" for usage information. >>> ^C ~ ❯ firejail --noautopulse --noprofile pacmd Parent pid 26805, child pid 26806 Child process initialized in 3.57 ms No PulseAudio daemon running, or not running as session daemon. Parent is shutting down, bye... ~ ❯ firejail pacmd Reading profile /etc/firejail/default.profile Reading profile /etc/firejail/disable-common.inc Reading profile /etc/firejail/disable-passwdmgr.inc Reading profile /etc/firejail/disable-programs.inc ** Note: you can use --noprofile to disable default.profile ** Parent pid 26912, child pid 26913 Warning: /sbin directory link was not blacklisted Warning: /usr/sbin directory link was not blacklisted Child process initialized in 41.52 ms No PulseAudio daemon running, or not running as session daemon. Parent is shutting down, bye... ~ ❯ firejail --noautopulse --noprofile sh -c "ps -ef | grep pulseaudio" Parent pid 26958, child pid 26959 Child process initialized in 3.55 ms bhagwan 1 0 0 11:19 pts/1 00:00:00 firejail --noautopulse --noprofile sh -c ps -ef | grep pulseaudio bhagwan 2 1 0 11:19 pts/1 00:00:00 sh -c ps -ef | grep pulseaudio bhagwan 5 2 0 11:19 pts/1 00:00:00 grep pulseaudio Parent is shutting down, bye... ~ ❯ ps -ef | grep pulse bhagwan 26298 1 0 11:18 ? 00:00:00 /usr/bin/pulseaudio --start --log-target=syslog bhagwan 26307 26298 0 11:18 ? 00:00:00 /usr/libexec/pulse/gsettings-helper bhagwan 27031 1346 0 11:19 pts/1 00:00:00 grep --color=auto pulse ~ ❯ pacmd Welcome to PulseAudio 14.0! Use "help" for usage information. >>> ^C ``` Does anyone know what I got wrong or how to allow the sandbox access to an already existing pulse audio daemon?
Author
Owner

@ibhagwan commented on GitHub (Jan 14, 2021):

Solved by running pulseaudio as a service with --system.

<!-- gh-comment-id:760449591 --> @ibhagwan commented on GitHub (Jan 14, 2021): Solved by running pulseaudio as a service with `--system`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2441
No description provided.