Open any folder from snap app besides /home/<user>/ and network mounts, etc

Hello, I am trying to figure out, how to allow any snap app, that I need, to be able to open any arbitrary path, which I need.
For example: I need with gimp, libreoffice, etc. to be able to open files from not only /home/ and removable media locations, but also from /tmp, network mounts, etc.

How to do it?
I’ve tried to use connect, but couldn’t figure it out.

I am on Ubuntu 16.04

If you need access to “any” path, then I believe you need to request “classic” confinement.

Does it mean, I need to reinstall it with such confinement or will I be able to change the setting without reinstallation?
Also, if not any, but a specific folder, for example: /tmp/, or some folder, with a network mount, for example: /mnt/sshfs-net/, how can I do it?

If you are developing a snap, then the only way to provide access to any folder is indeed by developing a classic snap and requesting classic confinement for your snap on this forum.

Classic snaps can only be installed in classic confinement if they were developed as such, by specifying confinement: classic in the snapcraft.yaml.

If you are developing a non-classic snap, you can try to use the system-files interface for this purpose, but note that directories that your snap sees at /tmp (and others) will not be the same as the directories outside of the snap - non-classic snaps run inside a specific mount namespace which isolates them from the host with a few exceptions. Additionally, you will need to request access to use the system-files interface also on this forum.

If you provide more detail on which directories you are trying to access we may be able to provide you with better answers and how you might go about doing this.

I want to have access to the real /tmp and to network mounts, that I have in /mnt folder.
One of them, for example is /mnt/81

directories under /mnt are exposed by the removable-media interface. The host’s /tmp is not accessible in any circumstances currently.

1 Like