VLC player cannot open files or directories out of "/home" [duplicate]

I'm using Ubuntu 20.04 with VLC player 3.0.11.

The player works well on files and directories within /home (for both /home/myname and /home/test), but cannot open files or directories located in other directories.

Some information about my environment:

Main output of mount:

/dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sda3 on /work type ext4 (rw,relatime)
/dev/sda2 on /home type ext4 (rw,relatime)

I try to add the following two lines in /etc/apparmor.d/usr.bin.evince and reload apparmor, but it doesn't work:

/work/ r,
/work/** rw,

Thank you very much for your help.


Snap packages are in containers which prevent them from "seeing" outside of those containers unless you give them permission.

For VLC, I'd recommend uninstalling the Snap package, and using the vanilla APT version:

sudo snap remove vlc

sudo apt update && sudo apt install vlc

Snap applications can't guarantee the access of directories/files outside of current user's $HOME. From zyga's post:

  • The $HOME directory of the user must match /home/*. Other directories are not supported yet. In particular /home/subdir/user is also not supported.

  • any installation where the user’s home is not available if they're not logged in, is not yet supported. This includes:

    • installations using automount
    • ecryptfs and similar tech that unencrypt the $HOME directory (or partition) only while the user is logged in

Note here “not supported” does not mean “doesn’t work”. Some things might not work, but also some sequences of events might result in a user not being able to access their data.

So, it's better to switch to deb version of VLC provided by Ubuntu's official repositories. To install VLC, run

sudo apt install --no-install-recommends vlc

And remove VLC's snap package using

sudo snap remove vlc