56

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...

4 Answers 4

72

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.

2
  • 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! Commented Nov 13, 2020 at 11:09
  • 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
    Commented Mar 22, 2022 at 15:05
68

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 path, use "--nofilesystem":

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

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

6
  • Thanks, I can add Dropbox folder to the WPS Office path Commented 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
    Commented Jul 12, 2021 at 15:24
  • 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. Commented Aug 14, 2021 at 7:44
  • 1
    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
    Commented Feb 12, 2022 at 11:47
  • 2
    $ flatpak list to get the package name. Commented Dec 23, 2022 at 16:33
10

Run once to allow access to 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

Then:

flatpak run ApplicationIDHere
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
    Commented May 1, 2022 at 18:49
0

To add to this answer, which is similar to what Hassan said. I tried installing WhatsApp Web as a PWA. I needed to add these lines into Flatseal in order for Chrome being able to create a shortcut with a matching icon:

~/.local/share/applications

~/.local/share/icons

Remember to restart Chrome for the changes to take effect

Flatseal Chrome - File system - Other files - Entries

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .