mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #7038] Not keeping all mounts #3461
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#3461
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 @Melab on GitHub (Jan 20, 2026).
Original GitHub issue: https://github.com/netblue30/firejail/issues/7038
When I run a program with firejail, the mounts that are present at
/media/${USER}/*in the initial namespace are not present in the namespace that the jailed program runs in. How can I run a program such that its namespace has all the same mounts as its parent namespace except for the changes that I specify on the command line (like--read-only=/read/only/path)? The resulting mount namespace should be the most plain Jane copy of the originating namespace with the only differences being those specified on the command line. So, if I were to runfirejail --read-only=/read/only/directory "${other_necessary_args[@]}" -- program_name, the only difference should be that/read/only/directoryis bind mounted read-only. All programs inside it should run and all other privileges should be possessed.@netblue30 commented on GitHub (Jan 23, 2026):
It should leave /media and /mnt directories alone by default. Example:
@Melab commented on GitHub (Jan 25, 2026):
Nope. My command,
sudo firejail --read-only=/{etc,usr} loop, does not produce a namespace with mytmpfsmounted at/media. And, if I replaceloopwithbash, then when I runls /media/<MY_USERNAME>, I get:@netblue30 commented on GitHub (Jan 28, 2026):
Don't run with --read-only=/{etc,usr}. These directories are read-only inside the sandbox by default.
I don't know who handles /media in a Linux system. It is a gvfs or systemd thing, definitely something implemented by your desktop manager. Why do you mount a tmpfs on top of it?