7

Ubuntu 18.04 allows the system wide definition of command line options that are passed to the Chromium browser provided by the package chromium-browser. The flags are set in the file /etc/chromium-browser/default. Example file content:

# Default settings for chromium-browser. This file is sourced by /bin/sh from
# /usr/bin/chromium-browser

# Options to pass to chromium-browser
CHROMIUM_FLAGS="--disk-cache-dir=/dev/shm"

Where can I set the command line options for the snap version (installed using sudo snap install chromium ) of the Chromium browser?

1

1 Answer 1

4
+100

In the snap version you can set CHROMIUM_FLAGS inside ~/.chromium-browser.init with the same content as /etc/chromium-browser/default

For example

CHROMIUM_FLAGS="--incognito"

Source: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1837746

Edit

In addition to the flags, snap application doesn't have access to /dev/shm. Please use one of the following solutions:

  • Install chromium in dev mode snap install chromium --devmode to disable confinement
  • Use /dev/shm/snap.chromium instead of /dev/shm in your flag
4
  • Thank you for your answer. :) I copied the old configuration file to the location but unfortunately my specified flag is not set.
    – Marcello90
    Mar 5, 2020 at 21:45
  • I'm pretty sure that you have another problem, chromium snap are not allowed to write to /dev/shm as seen by the log Failed to create directory: /dev/shm/Default/Code Cache/js when running with your flags
    – jrandiny
    Mar 6, 2020 at 2:25
  • I have been successful in running chromium with your flag by installing it in devmode (disable confinement) snap install chromium --devmode
    – jrandiny
    Mar 6, 2020 at 2:33
  • Or you can create /dev/shm/snap.chromium which the snap have access to. mkdir /dev/shm/snap.chromium and set CHROMIUM_FLAGS="--disk-cache-dir=/dev/shm/snap.chromium"
    – jrandiny
    Mar 6, 2020 at 2:37

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.