Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
0
answers
23
views
Gqrx GUI not showing in Docker (Openbox + Xvfb + noVNC) on macOS host
### 📝 Body: I'm running **Gqrx SDR** inside a **Docker container** on my **local macOS** machine using: * `Openbox` for the window manager * `Xvfb` for the X11 display * `x11vnc` + `noVNC` to stream the GUI via browser * Docker Desktop on macOS as the host environment --- ### ✅ Working: * Th...
### 📝 Body:
I'm running **Gqrx SDR** inside a **Docker container** on my **local macOS** machine using:
*
Openbox
for the window manager
* Xvfb
for the X11 display
* x11vnc
+ noVNC
to stream the GUI via browser
* Docker Desktop on macOS as the host environment
---
### ✅ Working:
* The container builds and runs successfully
* http://localhost:6080
opens the noVNC interface
* xterm
and xeyes
work and appear inside the noVNC desktop
* openbox-session
starts without issue
* gqrx
runs without crashing (just a PulseAudio warning)
---
### ❌ Problem:
* **The Gqrx GUI never appears** in the noVNC browser window
* gqrx
doesn't crash or exit
* Other X11 apps render correctly
* I've tested both automatic and manual gqrx
startup
---
### 🛠️ Environment:
* macOS 14.x with Docker Desktop (Ubuntu 22.04 container)
* Access via browser: http://localhost:6080
* Docker run:
docker run -it --rm \
-p 6080:6080 \
-v ~/gqrx_data/config:/home/appuser/.config/gqrx \
-v ~/gqrx_data/recordings:/home/appuser/recordings \
gqrx-openbox
---
### 📄 Dockerfile:
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gqrx-sdr openbox x11vnc xvfb xterm \
python3-pip python3-xdg \
wget curl xfonts-base fonts-dejavu \
qt5-style-plugins bash && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip3 install websockify
RUN wget -qO- https://github.com/novnc/noVNC/archive/refs/heads/master.tar.gz | tar xz -C /opt && \
ln -s /opt/noVNC-master /opt/noVNC
RUN useradd -ms /bin/bash appuser
COPY start.sh /start.sh
RUN chmod +x /start.sh
USER appuser
WORKDIR /home/appuser
EXPOSE 6080
CMD ["/start.sh"]
---
### 📄 start.sh:
#!/bin/bash
set -e
export DISPLAY=:1
export QT_QPA_PLATFORM=xcb
export QT_OPENGL=software
export QT_QPA_PLATFORMTHEME=gtk2
export LANG=C.UTF-8
export XDG_RUNTIME_DIR=/tmp/runtime-appuser
export PULSE_SERVER=127.0.0.1
mkdir -p $XDG_RUNTIME_DIR
chmod 700 $XDG_RUNTIME_DIR
echo "[+] Starting Xvfb..."
Xvfb :1 -screen 0 1920x1080x24 &
sleep 2
echo "[+] Starting Openbox..."
openbox-session &
echo "[+] Starting x11vnc..."
x11vnc -display :1 -nopw -forever -shared -bg
echo "[+] Starting noVNC..."
websockify --web=/opt/noVNC 6080 localhost:5900 &
echo "[+] Writing default Gqrx config..."
mkdir -p /home/appuser/.config/gqrx
if [ ! -f /home/appuser/.config/gqrx/default.conf ]; then
cat /home/appuser/.config/gqrx/default.conf
[grc]
audio_backend=disabled
audio_input=null
EOF
fi
echo "[+] Launching Gqrx..."
gqrx &
xterm &
tail -f /dev/null
---
### 🧪 Tried:
* Verified xeyes
and xterm
render correctly
* Manually launched Gqrx inside xterm
* Set QT_DEBUG_PLUGINS=1
— Qt loads plugins fine
* Checked DISPLAY=:1
, XDG_RUNTIME_DIR
, and permissions
* Verified Qt uses xcb
and software
OpenGL
* No error on Gqrx — but **GUI never appears**
---
### ❓Question:
**Why would Gqrx fail to show its GUI window** inside a fully working Openbox + Xvfb + x11vnc + noVNC environment on macOS Docker, when everything else (like xterm
, xeyes
) works?
Is there something special about Gqrx/Qt that could block it from rendering under Xvfb?
nick97
(11 rep)
Jun 10, 2025, 10:23 PM
3
votes
1
answers
3071
views
Display xvfb output in remote PC
I have a Windows pc that I use to connect to my Ubuntu PC over ssh that I use as a server (18.04) that is connected only to the internet and power (No monitor). When I run `glxgears -info` I only get 8-10 fps while having a graphics card. When I run it as `xvfb-run glxgears -info` I get 2000~ fps (W...
I have a Windows pc that I use to connect to my Ubuntu PC over ssh that I use as a server (18.04) that is connected only to the internet and power (No monitor). When I run
glxgears -info
I only get 8-10 fps while having a graphics card. When I run it as xvfb-run glxgears -info
I get 2000~ fps (Which I assume because it uses my GPU to render). But I can't get xvfb-run
to display in my Xming X server. Running glxgears -info
displays in Xming but as I said, low performance, etc. How Can I make xvfb to display in Xming on my Windows machine? Or is there an easier/better way to do this?
Thanks!
user396583
Feb 21, 2020, 08:11 AM
• Last activity: Apr 26, 2025, 12:03 PM
1
votes
1
answers
153
views
zoom meeting with cron
My zoom class teacher doesn't give us a link with a hashed password and I am using [this](https://github.com/tmonfre/zoom-cli) to open zoom from command line. (**EDIT:** Later I knew that normal zoom command open a link with non-hashed password.) Now I am even sick of typing the command in a termina...
My zoom class teacher doesn't give us a link with a hashed password and I am using [this](https://github.com/tmonfre/zoom-cli) to open zoom from command line. (**EDIT:** Later I knew that normal zoom command open a link with non-hashed password.)
Now I am even sick of typing the command in a terminal, so that I want to make it a cron job. My script (
/home/taro/Scripts/i_hate_cron.sh
)is like:
#!/bin/bash
export DISPLAY=:0
export BROWSER=/usr/bin/google-chrome-stable
/usr/bin/pyzoom class101
Here, pyzoom
is a symbolic link to the afore-hyperlinked python program that opens a zoom meeting with automatically filling a meeting ID and a password. And the systemctl status cronie.service
's output is
4:52 yamada CROND: pam_unix(crond:session): session closed for user taro
Feb 18 16:25:01 yamada crond: pam_unix(crond:session): session opened for user taro(uid=1000) by (uid=0)
Feb 18 16:25:01 yamada CROND: (taro) CMD (/home/taro/Scripts/i_hate_cron.sh)
Feb 18 16:25:52 yamada CROND: (taro) CMDEND (/home/taro/Scripts/i_hate_cron.sh)
Feb 18 16:25:52 yamada CROND: pam_unix(crond:session): session closed for user taro
crond
didn't give me the zoom window:<
Using xvfb
and taking a screenshot of it, I confirmed that this cron
job works fine with it, but I don't know how to change from outputting to display :99
, which is the default of xvfb
, to :0
.
What should I do to make zoom open automatically with cron
? (Actually I prefer systemd/Timer
, since I am using Arch Linux. So I also welcome answers adopting systemd
)
Taro
(111 rep)
Feb 18, 2023, 07:41 AM
• Last activity: Jan 15, 2025, 10:42 PM
0
votes
1
answers
92
views
How can I run Firefox on a non-local virtual server?
I need to run Firefox (or some other web browser, but I prefer Firefox) on a non-local (i.e. not on my PC, not reachable via LAN) Unix virtual machine and then control it using keyboard and mouse, because some websites only work with Javascript and don't allow downloads unless I'm logged in. ```ssh...
I need to run Firefox (or some other web browser, but I prefer Firefox) on a non-local (i.e. not on my PC, not reachable via LAN) Unix virtual machine and then control it using keyboard and mouse, because some websites only work with Javascript and don't allow downloads unless I'm logged in.
-X
doesn't cut it, because it is a pain to use unless you are connected to the Internet with 10 Gbit/s. And I don't really feel like installing one of the fat "lightweight" desktop environments like Gnome or Xfce. And of course Firefox is not supposed to run as root.
user2845840
(123 rep)
Dec 16, 2024, 04:41 AM
• Last activity: Dec 16, 2024, 02:28 PM
0
votes
1
answers
92
views
SWTError: No more handles [gtk_init_check() failed running web-app in Tomcat9 on RHEL9.4 with Xvfb
We are running a third-party Java web application in Tomcat 9.0.87 on RHEL9.4. When the web app starts it raises the following exception that we (working with vendor support team) can't seem to get rid of. ``` 2024-09-04 08:38:46,255 [ ERROR ] | SWT dispatcher | o.l.core.base.util.Threads:226 - Unca...
We are running a third-party Java web application in Tomcat 9.0.87 on RHEL9.4. When the web app starts it raises the following exception that we (working with vendor support team) can't seem to get rid of.
2024-09-04 08:38:46,255 [ ERROR ] | SWT dispatcher | o.l.core.base.util.Threads:226 - Uncaught exception 'No more handles [gtk_init_check() failed]' received on thread Thread[SWT dispatcher,5,main]
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Display.createDisplay(Unknown Source)
at org.eclipse.swt.widgets.Display.create(Unknown Source)
at org.eclipse.swt.graphics.Device.(Unknown Source)
at org.eclipse.swt.widgets.Display.(Unknown Source)
at org.eclipse.swt.widgets.Display.(Unknown Source)
at org.eclipse.swt.widgets.Display.getDefault(Unknown Source)
We are running Xvfb as a service
# cat /etc/systemd/system/Xvfb.service
[Unit]
Description=X Virtual Frame Buffer Service
After=network.target
[Service]
User=root
ExecStart=/usr/bin/Xvfb :99 -ac -screen 0 1280x1024x24
[Install]
WantedBy=multi-user.target
# systemctl status Xvfb.service
● Xvfb.service - X Virtual Frame Buffer Service
Loaded: loaded (/etc/systemd/system/Xvfb.service; enabled; preset: disabled)
Active: active (running) since Wed 2024-09-04 08:43:52 BST; 19min ago
Main PID: 830483 (Xvfb)
Tasks: 1 (limit: 11104)
Memory: 8.4M
CPU: 27ms
CGroup: /system.slice/Xvfb.service
└─830483 /usr/bin/Xvfb :99 -ac -screen 0 1280x1024x24
Sep 04 08:43:52 systemd: Started X Virtual Frame Buffer Service.
Tomcat starts with
# cat /usr/share/tomcat/bin/setenv.sh
export DISPLAY=:99
export SWT_GTK3=0
export CATALINA_OPTS="-Xms2048M -Xmx2048M -XX:MaxMetaspaceSize=256M -Djava.awt.headless=true -Dprism.order=sw"
# cat /usr/share/tomcat/bin/setenv.sh
export DISPLAY=:99
export SWT_GTK3=0
export CATALINA_OPTS="-Xms2048M -Xmx2048M -XX:MaxMetaspaceSize=256M -Djava.awt.headless=true -Dprism.order=sw"
[root@gbjhvice092 ~]# systemctl status tomcat
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; preset: disabled)
Active: active (running) since Wed 2024-09-04 08:38:32 BST; 29min ago
Main PID: 828457 (java)
Tasks: 52 (limit: 11104)
Memory: 777.3M
CPU: 1min 10.333s
CGroup: /system.slice/tomcat.service
└─828457 /usr/lib/jvm/jre/bin/java -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-jul>
An extract from catalina.log
:
04-Sep-2024 06:12:17.666 INFO [Thread-7] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
04-Sep-2024 06:12:19.160 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.87
04-Sep-2024 06:12:19.168 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 10 1970 04:21:54 UTC
04-Sep-2024 06:12:19.169 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.87.0
04-Sep-2024 06:12:19.169 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
04-Sep-2024 06:12:19.169 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.14.0-427.31.1.el9_4.x86_64
04-Sep-2024 06:12:19.169 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
04-Sep-2024 06:12:19.169 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-17-openjdk-17.0.12.0.7-2.el9.x86_64
04-Sep-2024 06:12:19.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 17.0.12+7-LTS
04-Sep-2024 06:12:19.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Red Hat, Inc.
04-Sep-2024 06:12:19.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/share/tomcat
04-Sep-2024 06:12:19.170 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/share/tomcat
04-Sep-2024 06:12:19.208 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
04-Sep-2024 06:12:19.209 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/share/tomcat
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/share/tomcat
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/var/cache/tomcat/temp
04-Sep-2024 06:12:19.210 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties
04-Sep-2024 06:12:19.211 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Chris Pudney
(101 rep)
Sep 4, 2024, 08:14 AM
• Last activity: Sep 5, 2024, 10:22 AM
0
votes
1
answers
244
views
How to debug (gdb) a binary that is invoked with xvfb-run?
I have a binary that I usually run as follows: ``` $ xvfb-run ./bin --param1 foo ``` However, now that I need to debug it using GDB, I'm not able to do: ``` $ gdb --args xvfb-run ./bin --param1 foo ``` because `"/usr/bin/xvfb-run": not in executable format: file format not recognized.` Is there a wa...
I have a binary that I usually run as follows:
$ xvfb-run ./bin --param1 foo
However, now that I need to debug it using GDB, I'm not able to do:
$ gdb --args xvfb-run ./bin --param1 foo
because "/usr/bin/xvfb-run": not in executable format: file format not recognized.
Is there a way to do this? For example, by using **Xvfb**?
TIA!
albertoperdomo2
(315 rep)
Jun 12, 2023, 08:07 AM
• Last activity: Jun 12, 2023, 08:31 AM
1
votes
0
answers
746
views
Virtual Display but with GPU/Hardware Acceleration
To do some automated screen recordings for promo videos of web applications I'm using chromium/selenium inside of xvfb to run the web application and ffmpeg to record the video. Even tough this looks ok, sometimes it seems to be laggy during some animation-intense scenes most likely due to missing g...
To do some automated screen recordings for promo videos of web applications I'm using chromium/selenium inside of xvfb to run the web application and ffmpeg to record the video. Even tough this looks ok, sometimes it seems to be laggy during some animation-intense scenes most likely due to missing gpu/hardware acceleration.
Is there any alternative to run an application with gpu/hardware acceleration headless?
hypnomaki
(111 rep)
May 2, 2022, 02:17 PM
• Last activity: Jan 31, 2023, 04:21 AM
5
votes
1
answers
1169
views
What is the "native" frame rate of an Xvfb screen?
I am emulating a screen with `Xvfb`, and I want to capture it with ffmpeg. In order to prevent frame dropping or duplication, I would like to capture at the exact refresh rate of the screen, but it seems that Xvfb does not … have this? `xrandr` confirms that it's 0.0: ``` $ Xvfb :123 -ac -nolis...
I am emulating a screen with
Xvfb
, and I want to capture it with ffmpeg. In order to prevent frame dropping or duplication, I would like to capture at the exact refresh rate of the screen, but it seems that Xvfb does not … have this?
xrandr
confirms that it's 0.0:
$ Xvfb :123 -ac -nolisten tcp -screen 0 1920x1080x24 &
$ DISPLAY=:123 xrandr
xrandr: Failed to get size of gamma for output screen
Screen 0: minimum 1 x 1, current 1920 x 1080, maximum 1920 x 1080
screen connected 1920x1080+0+0 0mm x 0mm
1920x1080 0.00*
At which rate are the images then drawn to the screen? ffmpeg shows 29.97 fps for this input when using x11grab
:
$ ffmpeg -f x11grab -i :123
ffmpeg version 4.3.5-0+deb11u1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[x11grab @ 0xaaaadaa0c2a0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':123':
Duration: N/A, start: 1669816070.219332, bitrate: 1988667 kb/s
Stream #0:0: Video: rawvideo (BGR / 0x524742), bgr0, 1920x1080, 1988667 kb/s, 29.97 fps, 1000k tbr, 1000k tbn, 1000k tbc
But when I encode using the "native" framerate at realtime, I get more like ~17-21 fps.
$ ffmpeg -progress - -nostats -f x11grab -re -i :123 -f null /dev/null
…
frame=198
fps=17.80
stream_0_0_q=-0.0
bitrate=N/A
total_size=N/A
out_time_us=11111100
out_time_ms=11111100
out_time=00:00:11.111100
dup_frames=0
drop_frames=0
speed=0.999x
progress=end
It appears to me that the display does not even have a native frame rate, rather letting me sample as often as I want from it.
So, my question is: is that correct? If so, does it go up to "infinite" fps as long as the processing power is large enough?
slhck
(504 rep)
Nov 30, 2022, 02:19 PM
• Last activity: Jan 27, 2023, 01:53 AM
4
votes
0
answers
1845
views
Puppeteer/Chromium on Debian Docker K8s: "Failed to open an X11 connection"
This is driving me crazy, did not think it would be this hard to get a headless chromium instance running with puppeteer launch config. Here's the error: ``` # launching puppeteer with config {"args":["--no-sandbox","--disable-setuid-sandbox","--disable-dev-shm-usage","--disable-accelerated-2d-canva...
This is driving me crazy, did not think it would be this hard to get a headless chromium instance running with puppeteer launch config.
Here's the error:
# launching puppeteer with config {"args":["--no-sandbox","--disable-setuid-sandbox","--disable-dev-shm-usage","--disable-accelerated-2d-canvas","--no-first-run","--no-zygote","--single-process","--disable-gpu","--headless"],"headless":true,"devtools":false,"timeout":90000,"executablePath":"/usr/bin/chromium","dumpio":true}
[0124/153812.589239:ERROR:browser_main_loop.cc(536)] Failed to open an X11 connection.
[0124/153812.590155:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
xcb_connection_has_error() returned true
[0124/153812.592511:WARNING:audio_manager_linux.cc(69)] Falling back to ALSA for audio output. PulseAudio is not available or could not be initialized.
Here is my Dockerfile:
FROM node:16.13
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium
RUN apt-get update \
&& apt-get install -yq wget curl gnupg libgconf-2-4 ca-certificates wget xvfb dbus dbus-x11 build-essential --no-install-recommends
RUN apt-get update && apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 \
libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 \
libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 \
libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release \
xdg-utils wget
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install chromium fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 dbus-x11 -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/\*
RUN mkdir -p /usr/src/app
VOLUME ["/usr/src/app"]
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN yarn install
RUN chmod -R 777 /usr/src/app
ENTRYPOINT [ "./entrypoint.sh" ]
EXPOSE 80
Here is my entrypoint.sh
:
#!/bin/bash
# Startup Xvfb
Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
# Export some variables
export DISPLAY=:99.0
npm run-script deploy-force && npm start && sleep 6000
And here is my Puppeteer config:
const puppeteerConfig = {
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-accelerated-2d-canvas',
'--no-first-run',
'--no-zygote',
'--single-process', // <- this one doesn't works in Windows
'--disable-gpu',
'--headless'
],
headless: true,
devtools: false,
timeout: 90000,
executablePath: '/usr/bin/chromium',
dumpio: true
};
I thought by running Xvfb
my x11 connection would just happen?
AlxVallejo
(141 rep)
Jan 24, 2023, 03:51 PM
3
votes
0
answers
2526
views
How to pass display number to xvfb-run?
I tried to start chrome with `xvfb-run`: - Ubuntu 18.04.5 LTS - Chromium 105.0.5173.0 If I specified display number as 76, `xvfb-run` failed to start: ``` $ xvfb-run --error-file=/tmp/Xvfb-errors.log -s ":76 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24" chrome >./chrome.log 2>&1 & $ [1]+ Exit 1 x...
I tried to start chrome with
xvfb-run
:
- Ubuntu 18.04.5 LTS
- Chromium 105.0.5173.0
If I specified display number as 76, xvfb-run
failed to start:
$ xvfb-run --error-file=/tmp/Xvfb-errors.log -s ":76 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24" chrome >./chrome.log 2>&1 &
$
+ Exit 1 xvfb-run -s ":76 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24" chrome > ./chrome.log 2>&1
$ cat chrome.log
[25736:25736:0819/203148.686095:ERROR:ozone_platform_x11.cc(246)] Missing X server or $DISPLAY
[25736:25736:0819/203148.686137:ERROR:env.cc(226)] The platform failed to initialize. Exiting.
A check showed that /tmp/Xvfb-errors.log
was empty.
If I specified display number as 99, xvfb-run
succeeded. And :99 :99
was passed to xvfb:
$ xvfb-run -s ":99 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24" chrome >./chrome.log 2>&1 &
$ ps -ef | ag xv
rb_user 25836 25820 0 20:32 pts/0 00:00:00 /bin/sh /usr/bin/xvfb-run -s :99 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24 chrome
rb_user 25847 25836 0 20:32 pts/0 00:00:00 Xvfb :99 :99 -auth /tmp/xvfb.auth -ac -screen 0 1920x1080x24 -nolisten tcp -auth /tmp/xvfb-run.FWVOd6/Xauthority
$ xdpyinfo -display :99
name of display: :99
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 11906000
X.Org version: 1.19.6
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 6
...
Can anybody explain why the latter way works but the former does not?
Jingguo Yao
(131 rep)
Aug 20, 2022, 03:00 AM
• Last activity: Aug 22, 2022, 07:25 AM
1
votes
0
answers
325
views
Selenium XVFB - Unable to receive message from renderer
Overview: -------- Selenium **scraper works perfectly** in headless mode. Spawning a **virtual display shows no errors** via XVFB: from xvfbwrapper import Xvfb vdisplay = Xvfb() vdisplay.start() vdisplay.stop() But when I **try to run them together, it errors out** with: *[ERROR] SessionNotCreatedEx...
Overview:
--------
Selenium **scraper works perfectly** in headless mode. Spawning a **virtual display shows no errors** via XVFB:
from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
vdisplay.stop()
But when I **try to run them together, it errors out** with:
*[ERROR] SessionNotCreatedException: Message: session not created
from disconnected: Unable to receive message from renderer (Session info: chrome=96.0.4664.0)*
Traceback:
---------
Traceback (most recent call last):
File "/var/task/slack_main.py", line 34, in handler
scrape_price(asin_list)
File "/var/task/slack_main.py", line 58, in scrape_price
driver = webdriver.Chrome("/opt/chromedriver",options=options)
File "/var/lang/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
File "/var/lang/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 92, in __init__
RemoteWebDriver.__init__(
File "/var/lang/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 275, in __init__
self.start_session(capabilities, browser_profile)
File "/var/lang/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 365, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/var/lang/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 430, in execute
self.error_handler.check_response(response)
File "/var/lang/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
----------
Configuration:
-------------
Below is my complete Selenium and XVFB configuration:
from selenium import webdriver
from selenium_stealth import stealth
from xvfbwrapper import Xvfb
vdisplay = Xvfb()
vdisplay.start()
options = webdriver.ChromeOptions()
prefs = {"browser.downloads.dir": "//tmp//", "download.default_directory": "//tmp//", "directory_upgrade": True}
options.add_experimental_option("prefs", prefs)
options.binary_location = '/opt/chrome/chrome'
#options.add_argument('--headless') #toggled on and off when running with or without XVFB
options.add_argument('--no-sandbox')
options.add_argument("--disable-gpu")
options.add_argument("--window-size=1280x1696")
options.add_argument("--single-process")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--disable-dev-tools")
options.add_argument("--no-zygote")
options.set_capability('unhandledPromptBehavior', 'ignore')
options.add_argument("download.default_directory=/tmp")
driver = webdriver.Chrome("/opt/chromedriver",options=options)
stealth(driver,
languages=["en-US", "en"],
vendor="Google Inc.",
platform="Win32",
fix_hairline=True,
)
vdisplay.stop()
driver.close()
**Why is it not connecting to the display?** My guess is it has something to do with the '--headless' toggle?
Versions and Tools:
-------------------
- Selenium version 3.141.0
- xvfbwrapper version 0.2.9
- Docker is used to compile and push to AWS Lambda, base image used **(no changes are made in docker file with or without XVFB)**
Luke Hamilton
(111 rep)
Jun 21, 2022, 11:45 PM
0
votes
2
answers
413
views
Raspbian running headless doing scripted procedures on a internet page using text browser
I am somewhere between a new and intermediate linux user. I am setting up a local network for a small group, and I need to configure an automatic sign-in to a webportal when internet connectivity is lost. I have this working when I run my bash script with a monitor on the raspberry (RASPBIAN OS) its...
I am somewhere between a new and intermediate linux user.
I am setting up a local network for a small group, and I need to configure an automatic sign-in to a webportal when internet connectivity is lost.
I have this working when I run my bash script with a monitor on the raspberry (RASPBIAN OS) itself, the sequence of things are:
Check if internet is down with fping --> Open xterm --> have xdotool open w3m and automate the clicks and inputting password.
Here is my code in condensed form:
DNSPing=$(fping 9.9.9.9)
EtecsaPing=$(fping 10.180.0.30)
...
if [[ ( $EtecsaPing == "10.180.0.30 is alive" ) && ( $DNSPing == "9.9.9.9 is unreachable" ) ]]
then
echo "ETECSA UP - Internet all down - Run login script now"
xterm &
sleep 2
xdotool type "w3m -m https://10.180.0.30:8443/ "
xdotool key Return
...
xdotool type
xdotool key Return
xdotool sleep 1
...
xdotool key Return
xdotool type
xdotool sleep 1
...
xdotool key Return
sleep 5
killall xterm
fi
So when I connect a monitor and mouse and run this it works just fine.
I want to have this running headless and with the script in crontab, and after 2 days of trying I feel like I'm just going in circles.
The problem is that both the new xterm session and xdotool requires a DISPLAY defined to run.
To that end I have installed xvfb which creates a simulated display.
sudo Xvfb :10 -ac -screen 0 1024x768x24
DISPLAY=:10 xterm & (the script from above)
That runs without any errors, but it also does not work.
If I run:
sudo Xvfb :10 -ac -screen 0 1024x768x24
DISPLAY=:10 xterm -e "echo 'deb blah ... blah' | sudo tee -a /CronJobs/yap.txt > /dev/null"
It adds the echo to the file, so I know that my display is running the xterm session, and I conclude the simulated display and xterm session is all working.
If I do:
sudo Xvfb :10 -ac -screen 0 1024x768x24
DISPLAY=:10 xterm &
DISPLAY=:10 xdotool type "sudo echo 'deb blah ... blah' | sudo tee -a /CronJobs/yap.txt > /dev/null"
DISPLAY=:10 xdotool key Return
It does not work.
In conclusion, xdotool is working (no errors), but not doing anything!
So I'm thinking xdotool is not typing into the xterm terminal because the window is not selected, and I try to select the xterm window and I get:
DISPLAY=:10 xdotool getactivewindow
Your windowmanager claims not to support _NET_ACTIVE_WINDOW, so the attempt to query the active window aborted.
xdo_get_active_window reported an error
And at this point my project is so unique that I can't find any good suggestions on what to do. A few people have tried to exchange the windowmanager for Xvfd but it's few and complicated.
Put in simple words:
- How can I make Xvfd act better like a real display?
- Can I make the linux forget all about DISPLAY variables and windowmanager, and just unconditionally run the script as a normal user? How?
- Can I automate my login sequence in a smarter way that would avoid xdotool?
My network is private and I have no issue with solutions that can compromise the security on the raspberry, so disabling whatever xhost etc is fine, I just don't see how/what.
Thanks in advance.
Lars Kuur
(11 rep)
Nov 4, 2021, 10:44 PM
• Last activity: Nov 6, 2021, 04:15 PM
8
votes
3
answers
27117
views
Howto terminate xvfb-run properly
In order to perform some JavaScript unit tests with [karma][1] inside a docker container (based on ubuntu 14.04) I'm starting firefox in the container using a [karma-script-launcher][2] with `xvfb-run`. The start script looks like this: #!/bin/bash set -o errexit # nasty workaround as xvfb-run doesn...
In order to perform some JavaScript unit tests with karma inside a docker container (based on ubuntu 14.04) I'm starting firefox in the container using a karma-script-launcher with
xvfb-run
. The start script looks like this:
#!/bin/bash
set -o errexit
# nasty workaround as xvfb-run doesn't cleanup properly...
trap "pkill -f /usr/lib/firefox/firefox" EXIT
xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x16' firefox $1
Starting the browser and executing the unit tests works very well. After executing the tests karma terminates the spawned browser instance - in my case the script that launched firefox over xvfb-run.
In the above script you can see that I registered a trap
to kill the launched firefox on exit of my script. This works, but the script is not a very nice citizen as it terminates **all** instances of firefox that are currently running instead of just terminating the one instance that was launched by the script. I first tried to kill the xfvb-run
process but killing this process has no effect on the sub-process launched by the xvfb-run
script...
If I start firefox over xvfb-run
manually there is a bunch of spawned processes:
root@1d7a5988e521:/data# xvfb-run --auto-servernum --server-args='-screen 0, 1024x768x16' firefox &
[1] 348
root@1d7a5988e521:/data# ps ax
PID TTY STAT TIME COMMAND
1 ? Ss 0:00 bash
348 ? S 0:00 /bin/sh /usr/bin/xvfb-run --auto-servernum --server-args=-screen 0, 1024x768x16 firefox
360 ? S 0:00 Xvfb :99 -screen 0, 1024x768x16 -nolisten tcp -auth /tmp/xvfb-run.bgMEuq/Xauthority
361 ? Sl 0:00 /usr/lib/firefox/firefox
378 ? S 0:00 dbus-launch --autolaunch bcf665e095759bae9fc1929b57455cad --binary-syntax --close-stderr
379 ? Ss 0:00 //bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
388 ? S 0:00 /usr/lib/x86_64-linux-gnu/gconf/gconfd-2
414 ? R+ 0:00 ps ax
root@1d7a5988e521:/data#
If I now kill the xvfb-run
process (PID 348), only this process will be terminated, leaving the other processes running. If I kill the firefox process (PID 361) instead, the xvfb-run
script correctly terminates and kills the other processes as well. But from my script I only know the PID of the xvfb-run
process...
During my research I stumbled across this rather old bug report for xvfb-run
which still seems to be valid in spite of the bug's status beeing fixed back in 2012.
Is there any polite way to terminate the xvfb-run
process in order for the other processes to be cleaned up correctly?
---
I already asked this on Stack Overflow, but got no answer till now. Perhaps it's somewhat OT for Stack Overflow but better located here?!
dpr
(423 rep)
Jun 24, 2016, 09:23 AM
• Last activity: Nov 4, 2021, 08:03 PM
2
votes
2
answers
3234
views
Multiple monitors with xfreerdp and Xvfb
I am trying to start an X server with multiple screens on a single Xvfb like this: Xvfb :50 -screen 0 1792x1120x24 -screen 1 1792x1120x24 and start an RDP connection which will use those two screens: DISPLAY=:50; xfreerdp /w:1792 /h:1120 /monitors:0,1 /multimon /u:... /p... /v:... This doesn't work...
I am trying to start an X server with multiple screens on a single Xvfb like this:
Xvfb :50 -screen 0 1792x1120x24 -screen 1 1792x1120x24
and start an RDP connection which will use those two screens:
DISPLAY=:50; xfreerdp /w:1792 /h:1120 /monitors:0,1 /multimon /u:... /p... /v:...
This doesn't work like this, the xfreerdp process crashes. I've tried some combinations of
/span
and monitor numbers and /multimon:force
and nothing worked. When I'm trying the same with one monitor and one Xvfb screen it works. I also don't understand how do I set resolutions per screen/monitor in xfreerdp since I have just one of each /w and /h.
Also tried to xfreerdp /monitor-list
after starting Xvfb with one or two screens. After starting Xvfb with one screen, the monitor-list printed it correctly. But with two xvfb screens, the monitor-list printed nothing.
Thanks for any answers or even hints!
eagr
(141 rep)
Oct 3, 2021, 03:50 PM
• Last activity: Oct 5, 2021, 07:59 AM
1
votes
1
answers
589
views
Problem with XServer - _XSERVTransSocketUNIXAccept: accept() failed
I run a headless Manjaro server with Xhost and Xvfb (for a display) and after about 236 instances of a program running, the server starts lagging a lot and the error `_XSERVTransSocketUNIXAccept: accept() failed` is printed infinitely on the screen. Does anybody know of a fix for this? I've searched...
I run a headless Manjaro server with Xhost and Xvfb (for a display) and after about 236 instances of a program running, the server starts lagging a lot and the error
_XSERVTransSocketUNIXAccept: accept() failed
is printed infinitely on the screen. Does anybody know of a fix for this? I've searched the Internet for solutions, but I've come up empty. I've read in one forum post that it's because of «clients using lots of true-type fonts», but even if it is I have no idea what to do to fix it.
Bintr
(31 rep)
Sep 7, 2021, 04:35 PM
• Last activity: Sep 15, 2021, 06:59 PM
0
votes
0
answers
585
views
How to improve XVFB display quality
I am currently running chrome on AWS Linux servers with this [Puppeteer and XVFB setup](https://github.com/nsourov/Puppeteer-with-xvfb). I also built a little chrome extension that handles the recording with *MediaRecorder* and *chrome.tabCapture*. It's basically meant to spin up chrome on the serve...
I am currently running chrome on AWS Linux servers with this [Puppeteer and XVFB setup](https://github.com/nsourov/Puppeteer-with-xvfb) .
I also built a little chrome extension that handles the recording with *MediaRecorder* and *chrome.tabCapture*.
It's basically meant to spin up chrome on the server and record a video of a specific page. To get a virtual display on the server, I've had to use XVFB.
I just hit a little block on video quality. It doesn't get as clear enough even after increasing the bitrate as high as 11mbit/s. Screen resolution is 1920x1080. I'd appreciate some pointers/tips on how to improve the quality from the XVFB side.
PS: The typical server I'm running this on has 4 vCPUs and 16gb memory.
Olamilekan Ibrahim
(1 rep)
Aug 24, 2021, 10:08 AM
0
votes
1
answers
927
views
Mouse doesn't work on xvfb
I am on ubuntu 18.04 (sadly, because of external considerations - EC2). I run the following lines: ``` sudo /usr/bin/Xvfb :0 -ac -screen 0 1024x768x24 & /usr/local/bin/x11vnc -dp -noxdamage -geometry 1024x728 -ncache 10 -ncache_cr -viewpasswd remote_view_only_pass -passwd XXXXX -display :0 -forever...
I am on ubuntu 18.04 (sadly, because of external considerations - EC2).
I run the following lines:
sudo /usr/bin/Xvfb :0 -ac -screen 0 1024x768x24 &
/usr/local/bin/x11vnc -dp -noxdamage -geometry 1024x728 -ncache 10 -ncache_cr -viewpasswd remote_view_only_pass -passwd XXXXX -display :0 -forever -shared -logappend /var/log/x11vnc.log -bg -noipv6
(Xvfb seems to be version 1.19.6)
(x11vnc: 0.9.16 lastmod: 2019-01-05)
And I connect using VNC Viewer
.
Following that, I get a mouse that seems to move , but not click. But actually the mouse position in the log (notice the dp
) stays constant and it doesn't work.
cursor_position: set screen pos x=512 y=364
user2679290
(113 rep)
Aug 21, 2021, 09:01 PM
• Last activity: Aug 21, 2021, 09:26 PM
1
votes
1
answers
101
views
Google Chrome Extension not starting on cloned Linux Ubuntu 20.04 Virtual Machines
My own Google Chrome Extension should start when the Google Chrome browser is opened (via crontab xvfb-run), but it does not. The Extension is used via Developer mode and is not published in the Extension Store. It works fine on my Windows laptop and PC and also on a Linux Ubuntu 20.04 test virtual...
My own Google Chrome Extension should start when the Google Chrome browser is opened (via crontab xvfb-run), but it does not. The Extension is used via Developer mode and is not published in the Extension Store.
It works fine on my Windows laptop and PC and also on a Linux Ubuntu 20.04 test virtual machine (VM).
On 16 cloned Linux Ubuntu 20.04 VMs, where the Google Chrome browser is opened at exactly the same time, it does not work. I have realized that the Extension has identical IDs for the cloned VMs. On my laptop and PC I have different IDs. **Could this be the reason?**
I have also tried to run the Extension on a fresh VM, but it did not work and the Extension had the same ID like the Extensions on the 16 cloned VMs.
On my test VM it works with the command
xvfb-run
in a crontab and also with a remote GUI (XLaunch) with Putty.
ajust93
(11 rep)
Aug 22, 2020, 11:34 AM
• Last activity: Jun 21, 2021, 09:29 AM
15
votes
2
answers
2815
views
How to poll for Xvfb to be ready?
The [Travis CI documentation][1] says to run `sleep 3` after starting `xvfb` to "give [it] some time to start". I couldn't find any reference to this delay in the [`man` page][2]. Is this cargo cult programming? If not, how do I **poll** rather than sleep to *guarantee* it's available? [1]: https://...
The Travis CI documentation says to run
sleep 3
after starting xvfb
to "give [it] some time to start". I couldn't find any reference to this delay in the man
page . Is this cargo cult programming? If not, how do I **poll** rather than sleep to *guarantee* it's available?
l0b0
(53368 rep)
Sep 18, 2016, 05:12 PM
• Last activity: May 25, 2021, 04:57 PM
1
votes
0
answers
10390
views
Is X server running? xdpyinfo: unable to open display "" on Ubuntu 18.04 server
I'm attempting to start a program that requires rendering a window (Unity Game) on a remote server that doesn't have a display attached to it. I wouldn't want to use `ssh -X` to forward rendering commands to my local machine. I'm trying to run the program in headless mode but still making use of the...
I'm attempting to start a program that requires rendering a window (Unity Game) on a remote server that doesn't have a display attached to it. I wouldn't want to use
ssh -X
to forward rendering commands to my local machine. I'm trying to run the program in headless mode but still making use of the remote server's GPU, or use Xvfb
, but I cannot
get it to work.
In the first step of this process, I try to **determine whether X server is already running**.
Upon sshing into the remote server, I ran
echo $DISPLAY
and it returns empty string. I thought that this means the X server is not running ([reference](https://stackoverflow.com/questions/637005/how-to-check-if-x-server-is-running))
However, I encounter contradicting information:
* When running ps ax | grep X
, I get
2149 tty1 Sl+ 0:03 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/121/gdm/Xauthority -background none -noreset -keeptty -verbose 3
This means indeed X server is running (because of the Xorg executable). Running ps -C Xorg
also shows PID 2149 ([reference](https://unix.stackexchange.com/questions/122067/make-sure-x-server-isnt-already-running)) .
* Also, when I run Xvfb :0.0
, I get
$ Xvfb :0.0
_XSERVTransSocketUNIXCreateListener:
...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already
running
(EE)
Fatal server error:
(EE) Cannot establis
This again seems to indicate that an X server is already running on :0.0
.
However (again), when I run xdpyinfo
, the utility for displaying information about an X server, I get
$ xdpyinfo
xdpyinfo: unable to open display "".
and
$ xdpyinfo -display :0.0
No protocol specified
xdpyinfo: unable to open display ":0.0".
This seems to tell me again that the X server is not running.
What is going on? Is the X server running?
As you may be able to tell I'm a newbie to X-server related issues. Please feel free point out any problem with my steps above, and suggest ways to resolve this. Thanks! There's a lot to learn.
zkytony
(111 rep)
Apr 26, 2021, 12:05 PM
Showing page 1 of 20 total questions