Member-only story

Accessing X Apps from Container

Zhimin Wen
2 min readOct 2, 2020

--

I am troubleshooting some legacy Java web start UI applications. As the Java web start is no longer shipped with the latest JRE, I will not waste time to install it locally on my laptop and later remove it, instead, I will run it from a known container image that has the java web start binary still there.

If run the java web start in a container, then I also need an XWindow environment locally on my Macbook. Hmmm, not preferred. What I really want to do is to minimize any installation on my Macbook.

So Let’s run the X window environment inside the container, expose it through x11vnc, and access it from the Macbook using VNC Viewer.

First let's build Java web start together with the X windows app in the container.

FROM ibmjava:8-jre
RUN apt update && \
DEBIAN_FRONTEND="noninteractive" apt-get -y install xvfb x11vnc xterm fluxbox
CMD Xvfb -screen 0 1600x1200x24 -ac & \
DISPLAY=:0 startfluxbox & \
x11vnc -display :0 & \
while true; do sleep 120; done

On top of the base jre image, install the virtual x display server xvfb, the x11vnc server, and the lightweight window manager fluxbox.

Then launch the virtual display, start the fluxbox window manager, and run the x11vnc with the display :0. These apps will be all running in the…

--

--

No responses yet