alpine container launch multiple X servers without network isolation

140 views
Skip to first unread message

Tueur Volvo

unread,
Jul 5, 2021, 4:05:20 AM7/5/21
to Singularity Community Edition
Hello ! I have a physical machine with Manjaro and gnome.
 I would like to launch an Alpine linux singularity container with a graphical server inside (X11 or wayland) and connect to it in vnc.

The problem is that each time I get errors because it sees that an X server is already running. I don't want to do network isolation, so I would like to be able to run an X server in parallel.
Thank you in advance for your help.


my definition file:

From: alpine:latest
Stage: build

%post
    echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
    echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories
    echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
    apk update && apk upgrade
    apk add firefox
    apk add icewm
    apk add x11vnc
    apk add xvfb


my script to run xserver:
export DISPLAY=:99.0
Xvfb :201 -screen 0 640x480x24 &
x11vnc -rfbport 5666 &
firefox

David Trudgian

unread,
Jul 13, 2021, 7:00:41 PM7/13/21
to Singularity Community Edition
Hi,

If you want to run an X server and connect to it via VNC I would advice just using a `vncserver` implementation (e.g. tigervnc-server), or call Xvnc directly. That will start a virtual X server and expose it with VNC more simply.

From your script I'm not entirely sure what you are trying to do. It looks as if you are trying to run Xvfb on a display :201 ... but then when running x11vnc you are pointing it to `DISPLAY :99.0` via the env var?

I'm guessing you might want `Xvfb :201` and then `x11vnc -display :201` if you really need to split the X server and VNC server.

DT
Reply all
Reply to author
Forward
0 new messages