0

I've followed this thread

to build a docker container to run on Raspberry pi. I've managed to run it on a normal centos, but on pi I always get this error (I always run in mobaxterm application on windows 10 because it has x11 support):

Unable to init server: broadway display type not supported 'machinename:0'
Error: cannot open display: machinename:0

I've tried to build it with 2 different dockerfile, the 1st:

FROM    resin/rpi-raspbian:latest
# Make sure the package repository is up to date
RUN     apt-get update && apt-get install -y firefox-esr

USER root
ENV HOME /root
CMD /usr/bin/firefox

And tried to run it with this script:

#!/usr/bin/env bash

CONTAINER=firefox_wo_vnc
COMMAND=/bin/bash
DISPLAY="machinename:0"
USER=$(whoami)


docker run -ti --rm \
   -e DISPLAY \
   -v "/c/Users/$USER:/home/$USER:rw" \
   $CONTAINER
   $COMMAND

and I got the error :(

The 2nd that I've tried:

# Firefox over VNC
#
# VERSION               0.1
# DOCKER-VERSION        0.2

FROM    resin/rpi-raspbian:latest
RUN     apt-get update

# Install vnc, xvfb in order to create a 'fake' display and firefox
RUN     apt-get install -y x11vnc xvfb firefox-esr
RUN     mkdir ~/.vnc
# Setup a password
RUN     x11vnc -storepasswd 1234 ~/.vnc/passwd
# Autostart firefox (might not be the best way to do it, but it does the trick)
RUN     bash -c 'echo "firefox" >> /.bashrc'

And tried to run:

#!/usr/bin/env bash

CONTAINER=firefoxvnc
COMMAND=/bin/bash
DISPLAY="machinename:0"
USER=$(whoami)

docker run \
    -it \
    --rm \
    --user=$USER \
    --workdir="/home/$USER" \
    -v "/c/Users/$USER:/home/$USER:rw" \
    -e DISPLAY \
    $CONTAINER \
    $COMMAND

This way I can login via VNC but firefox is not running and I can't see actually anything just an empty desktop.

I've read many thread, I've installed xorg, openbox, x11 apps ...

Badb0y
  • 331
  • 2
  • 21

0 Answers0