VLC player cannot open files or directories out of “/home”

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.

6
задан 25 July 2020 в 19:43

3 ответа

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
19
ответ дан 30 July 2020 в 22:02

Access can be given with snap connect:

snap connect some-snap-name:removable-media

The name removable-media can be misleading, but that how it works.

2
ответ дан 30 July 2020 в 22:02

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
5
ответ дан 30 July 2020 в 22:02

Другие вопросы по тегам:

Похожие вопросы: