# chromium-kiosk 2 contiainers, working on RPI4 not on RPI3B+

**URL:** <https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932>\
**Category:** Product support\
**Tags:** x11\
**Created:** [February 20, 2020, 10:27pm UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932 "2020-02-20T22:27:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylvain42](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sylvain42](https://forums.balena.io/u/Sylvain42)\
**Post date:** [February 20, 2020, 10:27pm UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932/1 "2020-02-20T22:27:48Z")

</div>

Hi,

We try to setup a two container, communicating with a websocket, between chromium and a websocket server in Qt5.

It works, based on this project: [https://github.com/jayatvars/balena-chromium-kiosk](https://github.com/jayatvars/balena-chromium-kiosk)

Here is our code :

> **[balena / workshop](https://gitlab.obj8.ovh/balena/workshop)**
>
> code for the workshop

This code is working on raspberrypi 4 but not on RPI3B+

Here’s the log related to Xserver failing, any idea?

```auto
20.02.20 23:03:58 (+0100) <qtapp> Echoserver listening on port 1234
20.02.20 23:04:06 (+0100) <chromium-kiosk> xinit: giving up
20.02.20 23:04:06 (+0100) <chromium-kiosk> xinit: unable to connect to X server: Cannot assign requested address
20.02.20 23:04:06 (+0100) <chromium-kiosk> xinit: server error
20.02.20 23:04:06 (+0100) <chromium-kiosk> xauth: (argv):1: bad display name "bk-rpi-531582a:0" in "remove" command
20.02.20 23:04:06 (+0100) <chromium-kiosk> useradd: user 'chromium' already exists
20.02.20 23:04:06 (+0100) <chromium-kiosk> hostname: No address associated with hostname
20.02.20 23:04:07 (+0100) <chromium-kiosk> xauth: (stdin):1: bad display name "bk-rpi-531582a:0" in "add" command
20.02.20 23:04:07 (+0100) <chromium-kiosk> 
20.02.20 23:04:07 (+0100) <chromium-kiosk> 
20.02.20 23:04:07 (+0100) <chromium-kiosk> X.Org X Server 1.20.4
20.02.20 23:04:07 (+0100) <chromium-kiosk> X Protocol Version 11, Revision 0
20.02.20 23:04:07 (+0100) <chromium-kiosk> Build Operating System: Linux 4.15.0-48-generic armv8l Raspbian
20.02.20 23:04:07 (+0100) <chromium-kiosk> Current Operating System: Linux bk-rpi-531582a 4.19.71 #1 SMP PREEMPT Fri Jan 31 09:53:40 UTC 2020 aarch64
20.02.20 23:04:07 (+0100) <chromium-kiosk> Kernel command line: coherent_pool=1M 8250.nr_uarts=1 cma=256M video=HDMI-A-1:1920x1080@60 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 rootfstype=ext4 rootwait root=PARTUUID=564dc7a5-02 rootwait
20.02.20 23:04:07 (+0100) <chromium-kiosk> Build Date: 05 June 2019 12:49:54PM
20.02.20 23:04:07 (+0100) <chromium-kiosk> xorg-server 2:1.20.4-1+rpt1 (https://www.debian.org/support) 
20.02.20 23:04:07 (+0100) <chromium-kiosk> Current version of pixman: 0.36.0
20.02.20 23:04:07 (+0100) <chromium-kiosk> Before reporting problems, check http://wiki.x.org
20.02.20 23:04:07 (+0100) <chromium-kiosk> to make sure that you have the latest version.
20.02.20 23:04:07 (+0100) <chromium-kiosk> Markers: (--) probed, (**) from config file, (==) default setting,
20.02.20 23:04:07 (+0100) <chromium-kiosk> (++) from command line, (!!) notice, (II) informational,
20.02.20 23:04:07 (+0100) <chromium-kiosk> (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
20.02.20 23:04:07 (+0100) <chromium-kiosk> (==) Log file: "/home/chromium/.local/share/xorg/Xorg.0.log", Time: Thu Feb 20 22:04:07 2020
20.02.20 23:04:07 (+0100) <chromium-kiosk> (==) Using system config directory "/usr/share/X11/xorg.conf.d"
20.02.20 23:04:07 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:07 (+0100) <chromium-kiosk> Fatal server error:
20.02.20 23:04:07 (+0100) <chromium-kiosk> (EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
20.02.20 23:04:07 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:07 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:07 (+0100) <chromium-kiosk> Please consult the The X.Org Foundation support 
20.02.20 23:04:07 (+0100) <chromium-kiosk> at http://wiki.x.org
20.02.20 23:04:07 (+0100) <chromium-kiosk> for help. 
20.02.20 23:04:07 (+0100) <chromium-kiosk> (EE) Please also check the log file at "/home/chromium/.local/share/xorg/Xorg.0.log" for additional information.
20.02.20 23:04:07 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:07 (+0100) <chromium-kiosk> (EE) Server terminated with error (1). Closing log file.
20.02.20 23:04:22 (+0100) <chromium-kiosk> xinit: giving up
20.02.20 23:04:22 (+0100) <chromium-kiosk> xinit: unable to connect to X server: Cannot assign requested address
20.02.20 23:04:22 (+0100) <chromium-kiosk> xinit: server error
20.02.20 23:04:22 (+0100) <chromium-kiosk> xauth: (argv):1: bad display name "bk-rpi-531582a:0" in "remove" command
20.02.20 23:04:22 (+0100) <chromium-kiosk> useradd: user 'chromium' already exists
20.02.20 23:04:22 (+0100) <chromium-kiosk> hostname: No address associated with hostname
20.02.20 23:04:22 (+0100) <chromium-kiosk> xauth: (stdin):1: bad display name "bk-rpi-531582a:0" in "add" command
20.02.20 23:04:22 (+0100) <chromium-kiosk> 
20.02.20 23:04:22 (+0100) <chromium-kiosk> 
20.02.20 23:04:22 (+0100) <chromium-kiosk> X.Org X Server 1.20.4
20.02.20 23:04:22 (+0100) <chromium-kiosk> X Protocol Version 11, Revision 0
20.02.20 23:04:22 (+0100) <chromium-kiosk> Build Operating System: Linux 4.15.0-48-generic armv8l Raspbian
20.02.20 23:04:22 (+0100) <chromium-kiosk> Current Operating System: Linux bk-rpi-531582a 4.19.71 #1 SMP PREEMPT Fri Jan 31 09:53:40 UTC 2020 aarch64
20.02.20 23:04:22 (+0100) <chromium-kiosk> Kernel command line: coherent_pool=1M 8250.nr_uarts=1 cma=256M video=HDMI-A-1:1920x1080@60 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 rootfstype=ext4 rootwait root=PARTUUID=564dc7a5-02 rootwait
20.02.20 23:04:22 (+0100) <chromium-kiosk> Build Date: 05 June 2019 12:49:54PM
20.02.20 23:04:22 (+0100) <chromium-kiosk> xorg-server 2:1.20.4-1+rpt1 (https://www.debian.org/support) 
20.02.20 23:04:22 (+0100) <chromium-kiosk> Current version of pixman: 0.36.0
20.02.20 23:04:22 (+0100) <chromium-kiosk> Before reporting problems, check http://wiki.x.org
20.02.20 23:04:22 (+0100) <chromium-kiosk> to make sure that you have the latest version.
20.02.20 23:04:22 (+0100) <chromium-kiosk> Markers: (--) probed, (**) from config file, (==) default setting,
20.02.20 23:04:22 (+0100) <chromium-kiosk> (++) from command line, (!!) notice, (II) informational,
20.02.20 23:04:22 (+0100) <chromium-kiosk> (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
20.02.20 23:04:22 (+0100) <chromium-kiosk> (==) Log file: "/home/chromium/.local/share/xorg/Xorg.0.log", Time: Thu Feb 20 22:04:22 2020
20.02.20 23:04:22 (+0100) <chromium-kiosk> (==) Using system config directory "/usr/share/X11/xorg.conf.d"
20.02.20 23:04:22 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:22 (+0100) <chromium-kiosk> Fatal server error:
20.02.20 23:04:22 (+0100) <chromium-kiosk> (EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
20.02.20 23:04:22 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:22 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:22 (+0100) <chromium-kiosk> Please consult the The X.Org Foundation support 
20.02.20 23:04:22 (+0100) <chromium-kiosk> at http://wiki.x.org
20.02.20 23:04:22 (+0100) <chromium-kiosk> for help. 
20.02.20 23:04:22 (+0100) <chromium-kiosk> (EE) Please also check the log file at "/home/chromium/.local/share/xorg/Xorg.0.log" for additional information.
20.02.20 23:04:22 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:22 (+0100) <chromium-kiosk> (EE) Server terminated with error (1). Closing log file.
20.02.20 23:04:37 (+0100) <chromium-kiosk> xinit: giving up
20.02.20 23:04:37 (+0100) <chromium-kiosk> xinit: unable to connect to X server: Cannot assign requested address
20.02.20 23:04:37 (+0100) <chromium-kiosk> xinit: server error
20.02.20 23:04:37 (+0100) <chromium-kiosk> xauth: (argv):1: bad display name "bk-rpi-531582a:0" in "remove" command
20.02.20 23:04:38 (+0100) <chromium-kiosk> useradd: user 'chromium' already exists
20.02.20 23:04:38 (+0100) <chromium-kiosk> hostname: No address associated with hostname
20.02.20 23:04:38 (+0100) <chromium-kiosk> xauth: (stdin):1: bad display name "bk-rpi-531582a:0" in "add" command
20.02.20 23:04:38 (+0100) <chromium-kiosk> 
20.02.20 23:04:38 (+0100) <chromium-kiosk> 
20.02.20 23:04:38 (+0100) <chromium-kiosk> X.Org X Server 1.20.4
20.02.20 23:04:38 (+0100) <chromium-kiosk> X Protocol Version 11, Revision 0
20.02.20 23:04:38 (+0100) <chromium-kiosk> Build Operating System: Linux 4.15.0-48-generic armv8l Raspbian
20.02.20 23:04:38 (+0100) <chromium-kiosk> Current Operating System: Linux bk-rpi-531582a 4.19.71 #1 SMP PREEMPT Fri Jan 31 09:53:40 UTC 2020 aarch64
20.02.20 23:04:38 (+0100) <chromium-kiosk> Kernel command line: coherent_pool=1M 8250.nr_uarts=1 cma=256M video=HDMI-A-1:1920x1080@60 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 rootfstype=ext4 rootwait root=PARTUUID=564dc7a5-02 rootwait
20.02.20 23:04:38 (+0100) <chromium-kiosk> Build Date: 05 June 2019 12:49:54PM
20.02.20 23:04:38 (+0100) <chromium-kiosk> xorg-server 2:1.20.4-1+rpt1 (https://www.debian.org/support) 
20.02.20 23:04:38 (+0100) <chromium-kiosk> Current version of pixman: 0.36.0
20.02.20 23:04:38 (+0100) <chromium-kiosk> Before reporting problems, check http://wiki.x.org
20.02.20 23:04:38 (+0100) <chromium-kiosk> to make sure that you have the latest version.
20.02.20 23:04:38 (+0100) <chromium-kiosk> Markers: (--) probed, (**) from config file, (==) default setting,
20.02.20 23:04:38 (+0100) <chromium-kiosk> (++) from command line, (!!) notice, (II) informational,
20.02.20 23:04:38 (+0100) <chromium-kiosk> (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
20.02.20 23:04:38 (+0100) <chromium-kiosk> (==) Log file: "/home/chromium/.local/share/xorg/Xorg.0.log", Time: Thu Feb 20 22:04:38 2020
20.02.20 23:04:38 (+0100) <chromium-kiosk> (==) Using system config directory "/usr/share/X11/xorg.conf.d"
20.02.20 23:04:38 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:38 (+0100) <chromium-kiosk> Fatal server error:
20.02.20 23:04:38 (+0100) <chromium-kiosk> (EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
20.02.20 23:04:38 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:38 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:38 (+0100) <chromium-kiosk> Please consult the The X.Org Foundation support 
20.02.20 23:04:38 (+0100) <chromium-kiosk> at http://wiki.x.org
20.02.20 23:04:38 (+0100) <chromium-kiosk> for help. 
20.02.20 23:04:38 (+0100) <chromium-kiosk> (EE) Please also check the log file at "/home/chromium/.local/share/xorg/Xorg.0.log" for additional information.
20.02.20 23:04:38 (+0100) <chromium-kiosk> (EE) 
20.02.20 23:04:38 (+0100) <chromium-kiosk> (EE) Server terminated with error (1). Closing log file.
20.02.20 23:04:47 (+0100) Killing service 'chromium-kiosk sha256:78353f41feb6ad4c13af22cd9a2f62e78e9f4c7301762c58c75401291bb5a6b7'
20.02.20 23:04:47 (+0100) <chromium-kiosk> 
20.02.20 23:04:47 (+0100) <chromium-kiosk> Session terminated, killing shell...xinit: giving up
20.02.20 23:04:47 (+0100) <chromium-kiosk> xinit: unable to connect to X server: Cannot assign requested address
20.02.20 23:04:47 (+0100) <chromium-kiosk> xinit: unexpected signal 15
20.02.20 23:04:47 (+0100) <chromium-kiosk> ...killed.

```

Regards,  
Sylvain.

---

<div class="post-metadata">

**Author:** ![\_Page](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/_page/32/22_2.png) [@\_Page](https://forums.balena.io/u/_Page)\
**Post date:** [February 20, 2020, 11:28pm UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932/2 "2020-02-20T23:28:48Z")

</div>

Hey, you can try adding

```auto
rm /tmp/.X0-lock &>/dev/null || true

```

to your entry script which will remove any lock files that might be left around when your container is started. Also I’ve used

```auto
export DISPLAY=:0
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket
startx

```

myself when starting up an x server, along with

```auto
    labels:
      io.balena.features.dbus: '1'

```

in my docker-compose.yml in order to have that `/host/run/dbus/system_bus_socket` available, and with those combined I was able to fix errors that looked the same/very similar to that

---

<div class="post-metadata">

**Author:** ![Sylvain42](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sylvain42](https://forums.balena.io/u/Sylvain42)\
**Post date:** [February 21, 2020, 7:29am UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932/3 "2020-02-21T07:29:18Z")

</div>

Hi @_Page,

Thanks replying. I tried your suggestion without success.  
Same error.

I’m a beginner with docker and I’m not sure where to put the `label:`. So I may be wrong. Your [suggested changes](https://gitlab.obj8.ovh/balena/workshop/commit/e0dea8bf4787825dce9b2da1aedea1626488800c).

As you may know:

`rm /tmp/.X0-lock &>/dev/null || true` is at the top of [start.sh](https://gitlab.obj8.ovh/balena/workshop/blob/_Page/chromium-kiosk/app/start.sh#L6)

I added it anyway in `entry.sh` too.  
No success.

So, I’ve check the error message on search engine:

`xf86OpenConsole: Cannot open virtual console 2`

and found a work around from this quotation:

> <https://gist.github.com/alepez/6273dc5220c1c5ec5f3f126e739d58bf>

It worked.

I’m not at all versed in X11 config and arcane, but it seems a permission problem on tty, despite the fact `chromium` user have been added to `tty` group.

Here is my working [commited changes](https://gitlab.obj8.ovh/balena/workshop/commit/2fd7c1bd1d23a9fab59e55b9444593242917b594)

I think it’s a dirty fix, because some commands are for running chromium with the user `chromium` and it may bypass that all.

To be continued.  
Regards,  
Sylvain.

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [February 21, 2020, 4:06pm UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932/4 "2020-02-21T16:06:12Z")

</div>

Hello,  
There are some issues in your [Dockerfile.template](https://gitlab.obj8.ovh/balena/workshop/blob/e0dea8bf4787825dce9b2da1aedea1626488800c/chromium-kiosk/Dockerfile.template):

- the purpose of a `Dockerfile.template` is to work on different kinds of devices, the first line should be `FROM balenalib/%%BALENA_MACHINE_NAME%%`. It is fine to not use this feature, if you don’t plan on using it, you could name this file `Dockerfile`;
- `ENV INITSYSTEM on` is not supported on `balenalib` images and will have no effect: [https://www.balena.io/docs/reference/base-images/base-images/#major-changes](https://www.balena.io/docs/reference/base-images/base-images/#major-changes) ;
- because of the above, the whole `systemctl` commands are pointless, same thing for the `.service` files;
- there is 2 `CMD` lines, I’m not sure which one Docker will pick up;
- the only xorg debian packages you shoould need are `xserver-xorg` and `xinit`;

Also, some things you do in `start.sh` would be better done in the `Dockerfile.template`:

- `useradd`;
- setting env vars;
- creating /home/chromium/xstart.sh

I’d recommend:

- creating the chromium user in the Dockerfile;
- setting `USER chromium` in the Dockerfile;
- creating and using `/home/chromium/.xserverrc` and `/home/chromium/.xinitrc` files for starting the X server and chromium respectively. Your container `CMD` should be `xinit` with no options. Please check `man xinit`.

`/home/chromium/.xserverrc` should look like:

```auto
#!/bin/sh

rm -f /tmp/.X0-lock
exec /usr/bin/X -nolisten tcp "$@"

```

`/home/chromium/.xinitrc` should look like:

```auto
#!/bin/sh

xrandr -o $XRANDR_ROTATION
# move stuff from xstart.sh here

```

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [February 21, 2020, 4:08pm UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932/5 "2020-02-21T16:08:09Z")

</div>

Also for creating `.xinitrc` and `.xserverrc`, it would be easier to create regular files in you repository and `ADD` them in your `Dockerfile.template` instead of using `echo` and redirections.

---

<div class="post-metadata">

**Author:** ![Sylvain42](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sylvain42](https://forums.balena.io/u/Sylvain42)\
**Post date:** [February 22, 2020, 7:24am UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932/7 "2020-02-22T07:24:33Z")

</div>

Hi @zvin,

Thanks a lot, its bunch of changes to test. 😄 (for my current knowledge)

As mentioned, this test is based on another work on setting up a chromium-kiosk container. Most of the changes you mention are directly from the original work. Which in turn is also based on some other work.

I will try to implement most of your suggestions. Or you may have another Kiosk code more close to the objective?

I need at the end to have a production ready kiosk.

Regards,  
Sylvain.

---

<div class="post-metadata">

**Author:** ![anujdeshpande](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/anujdeshpande/32/3155_2.png) [@anujdeshpande](https://forums.balena.io/u/anujdeshpande)\
**Post date:** [February 24, 2020, 9:51am UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932/9 "2020-02-24T09:51:00Z")

</div>

Hi  
You can also try this repo that one of my colleagues is working on here - [https://github.com/balena-io-playground/chromium-ha](https://github.com/balena-io-playground/chromium-ha)  
It has hardware acceleration tested on RPi 3, RPi3B+ and RPi 4.

---

<div class="post-metadata">

**Author:** ![Sylvain42](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sylvain42](https://forums.balena.io/u/Sylvain42)\
**Post date:** [February 25, 2020, 6:06am UTC](https://forums.balena.io/t/chromium-kiosk-2-contiainers-working-on-rpi4-not-on-rpi3b/64932/11 "2020-02-25T06:06:33Z")

</div>

Hi @anujdeshpande,

This one worked at first try.  
I see that the line I added is there too.

> <https://github.com/balena-io-playground/chromium-ha/blob/master/kiosk/start.sh#L7>

Oh, I also see that the URL switcher [Tohora](https://github.com/mozz100/tohora) is installed too. Interesting.

I need to play with to link all thing together.  
I will comeback, when it’ll be ready.  
Thanks.  
Regards,  
Sylvain.
