As others said - sandboxing is a feature, not a bug.
I think @Kevin Dubois' answer should perhaps be preferred where applicable (installing via flatpak the thing you want to share), but there is another solution to this problem if you would like to continue using flatpak
How to find /etc
and /usr
paths in a flatpak:
As mentioned at the end of this section of the documentation:
/etc
is mounted at /var/run/host/etc
for the flatpakked software
/usr
is mounted at /var/run/host/usr
for the flatpakked software
You also need to grant the --filesystem=host:ro
permission to your app if it doesn't have it yet (see below on how).
If you need to find or manage other paths:
NB: It is generally a good idea to give software as little extra access as possible. That's why it is preferable to use the optional :ro
suffix when granting access to a path to make it accessible in read-only. You will also be partly responsible if some software abuses the access it has to your device.
There's some useful path variables in the filesystem permissions reference and a lot of additional information about filesystem permissions here.
GUI option:
Flatseal is the most convenient option.
It only manages permissions on the user-level, so if you need to change settings for all users (usually not), then turn to the next section.
CLI option:
The examples below are for managing the path /var/lib/gems
for the flatpak app com.jetbrains.IntelliJ-IDEA-Community
. The 3 last commands are given with the --user
flag for a user-level change. Without the flag and with sudo
prepended the change would be applied to all users.
To check current permissions:
flatpak info --show-permissions com.jetbrains.IntelliJ-IDEA-Community
To grant access:
flatpak override --user --filesystem="/var/lib/gems":ro com.jetbrains.IntelliJ-IDEA-Community
To forbid access:
flatpak override --user --nofilesystem="/var/lib/gems" com.jetbrains.IntelliJ-IDEA-Community
To reset permissions to the initial state:
flatpak override --user --reset com.jetbrains.IntelliJ-IDEA-Community