diff --git a/images/vnc/Dockerfile.ubuntu b/images/vnc/Dockerfile.ubuntu index 45d7cc6..f5c45ed 100644 --- a/images/vnc/Dockerfile.ubuntu +++ b/images/vnc/Dockerfile.ubuntu @@ -4,6 +4,9 @@ USER 0 ARG DEBCONF_NONINTERACTIVE_SEEN=true ARG DEBIAN_FRONTEND="noninteractive" +ARG TURBOVNC_VERSION=2.2.5 +ARG VIRTUALGL_VERSION=2.6.4 +ARG LIBJPEG_VERSION=2.0.5 RUN echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \ echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections @@ -14,9 +17,6 @@ RUN apt-get update && apt-get install -y \ zsh \ supervisor \ xorg \ - tigervnc-standalone-server \ - tigervnc-xorg-extension \ - tigervnc-viewer \ ssh \ xfce4 \ xfce4-goodies \ @@ -24,7 +24,18 @@ RUN apt-get update && apt-get install -y \ xterm \ python-numpy \ firefox \ - fonts-lyx + fonts-lyx \ + libxtst6 \ + libxv1 \ + libglu1-mesa \ + libc6-dev \ + libglu1 \ + libsm6 \ + libxv1 \ + x11-xkb-utils \ + xauth \ + xfonts-base \ + xkb-data # Install quality of life packages. RUN yes | unminimize @@ -45,6 +56,26 @@ RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd ARG HOME=/home/coder ARG VNC_ROOT_DIR=/opt/vnc +RUN cd /tmp \ + && curl -fsSL -O https://svwh.dl.sourceforge.net/project/turbovnc/${TURBOVNC_VERSION}/turbovnc_${TURBOVNC_VERSION}_amd64.deb \ + -O https://svwh.dl.sourceforge.net/project/libjpeg-turbo/${LIBJPEG_VERSION}/libjpeg-turbo-official_${LIBJPEG_VERSION}_amd64.deb \ + -O https://svwh.dl.sourceforge.net/project/virtualgl/${VIRTUALGL_VERSION}/virtualgl_${VIRTUALGL_VERSION}_amd64.deb \ + && dpkg -i *.deb \ + && rm -f /tmp/*.deb \ + && sed -i 's/$host:/unix:/g' /opt/TurboVNC/bin/vncserver + +RUN ln -s /opt/TurboVNC/bin/* /opt/VirtualGL/bin/* /usr/local/bin/ +# Configure VGL for use in a single user environment. +# This may trigger a warning about display managers needing to be restarted. +# This can be ignored as the VNC server manages this lifecycle. +RUN vglserver_config -config +s +f +t + +RUN echo 'no-remote-connections\n\ +no-httpd\n\ +no-x11-tcp-connections\n\ +no-pam-sessions\n\ +' > /etc/turbovncserver-security.conf + ENV VNC_SCRIPTS=$VNC_ROOT_DIR/scripts \ VNC_SETUP_SCRIPTS=$VNC_ROOT_DIR/setup \ VNC_LOG_DIR=$HOME/.vnc/log \ diff --git a/images/vnc/supervisor/conf.d/tigervnc.conf b/images/vnc/supervisor/conf.d/vncserver.conf similarity index 52% rename from images/vnc/supervisor/conf.d/tigervnc.conf rename to images/vnc/supervisor/conf.d/vncserver.conf index 9473d86..82ee355 100644 --- a/images/vnc/supervisor/conf.d/tigervnc.conf +++ b/images/vnc/supervisor/conf.d/vncserver.conf @@ -1,5 +1,5 @@ -[program:tigervnc] -command=/opt/vnc/scripts/tigervnc.sh +[program:vncserver] +command=/opt/vnc/scripts/vncserver.sh autorestart=true stopasgroup=true killasgroup=true diff --git a/images/vnc/vnc/scripts/tigervnc.sh b/images/vnc/vnc/scripts/vncserver.sh similarity index 77% rename from images/vnc/vnc/scripts/tigervnc.sh rename to images/vnc/vnc/scripts/vncserver.sh index 7d63fe1..56cbe96 100644 --- a/images/vnc/vnc/scripts/tigervnc.sh +++ b/images/vnc/vnc/scripts/vncserver.sh @@ -6,21 +6,15 @@ mkdir -p $VNC_LOG_DIR if [[ -v VNC_DISPLAY_ID ]]; then echo "Removing previous VNC locks..." - vncserver -kill "$VNC_DISPLAY_ID" &> "$VNC_LOG_DIR/vnc_startup.log" - rm -rfv /tmp/.X90-lock /tmp/.X11-unix &> "$VNC_LOG_DIR/vnc_startup.log" + vncserver -kill "$VNC_DISPLAY_ID" &> "$VNC_LOG_DIR/vnc_startup.log" || true + rm -rfv /tmp/.X90-lock /tmp/.X11-unix &> "$VNC_LOG_DIR/vnc_startup.log" || true fi echo -e "Starting vncserver with param: VNC_COL_DEPTH=$VNC_COL_DEPTH, VNC_RESOLUTION=$VNC_RESOLUTION\n..." exec vncserver "$VNC_DISPLAY_ID" \ - -cleanstale \ -SecurityTypes None \ - -AlwaysShared \ - -AcceptKeyEvents \ - -AcceptPointerEvents \ - -AcceptSetDesktopSize \ - -SendCutText \ - -AcceptCutText \ + -alwaysshared \ -depth "$VNC_COL_DEPTH" \ -geometry "$VNC_RESOLUTION" \ -fg \