25

I just upgraded to Ubuntu 19.10 and to my horror I discovered that the default browser Chromium can no longer access other partitions than /home.

This means that my partitions containing music and videos (/multimedia) for instance are no longer accessible e.g. to upload into Google Drive. This includes USB partitions.

I found another description of this phenomenon here: https://fosspost.org/reviews/distributions/ubuntu-19-10-review where it says

"Also, while we acknowledge that most users will only need to access their home folders, it’s worthy to mention that you no longer can access system files & folders from inside Chromium (You can’t access anything except your home folder). This means that if you are to upload a file or an image for example into the Internet using an uploading website, then this file/image must be in your home folder, as you can not access directories such as /usr, /etc or other directories located in your root partition. In fact, you no longer can access any other partition at all, this includes USB sticks and other booted partitions:"

I wonder why this behaviour been introduced? it violates the whole idea of multiple disks, partitions and symlinks. Btw, this still works for Firefox.

My questions are

  • Are there any plans to fix this?
  • I expect one reason for this behaviour is about security. If so, is it possible to explain why and how that makes for better security? The files on other partitions are legitimately accessible by the user anyway e.g. through symlinks. But with this change, I'll have to move them to /home before uploading so still accessing them although more slowly and cumbersome.
  • If this behaviour is now permanent, the question is how should we incorporate multiple disks in our filesystem?
  • Alternatively, can someone tell me how to find and install the debian package. I haven't been able to locate it?

This is not a duplicate of What is the classic mode of snap, and why do some snaps not install without it (e.g. MS Visual Studio)? because that is about a specific error during installation that I didn't get. My question is about the access chromium has in Ubuntu 19.10.

Anyway, I solved the problem via the following command by using the original debian package from Google:

sudo apt-get install google-chrome-stable

After that I can now access my other partitions again. I know this is hacky in the sense that the package isn't native to Ubuntu so I would really like to get some advice on how to incorporate multiple disks and partitions with this new restricted behaviour of Chromium.

Thank you very much

10
  • 6
    Chromium is now a snap, which has access to $HOME, /media/, /mnt/ and a few limited other areas. This is intended for security purposes (it runs in a container that restricts it's access to specified locations). It's not just $HOME, but no there currently are no plans to allow more as that would lessen security, not increase security. See discourse.ubuntu.com/t/… for more
    – guiverc
    Oct 28, 2019 at 6:00
  • On the other hand, adding new questions risks making this too broad. You have two unrelated questions really: What caused this (installing Chromium as a snap) and why are snaps confined and how can you work around that.
    – tripleee
    Oct 28, 2019 at 6:37
  • I am actually less interested in snap and more in why Chromium has changed behaviour - and how to fix it using multiple partitions.
    – uniomni
    Oct 28, 2019 at 6:55
  • 1
    I filed #1851250 asking if it possible to return to the unrestricted behavior of the package. Nov 4, 2019 at 15:08
  • 1
    @Michael What information is incorrect? I've been using the snapped version >6 months and can access /media fine (refer my answer below as it needs to be enabled); my version in June-2019 was 19.10 where as now it's 20.04, but the code is ~identical. I don't have much in /media currently, but I can browser what's there on chromium now, and no bugs have been filed on chromium on that issue tht I see bugs.launchpad.net/ubuntu/+source/chromium-browser
    – guiverc
    Dec 12, 2019 at 21:37

8 Answers 8

20

If you do a search back you can see whatever I learnt about it in this thread https://discourse.ubuntu.com/t/call-for-testing-chromium-browser-deb-to-snap-transition/11179/ . I'll also point you to https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1832711 where I filed a bug about issue accessing my NFS shares

where Olivier Tilloy (osomon) states

If you connect the removable-media plug, you should be able to access files and directories mounted under /mnt and /media. That won’t resolve your issue with NFS shares seamlessly, but maybe you can mount them there?

Looking at that bug report I ran

snap connect chromium:removable-media

then I reported that drag&drop worked like it did before switch to snap.

I didn’t change my mounts as I didn’t want to, but I added a few extra mount entries in /etc/fstab to load the my shares in /mnt/ too for the directories (NFS for me) that I wanted to be able to access in chromium. After that I had no issues.

Please note as this was all done 13-June-2019, my memory is a now little faded… but what I did works for me equally well on my now Ubuntu 20.04.

6
  • the snap package worked like a charm. thanks
    – codegames
    Mar 11, 2020 at 0:05
  • 7
    While the default behavior increases security, it makes the experience of the average user worse. I really wish there was a popup saying: "Program needs such permission, grant?" like Android does when things happen. Apr 2, 2020 at 11:59
  • You would need to suggest that idea by bug report to the developers (as a suggestion/wish). This is a user support site, so it's extremely unlikely to be read by any developer, or at an appropriate forum (discourse.ubuntu.com/t/… for example, though forum.snapcraft.io could be used too as devs do watch those sites)
    – guiverc
    Apr 2, 2020 at 12:13
  • awesome. that snap command worked like magic. Whenever i tried to open local html files in Chromium browser, i got this error *** Access to the file was denied The file at file:///path/to/file/index.html is not readable. It may have been removed, moved or file permissions may be preventing access. ERR_ACCESS_DENIED *** Now its fixed Apr 27, 2020 at 12:02
  • Does that snap:connect command work for arbitrary paths, e.g. if I have something mounted at /mnt/mydrive? I recall I tried it when I first ran into this snap annoyance, and it was impossible to let the snap access arbitrary paths. Today I found a workaround by mistake that allows full access. Jun 17, 2020 at 17:12
5

Just mount the folder in your home like this:

enter image description here

4

thanks to Dan Dascalescu for putting me on the right track

Just run the app as if it is not a snap \o/

  1. Use a menu editor eg. "Main Menu" to add a custom chromium "menu item" (this is what ubuntu uses to find apps when you press super+a) :
  2. Set Name eg.: Chromium Unsnapped
  3. Set Command: /snap/chromium/current/usr/lib/chromium-browser/chrome --user-data-dir=~/ChrUnsnapped --class="ChrUnsnapped" %U
  4. Set an icon eg. Download a retro chromium logo
  5. save/close
  6. super+a (or Show applications icon at bottom left) find your new item and right-click to add to favorites enter image description here

I am so super frustrated with snap that I can't configure my personal /stf dir like I have been doing for 15 years. Thank goodness for this hack, seems I'm going to have to do this for every freeken snap app :'( .

1
  • Hard to believe but it seems to work! At least it fixes my issue where I can't open Nautilus / Archive Manager directly by clicking on a downloaded file or on the small arrow > Show in folder. Also the default download path is now $HOME/Downloads instead of /run/user/1000/doc/ etc.
    – hsandt
    Jan 14, 2022 at 17:33
3

I found a solution by mistake (!). What I wanted to do is have a separate Chromium instance (not just profile). Turns out that removed any sort of access restrictions from Chromium snap (!).

Chromium snap access to /bin/

Here's my ~/.local/share/applications/ChromiumUnsnapped.desktop based on the .desktop file spec:

[Desktop Entry]
Version=1.0
Name=ChrUnsnapped
Exec=/snap/chromium/current/usr/lib/chromium-browser/chrome --user-data-dir=~/ChrUnsnapped --class="ChrUnsnapped" %U
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=~/whatever-icon-you-want-for-ChrUnsnapped.png
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
Actions=NewWindow;Incognito;TempProfile;
X-AppInstall-Package=chromium-browser
StartupWMClass=ChrUnsnapped
  • %U is for passing URLs.
  • --class="ChrUnsnapped" and StartupWMClass distinguish this Chromium instance from others.
4
  • @guiverc: I have no idea what's going on under the hood, but I can upload files successfully from my drive mounted at /z/, which was not discoverable before. Jun 18, 2020 at 3:38
  • 1
    I'll add this comment (related but taken from a quick conversation) "it's true that running random binaries from within a snap rather than the public entry points will not be sandboxed. There's no guarantee that such an invocation will work though" (relates to how it works for you, and why it may not work for everyone, every case...)
    – guiverc
    Jun 18, 2020 at 4:13
  • reusing my profile did not go the smoothest it could have gone, but it saved me from logging back into everything - Exec=/snap/chromium/current/usr/lib/chromium-browser/chrome --user-data-dir=~/snap/chromium/common/chromium --class="ChrUnsnapped" %U
    – Dave Ankin
    Mar 29, 2023 at 19:09
  • I also needed to add a wrapper script so that i can continue to open links in chrome from other applications - #/usr/bin/env bash /snap/chromium/current/usr/lib/chromium-browser/chrome \ --class="ChrUnsnapped" \ "$@"
    – Dave Ankin
    Mar 29, 2023 at 19:10
0

It may be that you installed chromium as a snap through the snap store on the Ubuntu Software Center. If that is the case, go back to the chromium page on the Ubuntu Center and there should be a uninstall button and a settings icon to the right of that. Click on that, ant there will be a few permission options, and one of them would be storage related "I do not remember, but I recommend you select all of the boxes". Restart chromium and it should allow you to access your whole hard drive.

Second solution (Cause I am not certain about the first solution) - Manually install chromium or Google Chrome (recommended) through a .Deb file. Since Ubuntu is trying to be more snap-based with their software, some apps lose necessary permissions which you might need to manually grant through the software center.

2
  • Thanks for your suggestion. I tried the first without any luck. The second worked by running the command: sudo apt-get install google-chrome-stable
    – uniomni
    Oct 28, 2019 at 6:47
  • 1
    Chromium is installed as a deb; allowing for upgrades to work flawlessly, but in 19.10 the .deb is just a wrapper that pulls in the snap. Ubuntu 19.10 was not the first release to do this, however chromium is a more significant program that prior releases that used this functionality. Some snaps can be run with limited confinement (classic mode), but they must be built to allow it, and it's not the standard way.
    – guiverc
    Oct 28, 2019 at 7:03
0

Because the Chromium snap broke my workflow, I found a solution for installing via a Chromium DEB file. I used Kubuntu 19.10.

  1. Go to: https://www.chromium.org/getting-involved/download-chromium
  2. Pull down the latest DEB file: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/
  3. Unzip the file into a folder.
  4. Type Alt-Space (on Kubuntu) to open a command line at the top of the screen, then type "chrome" (without sudo)
  5. Pin it to a panel. Now it is available to run anytime.

I have noticed, though, that sometimes it becomes unresponsive and needs to be closed and restarted. Not sure why this is happening. But at lease Chromium can access the partitions I use.

1
0

You can create a file ~/.chromium-browser.init with content:

CHROMIUM_FLAGS="--class=\"ChrUnsnapped\""

This would do the same a instructed above by editing .desktop files. That file is sourced by wrappers that run if you just run chromium from the command line. See file /snap/chromium/current/bin/chromium.launcher

-3

The problem with chromium not being able to access other partitions than /home can be fixed by

1: Removing it 2: Installing the original debian package:

sudo apt-get install google-chrome-stable
1
  • 2
    The original .deb package is what installs the snap. Your command also install a different browser (based on chromium yes, but includes other code and is closed source)
    – guiverc
    Oct 28, 2019 at 8:02

You must log in to answer this question.

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