0

Since the official chromium-browser switched to relying on the Snap-packaged variety, the browser gets "Permission Denied" when attempting to read any directory mounted after boot. For example, attempting to read the contents of a Kubuntu Live CD gives an error like:

Could not read the contents of kubuntu-20.04-live

Error opening directory '/media/travis/kubuntu-20.04-live': Permission denied

This happens for any volume which is not mounted at boot time (I haven't tested every possibility here, but seems to hold true). To grab a few examples, here's a clip from mount:

$> mount
...
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
/dev/nvme0n1p2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sdc2 on /media/travis/kubuntu-20.04-live type iso9660 (ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,dmode=500,fmode=400,uhelper=udisks2)
media-server:/volumes/shared on /mnt/media-shared type nfs4 (rw,nosuid,nodev,noexec,noatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.109,local_lock=none,addr=192.168.1.23,user=travis)
...
  • /proc: OK
  • /: OK
  • /home/travis: OK
  • /media/travis/kubuntu-20.04-live: can not read
  • /mnt/media-shared: can not read

I'm guessing this has to do with mount namespaces, so here's lsns:

$> lsns --type mnt
        NS TYPE NPROCS   PID USER   COMMAND
4026531840 mnt      77  1616 travis /lib/systemd/systemd --user
4026533212 mnt      13  9697 travis /snap/chromium/1043/usr/lib/chromium-browser/chrome --no-default-browser-check --no-first-run --password-store

If I use nsenter to read from the volumes as I think Chromium should see it, things appear to work just fine:

$> sudo nsenter --target 9697 --mount -- ls -al /media/travis
total 12
drwxr-x---+ 3 root   root   4096 Mar 22 09:24 .
drwxr-xr-x  3 root   root   4096 Apr 16  2019 ..
dr-xr-xr-x  9 travis travis 4096 Mar 16  2020 kubuntu-20.04-live
$> sudo nsenter --target 9697 --mount -- ls -al /media/travis/kubuntu-20.04-live
total 964
dr-xr-xr-x  9 travis travis   4096 Mar 16  2020 .
drwxr-x---+ 3 root   root     4096 Mar 22 09:24 ..
-r--r--r--  1 travis travis    351 Mar 15  2020 .treeinfo
...

The browser, however, stubbornly refuses to list the contents of these directories if I attempt to choose a download location or pick a file to upload. What gives?


As a point of clarification: I am not installing Chromium through Snap directly, but using the official Ubuntu chromium-browser package installed with apt install chromium-browswer. The /usr/bin/chromium-browser found there is just a shell script that calls /snap/bin/chromium. The package has a preinst script that calls snap install chromium, so you are downloading Chromium from Snap even when you don't want to.

  • If this is expected behavior, how do I change the expected behavior? – Travis Gockel Mar 22 '20 at 17:31
  • The package from apt pulls the debs from eoan-updates (https://packages.ubuntu.com/eoan-updates/amd64/chromium-browser/download), which just installs the package from Snap. I'm not sure what you're suggesting, given that "the links" say that the debs will just install from Snap. – Travis Gockel Mar 22 '20 at 17:41
  • I don't know why you're being such a jerk about this. I'm trying to figure out what is going wrong and you're clearly not listening to what I am saying. It isn't helpful. That "deb-provided binary installed to /usr/bin" is just a shell script that runs /snap/bin/chromium. – Travis Gockel Mar 22 '20 at 20:16
  • @mook765: Running snap connect chromium:removable-media and restarting Chromium solved the issue. Thank you. It feels like the chromium-browser package should do this for you in preinst. – Travis Gockel Mar 22 '20 at 20:39
  • 1
    You can also configure permissions for snaps from within the gnome-software GUI, installed snaps have an extra Permissions-button, take a look here. – mook765 Mar 22 '20 at 20:55

0 Answers0