nathan never
nathan never

Reputation: 11

Firefox in kiosk mode shows black screen with terminal

I'm trying to set up a Docker container with VNC to show only Firefox in kiosk mode. When I connect to the VNC server, I see a black screen with a terminal instead of Firefox. I have no idea if it is necessary to have DISPLAY=:1 startxfce4

enter image description here

Here's my Dockerfile:

FROM ubuntu:latest

# Install dependencies
RUN apt-get update && apt-get install -y \
    x11vnc \
    xvfb \
    websockify \
    supervisor \
    xfce4 \
    xfce4-terminal \
    dbus-x11 \
    x11-xserver-utils \
    sudo \
    wget \
    tightvncserver \
    novnc

.....

#VNC
RUN mkdir -p ~/.vnc && echo "password" | vncpasswd -f > ~/.vnc/passwd && chmod 600 ~/.vnc/passwd

#supervisor config
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

#ports
EXPOSE 5900 5000

#supervisor
CMD ["/usr/bin/supervisord"]

And here is my supervisord.conf because Firefox runs in a virtual display environment

[supervisord]
nodaemon=true

[program:xvfb]
command=/usr/bin/Xvfb :1 -screen 0 1280x800x24
autorestart=true
stdout_logfile=/var/log/xvfb.log
stderr_logfile=/var/log/xvfb_err.log

[program:x11vnc]
command=/usr/bin/x11vnc -display :1 -forever -usepw -create
autorestart=true
stdout_logfile=/var/log/x11vnc.log
stderr_logfile=/var/log/x11vnc_err.log

[program:websockify]
command=/usr/bin/websockify --web=/usr/share/novnc/ 5000 localhost:5900
autorestart=true
stdout_logfile=/var/log/websockify.log
stderr_logfile=/var/log/websockify_err.log

[program:firefox]
command=bash -c "sleep 5; DISPLAY=:1 firefox --no-remote --new-instance"
autorestart=true
stdout_logfile=/var/log/firefox.log
stderr_logfile=/var/log/firefox_err.log

any idea to solve ?

Upvotes: 0

Views: 197

Answers (0)

Related Questions