34

I installed Elisa music player from Flathub, but it refuses to see my Music partition, so I can't add any music to it's library unless I copy it to /home/my_user/.

Is there a way to give a Flatpak application permission to access non canonical addresses?

Aside from specifying it when compiling it...

3 Answers 3

47

To add to the other answer, another solution that worked for me was installing Flatseal. It makes setting permissions super easy and also has the added benefit of making the existing permissions really clear. Here's what adding a directory to steam looks like in Flatseal:

Adding extra directory to steam in Flatseal

I added the directory "MediaSSD" there, everything else is default.

3
  • 1
    Changing permissions might also reset all the preferences, at least this is what happened with Thunderbird. All the account settings were done, but, at least, now I can drag/drop files to attach them to messages! Nov 13, 2020 at 11:09
  • This app is awesome. Wish I would have known about it sooner. Jun 15, 2021 at 19:24
  • 2
    Because this tool downloads more than 200 megabytes of data in my case, it is possibly better to use other methods that does not require any further data installed.
    – 16851556
    Mar 22 at 15:05
46

You can do this via the command line. The specific command you need is (it may need to be run with sudo):

flatpak override <package_name_here> --filesystem=<path_here>

If you have an odd path & it complains about an "unexpected filesystem suffix", just put the path part in quotes.

If you wish to remove access to a particular address, use "--nofilesystem":

flatpak override <package_name_here> --nofilesystem=<path_here>

A more complete list of permissions/commands is found here.

5
  • Thanks, I can add Dropbox folder to the WPS Office path Apr 19, 2019 at 14:35
  • I did this with --filesystem=/home/myuser and it worked. I then tried with / to beeing able to access my shares at /mnt and from now on, when I try to start the app I get wrap: Can't create file at /run/user/1000/bus: No such device or address. My app is Flacon (I need it for splitting a large flac file`).
    – bomben
    Jul 12, 2021 at 15:24
  • Found a solution - flatpak override <package_name_here> --nofilesystem=<path_here>. So for you, do flatpak override com.github.Flacon --nofilesystem=/.
    – Pockets
    Jul 13, 2021 at 17:49
  • 1
    Note that, according to the official docs, these directories are blacklisted: /lib, /lib32, /lib64, /bin, /sbin, /usr, /boot, /root, /tmp, /etc, /app, /run, /proc, /sys, /dev, /var, meaning you can't give an app access to them even using the override method. Aug 14, 2021 at 7:44
  • What's missing from this answer is a way to check the current filesystem permissions. I couldn't find it in the linked documentation.
    – andrybak
    Feb 12 at 11:47
4

Access normal files on the host, not including host os or system internals:

sudo flatpak override ApplicationIDHere --filesystem=host

ApplicationID is shown using command: sudo flatpak list

1
  • This was the only thing that worked for me for PPSSPP flatpak not being able to access $USER/.var/app/org.ppsspp.PPSSPP (which was a symlinked folder, but both the base folder and symlinked folder had correct permissions).
    – ipkpjersi
    May 1 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.