mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3484] PulseAudio not working in --chroot #2191
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @azurvii on GitHub (Jun 30, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3484
I try to get steam running with
firejail --chroot. Steam runs, but without audio.I'm on debian bullseye, and using
firejailfrom the repo, version 0.9.62-3.Steam logged the somewhat related error message:
PulseAudio connect failed (used only for Mic Volume Control) with error: Access denied.pavucontrolreportedFailed to create secure directory (/run/user/1000/pulse): No such file or directory.The ancestor
/run/user/folder was non-present in the chroot environment. In other non-chroot environments,mountcontained/run/user/$UIDfrom host. The chroot environment did not.I tried to create the folder structure manually, and
pulseaudioseemed to be able to create folders of its own, but it would complainE: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory.With that, I guess the pulseaudio is not configured in chroot environment like other non-chroot ones. While X11 is functional in chroot.
I found
--bind=but that is for root only. I have not found other related options to mount/run/userinto the chroot environment.--whitelist=did not work.@rusty-snake commented on GitHub (Jul 5, 2020):
In order to play audio from inside a chroot, you need at least to bind-mount $XDG_RUNTIM_DIR/pulse/native and copy /etc/machine-id.
@azurvii commented on GitHub (Jul 7, 2020):
Thanks @rusty-snake.
I'm not quite getting what you mean.
What I tried:
sudo firejail --bind=/run/user/1000/pulse/native,/run/user/1000/pulse/native --noprofile --chroot=/path/to/chroot.The run would complain
Error: invalid bind command, directory missing. (The chroot still works, just without that binding)I hope I did not do the
--bindwrongly?In case you wonder, I tried with a default bootstrapped root (which does not have the
/run/user/folder, or, of course, anything under it). I also tried with manually created/run/user/1000/pulse/folder, with the same permissions set as my host/run/user/1000/pulse/folder.Also, even if
--bindworks, my understanding is that it would only bind the folder for the session run as root, while I would not want to run steam as root. Do you suggest that I should run onesudo firejail ..., to just bind the folder, and another regularfirejail ...to run what I need?@rusty-snake commented on GitHub (Jul 7, 2020):
This was more a technical note. I don't think it is possible ATM to make PA work from inside a
--chroot. To sandbox steam, you are better advised with:--chroot@smitsohu commented on GitHub (Jul 25, 2020):
@azurvii You can bind mount it like you normally do, outside Firejail
@azurvii commented on GitHub (Aug 3, 2020):
Thanks @smitsohu! That, plus copying machine-id, indeed brought sounds to the chrooted steam. However, it seemed I had only the steam app playing sounds well, e.g. playing videos in a game's store page. When starting games, some of them came with loud static in addition to the game sounds; and some of them were just silent. I might have some settings messed up, and would have more tests when I get a break.
@azurvii commented on GitHub (Aug 5, 2020):
Closing issue. PulseAudio works in the steam app with the machine-id and bind-mounting. The static sounds are likely a config issue, which I'll take a look separately.
@Futureknows commented on GitHub (Sep 23, 2020):
I'm seeing the same problem in the Discord electron app.
Discord is launched with
'--seccomp=!chroot' --ignore=private-bin --ignore=private-dev --private-etc=group,passwd,machine-id. Discord launches but no sound hardware is detected under settings.I tried bind as provided by smitsohu:
Problem persists. Discord doesn't report any errors connecting to Pulseaudio, but sound hardware is not detected.