Score:0

Running Chrome on Ubuntu Server? How to solve "xdg-settings: not found"? (Using Chromium without desktop session?)

ru flag

Preface: We would like to create website screenshots using our server directly and stop using an external service. The Chromium browser has an option to generate a PNG graphic from a website. Thus, we want to use it.

We installed Chromium on our server:

sudo apt-get update
sudo apt-get install chromium-browser

Then we tried to run the browser and got this error:

chromium-browser --no-sandbox
/usr/bin/chromium-browser: 12: xdg-settings: not found
Trace/breakpoint trap

Version of Chromium-Browser:

chromium-browser --version
/usr/bin/chromium-browser: 12: xdg-settings: not found
Chromium 97.0.4692.99 snap

Trying to find more information about "xdg-settings":

xdg-settings is for use inside a desktop session only. It is not recommended to use xdg-settings as root.

How to fix the error and make Chromium run?



Note 1: When running xdg-settings we get -bash: xdg-settings: command not found. Probably because there is no desktop session on a server.

Note 2: Ubuntu version is "Ubuntu 20.04.3 LTS".

Score:2
ar flag
 sudo apt-get install xdg-utils

This will install xdg-settings for you.

With Debian-based distros a apt-cache search commandname is a very good approach when something is missing.

Avatar avatar
ru flag
Thanks. Is it save to install "xdg-utils" on a running server (with Apache, FFMPEG and other software)?
vidarlo avatar
ar flag
Not any more unsafe than chrome probably.
Avatar avatar
ru flag
The error message disappeared. But now there are other errors popping up finishing with "Exiting GPU process due to errors during initialization" ... oh my. Even though I started Chromium with `--disable-gpu`.
Avatar avatar
ru flag
Messages: `ERROR:angle_platform_impl.cc(44)] Display.cpp:894 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1068. ERROR:gl_surface_egl.cc(783)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1068.`
Avatar avatar
ru flag
Ah, `disable-gpu` is only for acceleration. Now the question is, can Chromium be run without graphics... so can Chromium be run on a server in general. - Found this which says no: https://superuser.com/q/449005/169199 - but maybe there is a workaround?
vidarlo avatar
ar flag
Can you describe what your end goal is? What do you want to use Chromium for? How do you want to use it?
lu flag
You are probably looking for Headless Chrome. https://developers.google.com/web/updates/2017/04/headless-chrome
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.