raspberrypi4-64 (arm64) X-Server does not work

I’m trying to get X-Server functioning with raspberrypi4-64 image, it builds just fine but the screen is just black (or if I start more complicated software like Electron it shows garbled stuff), and I get this at the log:

[2020-2-2 01:08:54] [main] Draw call returned Invalid argument.  Expect corruption.

Here is the Dockerfile:

# Following does not work, it builds etc. but the image is garbled:
FROM balenalib/raspberrypi4-64:buster as runtime

# This works just fine when using raspberrypi3 image:
# FROM balenalib/raspberrypi3:buster as runtime

# -----------------------------------------------------------------------------
# X-server
FROM runtime as xserver
RUN install_packages xserver-xorg-core xinit 

# X command https://www.x.org/releases/X11R7.7/doc/man/man1/Xserver.1.xhtml
RUN printf '\
#!/bin/bash \n\
exec /usr/bin/X -s 0 dpms -nolisten tcp "$@"\
' > /etc/X11/xinit/xserverrc

# Test, with green xterm in the corner
RUN install_packages xterm
CMD ["startx", "-fa", "Monospace", "-bg", "green", "-fg", "black"]

Notice! The above example works just fine Raspberrypi 4 if I use raspberrypi3 image, but I don’t want to, for instance electron 7 is not built for armhf.

I use balena push local push.


I presume you chopped some things from the Dockerfile; it doesn’t seem to be well formed… could you provide the whole thing for clarity, obfuscate values if you need :+1:

@richbayliss It is well formed? That is exactly what I tried. Do you have an error somewhere?

Here is the output

It’s short, because that is the minimal required to show the error. It works just fine when you uncomment # FROM balenalib/raspberrypi3:buster as runtime but it doesn’t work with raspberrypi4-64 image.

Sorry, I misread it - your FROM... blocks threw me with the runtime, xserver naming… nevermind.

I’ll see if I can reproduce :+1:

1 Like

I guess my example is a bit confusing, it’s easier to test with these:

# This works, and shows the green xterm in the corner as expected:
FROM balenalib/raspberrypi3:buster
RUN install_packages xserver-xorg-core xinit xterm
CMD ["startx", "-bg", "green"]

However with raspberrypi4-64 same doesn’t work, it shows just a black screen:

# This shows just the black screen
FROM balenalib/raspberrypi4-64:buster
RUN install_packages xserver-xorg-core xinit xterm
CMD ["startx", "-bg", "green"]

I can confirm the same behaviour. Not really sure what to suggest though, sorry. I’ll see if any of our team have any ideas :+1:

1 Like

Okay thanks for looking at this. Best support!

It looks like the X-server is not functional in raspberrypi4-64 images, there are other reports that instructs to just use raspberrypi3 images instead.

Is there a bug report I could follow?

Not yet that I can see. I created one here and linked it to the thread :+1:

1 Like

Hi, can you try to run https://github.com/balena-io-playground/x11-window-manager and see if that works for you please?

@floion of course I can make it to work, because it uses the raspberrypi3 image. But it doesn’t work with raspberrypi4-64 base image, which is the main issue here.

Besides the packages are outdated in that repo. I think my minimal repro is easier for someone to debug.


We are able to reproduce the issue on our end and will let you know when it’s fixed