19

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

  • 5
    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 '19 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 '19 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 '19 at 6:55
  • 1
    I filed #1851250 asking if it possible to return to the unrestricted behavior of the package. – Jesse Glick Nov 4 '19 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 '19 at 21:37
18

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.

| improve this answer | |
  • the snap package worked like a charm. thanks – codegames Mar 11 at 0:05
  • 4
    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. – Ciro Santilli 郝海东冠状病六四事件法轮功 Apr 2 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 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 – Silver Moon Apr 27 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. – Dan Dascalescu Jun 17 at 17:12
2

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.
| improve this answer | |
  • @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. – Dan Dascalescu Jun 18 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 at 4:13
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.

| improve this answer | |
  • 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 '19 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 '19 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.

| improve this answer | |
0

Just mount the folder in your home like this:

enter image description here

| improve this answer | |
0

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 :'( .

| improve this answer | |
-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
| improve this answer | |
  • 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 '19 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.