Customizing chromium settings

Our manufacturing team noticed that the chromium kiosk was underlining misspelled words, which is probably not desirable in our application (though not a must change setting either.)

I found that if I launched in browser mode instead of kiosk mode, I could go into the settings and disable the spell check, but there doesn’t seem to be any way to pass a command line argument to change anything.

Since those settings would only live within the life of the container, I am not 100% sure the best way to save those settings, and get them to persist across multiple machines over multiple docker instances. I was able to locate the settings file, at /home/torizon/.config/chromium/Default/Preferences inside the container, but copying just this file, or the entire directory using the dockerfile is giving errors about not being able to read the lock files in the directory due to permissions, and usually crashing the container.

I am not sure a convenient way to work around that. If we just have to accept the spell check its not the end of the world, but it would be nice to be able to edit those settings if there was a convenient way to do so.

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for your detailed description of the issue.

You can disable spell check in Chromium in kiosk mode by passing the --disable-spell-checking flag directly to Chromium when starting your container. This is much simpler and more reliable than trying to persist or manipulate Chromium’s settings files, which—as you’ve observed—can lead to permission and lock file issues.

To disable spell checking, use this approach:

If you’re launching Chromium via a docker run command:

docker run -d --rm --name=chromium \
  -v /tmp:/tmp -v /dev/dri:/dev/dri \
  -v /var/run/dbus:/var/run/dbus --device-cgroup-rule='c 226:* rmw' \
  --security-opt seccomp=unconfined --shm-size 256mb \
  torizon/chromium-am62:$CT_TAG_CHROMIUM \
  --virtual-keyboard --disable-spell-checking https://www.toradex.com

(reference)

Or, in a Docker Compose file you can add it to the command:

services:
  kiosk:
    image: torizon/chromium
    command: --virtual-keyboard --disable-spell-checking --window-mode https://www.toradex.com/
    # [other options, volumes, etc.]

(reference)

This method ensures the spell checker is disabled every time your kiosk container starts up, with no need to modify internal preference files or manage permission issues.

If you need any further assistance on the configuration, feel free to ask!

Best regards, Toradex AI Assistant.

Hey @dTanks,

Was the AI suggestion able to help you turn off the spell check underline?

-Eric

Eric,

As far as I can tell, the AI completely made up that flag.

–disable-spell-checking does nothing when I try it.

https://peter.sh/experiments/chromium-command-line-switches/
Seems to list the flags that could be used, and nothing is listed there for spell checking

There is nothing in the shell script used to launch chromium that handles that flag either, unless there is a new version of that somewhere.

Hey @dTanks,

From our documents we link an unofficial list of flags that can be passed to chromium. While this list is extensive, it doesn’t cover everything, this list is also referenced in the chromium documents . From looking at the chromium Projects, it does look like there is a SpellChecker Object method.

  • Eric

HI @eric.tx

I am not sure I understand your answer. It seems that you linked the same list that I did, but I can’t find anything within the list for disabling spell checking. All my searches have indicated I have to do so thru the chrome settings, and I don’t know how to persist this setting between docker containers.

If there is an undocumented flag for turning it off, that would be great, but I am not sure how to find that.

Hey @dTanks,

I’m not sure what you mean between containers,between different instances of the same container? You would have to have the docker image already contain the changes which produces the container to have it persist through different container runs.

-Eric

@eric.tx

When I try to copy the settings file to the container, it crashes, as I mentioned in my original post.

I was able to locate the settings file, at /home/torizon/.config/chromium/Default/Preferences inside the container, but copying just this file, or the entire directory using the dockerfile is giving errors about not being able to read the lock files in the directory due to permissions, and usually crashing the container.

From what I understand, chromium is checking if files exist, and erroring out if the configuration isn’t as it expects. Its also creating symlinks to other files within the container, and this seems to be part of the crashing issue when I try to copy these files into the container.

Anyway, it seems like no convenient solution exists to set the chromium settings, and as far as I can tell the command line arguments are a bust as well, so I am just going to assume this isn’t possible to achieve.

Hey @dTanks,

If you have a config file/directory on the module that the container needs access to, you have to give it permission to do to, either via bind mount or volume.

Hey @dTanks ,

Can we close this specific ticket?

Best regards,

Sorry for the delayed reply, I have been too busy to really look into this recently.

I would not consider the problem solved, as mounting a volume does not work, as I mentioned earlier. The quickest way to show this is with the default chromium command listed on the website, just mounting the location of the chome settings within the /etc folder.

sudo mkdir /etc/chromeSettings
docker run -d --name=chromium -v /etc/chromeSettings:/home/torizon/.config/chromium -v /tmp:/tmp -v /var/run/dbus:/var/run/dbus -v /dev:/dev --device-cgroup-rule="c 199:* rmw" --device-cgroup-rule="c 81:* rmw" --device-cgroup-rule="c 234:* rmw" --device-cgroup-rule="c 253:* rmw"  --device-cgroup-rule="c 226:* rmw" --device-cgroup-rule="c 235:* rmw" --security-opt seccomp=unconfined --shm-size 256mb torizon/chromium-imx8:4 --virtual-keyboard http://info.cern.ch/hypertext/WWW/TheProject.html

When you try to run this, and check the logs, you get the following output.

docker container logs chromium
find: ‘/home/torizon/.config/chromium/Crash Reports/pending/’: No such file or directory
[11:11:0829/183602.901488:ERROR:filesystem_posix.cc(63)] mkdir : No such file or directory (2)
chrome_crashpad_handler: --database is required
Try 'chrome_crashpad_handler --help' for more information.
[11:35:0829/183603.242369:ERROR:bus.cc(406)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[11:35:0829/183603.242495:ERROR:bus.cc(406)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[11:35:0829/183603.242554:ERROR:bus.cc(406)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[11:35:0829/183603.242598:ERROR:bus.cc(406)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[11:11:0829/183603.270546:ERROR:process_singleton_posix.cc(335)] Failed to create /home/torizon/.config/chromium/SingletonLock: Permission denied (13)
[11:11:0829/183603.271034:ERROR:chrome_browser_main.cc(1501)] Failed to create a ProcessSingleton for your profile directory. This means that running multiple instances would start multiple browser processes rather than opening a new window in the existing process. Aborting now to avoid profile corruption.

The locks seem to just not work in these situations, no matter how I try to edit the permissions of the directory, or add flags such as --privileged to docker.

When I copy the file contents to a new folder, and add them to the docker file using the COPY command, I get similar premission denied errors, running chmod within the docker file doesn’t help, nor does chmod/chown outside of the docker file.