From 331600410a4d412616a1fda754c71e0f70d45248 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 08:38:36 -0400 Subject: [PATCH 01/56] feat:add virutalgl for hardware accelrated opengl --- Dockerfile | 72 +++++++++++++++++++++++++++--------------------- supervisord.conf | 21 +++++--------- 2 files changed, 48 insertions(+), 45 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9d9bdf1..71efbb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,41 @@ -# Get and install Easy noVNC. -FROM golang:1.14-buster AS easy-novnc-build -WORKDIR /src -RUN go mod init build && \ - go get github.com/geek1011/easy-novnc@v1.1.0 && \ - go build -o /bin/easy-novnc github.com/geek1011/easy-novnc +ARG UBUNTU_VERSION=22.04 -# Get TigerVNC and Supervisor for isolating the container. -FROM debian:buster -RUN apt-get update -y && \ - apt-get install -y --no-install-recommends openbox tigervnc-standalone-server supervisor gosu && \ - rm -rf /var/lib/apt/lists && \ +FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu${UBUNTU_VERSION} +LABEL authors="Joshua J. Damanik" + +ARG VIRTUALGL_VERSION=3.1 +ARG TURBOVNC_VERSION=3.1 +ENV DEBIAN_FRONTEND noninteractive + +# Install some basic dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + xorg \ + xauth \ + gosu supervisor x11-xserver-utils \ + libegl1-mesa \ + libgl1-mesa-glx \ + openbox \ + locales-all \ + xterm \ + novnc \ + lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ + freeglut3 libgtk2.0-dev libwxgtk3.0-gtk3-dev libwx-perl libxmu-dev libgl1-mesa-glx libgl1-mesa-dri \ + xdg-utils locales locales-all pcmanfm jq curl git bzip2 firefox \ + && rm -rf /var/lib/apt/lists/*a \ mkdir -p /usr/share/desktop-directories -# Get all of the remaining dependencies for the OS, VNC, and Prusaslicer. -RUN apt-get update -y && \ - apt-get install -y --no-install-recommends lxterminal nano wget openssh-client rsync ca-certificates xdg-utils htop tar xzip gzip bzip2 zip unzip && \ - rm -rf /var/lib/apt/lists -RUN apt update && apt install -y --no-install-recommends --allow-unauthenticated \ - lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ - freeglut3 libgtk2.0-dev libwxgtk3.0-gtk3-dev libwx-perl libxmu-dev libgl1-mesa-glx libgl1-mesa-dri \ - xdg-utils locales locales-all pcmanfm jq curl git firefox-esr \ - && apt autoclean -y \ - && apt autoremove -y \ - && rm -rf /var/lib/apt/lists/* +# Install virtualgl and turbovnc +RUN wget -qO /tmp/virtualgl_${VIRTUALGL_VERSION}_amd64.deb https://sourceforge.net/projects/virtualgl/files/${VIRTUALGL_VERSION}/virtualgl_${VIRTUALGL_VERSION}_amd64.deb/download \ + && wget -qO /tmp/turbovnc_${TURBOVNC_VERSION}_amd64.deb https://sourceforge.net/projects/turbovnc/files/${TURBOVNC_VERSION}/turbovnc_${TURBOVNC_VERSION}_amd64.deb/download \ + && dpkg -i /tmp/virtualgl_${VIRTUALGL_VERSION}_amd64.deb \ + && dpkg -i /tmp/turbovnc_${TURBOVNC_VERSION}_amd64.deb \ + && rm -rf /tmp/*.deb +# Install prusaslicer -# Install Prusaslicer -# Many of the commands below were derived and pulled from previous work by dmagyar on GitHub. -# Here's their Dockerfile for reference https://github.com/dmagyar/prusaslicer-vnc-docker/blob/main/Dockerfile.amd64 WORKDIR /slic3r ADD get_latest_prusaslicer_release.sh /slic3r - RUN chmod +x /slic3r/get_latest_prusaslicer_release.sh \ && latestSlic3r=$(/slic3r/get_latest_prusaslicer_release.sh url) \ && slic3rReleaseName=$(/slic3r/get_latest_prusaslicer_release.sh name) \ @@ -52,12 +57,16 @@ RUN chmod +x /slic3r/get_latest_prusaslicer_release.sh \ && mkdir -p /configs/.config/ \ && ln -s /configs/.config/ /home/slic3r/ \ && mkdir -p /home/slic3r/.config/ \ - # We can now set the Download directory for Firefox and other browsers. - # We can also add /prints/ to the file explorer bookmarks for easy access. && echo "XDG_DOWNLOAD_DIR=\"/prints/\"" >> /home/slic3r/.config/user-dirs.dirs \ && echo "file:///prints prints" >> /home/slic3r/.gtk-bookmarks -COPY --from=easy-novnc-build /bin/easy-novnc /usr/local/bin/ + +# Generate key for novnc +RUN openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/novnc.pem -out /etc/novnc.pem -days 365 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" + +ENV PATH ${PATH}:/opt/VirtualGL/bin:/opt/TurboVNC/bin + +COPY entrypoint.sh /entrypoint.sh COPY menu.xml /etc/xdg/openbox/ COPY supervisord.conf /etc/ @@ -70,5 +79,6 @@ EXPOSE 5900 VOLUME /configs/ VOLUME /prints/ -# It's time! Let's get to work! We use /configs/ as a bindable volume for Prusaslicers configurations. We use /prints/ to provide a location for STLs and GCODE files. -CMD ["bash", "-c", "chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord"] \ No newline at end of file +ENTRYPOINT ["/entrypoint.sh"] +CMD ["bash", "-c", "chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord"] +# CMD ["/bin/bash"] diff --git a/supervisord.conf b/supervisord.conf index 5aa188c..a4fba64 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -2,28 +2,21 @@ nodaemon=true pidfile=/tmp/supervisord.pid -[program:x11] +[program:vnc] priority=0 -command=/usr/bin/Xtigervnc -desktop "Prusaslicer" -rfbport 5900 -SecurityTypes None -AlwaysShared -AcceptKeyEvents -AcceptPointerEvents -AcceptSetDesktopSize -SendCutText -AcceptCutText :0 +command=/opt/TurboVNC/bin/vncserver :1 -fg -securitytypes TLSNone,X509None,None -depth 24 -geometry 1920x1080 autorestart=true redirect_stderr=true -[program:easy-novnc] +[program:novnc] priority=0 -command=/usr/local/bin/easy-novnc --addr :8080 --host localhost --port 5900 --no-url-password --novnc-params "resize=remote" -autorestart=true -redirect_stderr=true - -[program:openbox] -priority=1 -command=/usr/bin/openbox -environment=DISPLAY=:0 +command=websockify --web=/usr/share/novnc/ 8080 localhost:5901 autorestart=true redirect_stderr=true [program:prusaslicer] priority=1 -environment=DISPLAY=:0 -command=/bin/bash -c '/slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/' +environment=DISPLAY=:1 +command=/bin/bash -c 'vglrun /slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/' autorestart=true -redirect_stderr=true \ No newline at end of file +redirect_stderr=true From 7601bf2e51325b5faf864400a068e05124ced98f Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 08:59:41 -0400 Subject: [PATCH 02/56] fix: typo and add docker-compose Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 5 +++-- docker-compose.yml | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 71efbb1..d957950 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ freeglut3 libgtk2.0-dev libwxgtk3.0-gtk3-dev libwx-perl libxmu-dev libgl1-mesa-glx libgl1-mesa-dri \ xdg-utils locales locales-all pcmanfm jq curl git bzip2 firefox \ - && rm -rf /var/lib/apt/lists/*a \ + && apt autoclean -y \ + && apt autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ mkdir -p /usr/share/desktop-directories @@ -81,4 +83,3 @@ VOLUME /prints/ ENTRYPOINT ["/entrypoint.sh"] CMD ["bash", "-c", "chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord"] -# CMD ["/bin/bash"] diff --git a/docker-compose.yml b/docker-compose.yml index 01c14ca..e15e191 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,12 +5,13 @@ services: image: mikeah/prusaslicer-novnc container_name: prusaslicer-novnc environment: - - SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt" - #- NVIDIA_DRIVER_CAPABILITIES="all" - #- NVIDIA_VISIBLE_DEVICES="all" + - SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt + - NVIDIA_VISIBLE_DEVICES=0 + - NVIDIA_DRIVER_CAPABILITIES=all + - DISPLAY=:1 + - VNC_RESOLUTION=1900x1080 volumes: - ./prints:/prints/ - ./data:/configs/ - ports: - - 8080:8080 + network_mode: host restart: unless-stopped From 34dc5d38189981c491e5f4621c724a89189823b7 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:12:07 -0400 Subject: [PATCH 03/56] fix: more typos Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d957950..0712d11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,11 +21,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ novnc \ lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ freeglut3 libgtk2.0-dev libwxgtk3.0-gtk3-dev libwx-perl libxmu-dev libgl1-mesa-glx libgl1-mesa-dri \ - xdg-utils locales locales-all pcmanfm jq curl git bzip2 firefox \ + xdg-utils locales locales-all pcmanfm jq curl git bzip2 \ && apt autoclean -y \ && apt autoremove -y \ && rm -rf /var/lib/apt/lists/* \ - mkdir -p /usr/share/desktop-directories + && mkdir -p /usr/share/desktop-directories # Install virtualgl and turbovnc From e462e22c62079400321f0b3492abfefc4aef4e46 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:27:07 -0400 Subject: [PATCH 04/56] fix: convert all environment variables to supervosord Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 20 ++++++++++++++++++++ supervisord.conf | 6 +++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100755 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..a505961 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/bash -x +set -e +rm -f /tmp/.X*-lock +rm -f /tmp/.X11-unix/X* +DISPLAY=${DISPLAY:-:10} +DISPLAY_NUMBER=$(echo $DISPLAY | cut -d: -f2) +export NOVNC_PORT=${NOVNC_PORT:-8080} +VNC_RESOLUTION=${VNC_RESOLUTION:-1280x800} +if [ -n "$VNC_PASSWORD" ]; then + mkdir -p /root/.vnc + echo "$VNC_PASSWORD" | vncpasswd -f > /root/.vnc/passwd + chmod 0600 /root/.vnc/passwd +fi +# vncserver "$DISPLAY" -securitytypes TLSNone,X509None,None -depth 24 -geometry "$VNC_RESOLUTION" +# websockify -D --web=/usr/share/novnc/ "$NOVNC_PORT" localhost:$((5900 + DISPLAY_NUMBER)) +# echo "NoVNC server started on port $NOVNC_PORT" +# EXEC=$@ +# exec "$@" +export VGLRUN=vglrun +chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord # -e TRACE diff --git a/supervisord.conf b/supervisord.conf index a4fba64..b5ac496 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -4,19 +4,19 @@ pidfile=/tmp/supervisord.pid [program:vnc] priority=0 -command=/opt/TurboVNC/bin/vncserver :1 -fg -securitytypes TLSNone,X509None,None -depth 24 -geometry 1920x1080 +command=/opt/TurboVNC/bin/vncserver %(ENV_DISPLAY)s -fg -securitytypes TLSNone,X509None,None -depth 24 -geometry %(ENV_VNC_RESOLUTION)s autorestart=true redirect_stderr=true [program:novnc] priority=0 -command=websockify --web=/usr/share/novnc/ 8080 localhost:5901 +command=websockify --web=/usr/share/novnc/ %(ENV_NOVNC_PORT)s localhost:5901 autorestart=true redirect_stderr=true [program:prusaslicer] priority=1 environment=DISPLAY=:1 -command=/bin/bash -c 'vglrun /slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/' +command=/bin/bash -c '%(ENV_VGLRUN)s /slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/' autorestart=true redirect_stderr=true From e0cf9a48184b561640b66cc774fb4269e1e77378 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:28:21 -0400 Subject: [PATCH 05/56] fix: last remaining poperty Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- supervisord.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisord.conf b/supervisord.conf index b5ac496..498fbd5 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -16,7 +16,7 @@ redirect_stderr=true [program:prusaslicer] priority=1 -environment=DISPLAY=:1 +environment=DISPLAY=%(ENV_DISPLAY)s command=/bin/bash -c '%(ENV_VGLRUN)s /slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/' autorestart=true redirect_stderr=true From 6653680cd7f6e70c94cecad48a7f089a482c3144 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:30:59 -0400 Subject: [PATCH 06/56] fix: few more vars Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 1 + supervisord.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a505961..4c70052 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,5 +16,6 @@ fi # echo "NoVNC server started on port $NOVNC_PORT" # EXEC=$@ # exec "$@" +export LOCALFBPORT=$((5900 + DISPLAY_NUMBER)) export VGLRUN=vglrun chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord # -e TRACE diff --git a/supervisord.conf b/supervisord.conf index 498fbd5..1695d56 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -10,7 +10,7 @@ redirect_stderr=true [program:novnc] priority=0 -command=websockify --web=/usr/share/novnc/ %(ENV_NOVNC_PORT)s localhost:5901 +command=websockify --web=/usr/share/novnc/ %(ENV_NOVNC_PORT)s localhost:%(ENV_LOCALFBPORT)s autorestart=true redirect_stderr=true From 7fde29ba73653d875b97779b806d5bbdc6746eb7 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:36:34 -0400 Subject: [PATCH 07/56] fix: add support for no security and full password sec. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 8 +++----- supervisord.conf | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 4c70052..1625315 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,12 +10,10 @@ if [ -n "$VNC_PASSWORD" ]; then mkdir -p /root/.vnc echo "$VNC_PASSWORD" | vncpasswd -f > /root/.vnc/passwd chmod 0600 /root/.vnc/passwd + export VNC_SEC= +else + export VNC_SEC="-securitytypes TLSNone,X509None,None" fi -# vncserver "$DISPLAY" -securitytypes TLSNone,X509None,None -depth 24 -geometry "$VNC_RESOLUTION" -# websockify -D --web=/usr/share/novnc/ "$NOVNC_PORT" localhost:$((5900 + DISPLAY_NUMBER)) -# echo "NoVNC server started on port $NOVNC_PORT" -# EXEC=$@ -# exec "$@" export LOCALFBPORT=$((5900 + DISPLAY_NUMBER)) export VGLRUN=vglrun chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord # -e TRACE diff --git a/supervisord.conf b/supervisord.conf index 1695d56..1193783 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -4,7 +4,7 @@ pidfile=/tmp/supervisord.pid [program:vnc] priority=0 -command=/opt/TurboVNC/bin/vncserver %(ENV_DISPLAY)s -fg -securitytypes TLSNone,X509None,None -depth 24 -geometry %(ENV_VNC_RESOLUTION)s +command=/opt/TurboVNC/bin/vncserver %(ENV_DISPLAY)s -fg %(ENV_VNC_SEC)s -depth 24 -geometry %(ENV_VNC_RESOLUTION)s autorestart=true redirect_stderr=true From f1011cba681c4e0f96cad2b1f18eacea20fcfae3 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:39:49 -0400 Subject: [PATCH 08/56] fix: remove ports an some comments. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 11 ++++++----- entrypoint.sh | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0712d11..b60b698 100644 --- a/Dockerfile +++ b/Dockerfile @@ -72,14 +72,15 @@ COPY entrypoint.sh /entrypoint.sh COPY menu.xml /etc/xdg/openbox/ COPY supervisord.conf /etc/ -# HTTP Port -EXPOSE 8080 -# VNC Port -EXPOSE 5900 +# Needs to be ran with HOST networking so this are no longer needed. +# # HTTP Port +# EXPOSE 8080 + +# # VNC Port +# EXPOSE 5900 VOLUME /configs/ VOLUME /prints/ ENTRYPOINT ["/entrypoint.sh"] -CMD ["bash", "-c", "chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord"] diff --git a/entrypoint.sh b/entrypoint.sh index 1625315..9d38154 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,5 +15,7 @@ else export VNC_SEC="-securitytypes TLSNone,X509None,None" fi export LOCALFBPORT=$((5900 + DISPLAY_NUMBER)) -export VGLRUN=vglrun +export VGLRUN=/usr/bin/vglrun + +# fix perms and launch supervisor with the above environment variables chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord # -e TRACE From c9162328b6c2f3a0210343192413f13fef959705 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:47:44 -0400 Subject: [PATCH 09/56] fix: forgot menu to be launched with vglrun Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu.xml b/menu.xml index 644d9d2..4f30f66 100644 --- a/menu.xml +++ b/menu.xml @@ -3,7 +3,7 @@ - /slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/ + /usr/bin/vglrun /slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/ From c227cee231f0fe30dc3f6b9f5e4478cd264dbf6c Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:50:17 -0400 Subject: [PATCH 10/56] fix: add attribution Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index b60b698..6c626ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +# ORIGINAL REPO https://github.com/damanikjosh/virtualgl-turbovnc-docker/blob/main/Dockerfile ARG UBUNTU_VERSION=22.04 FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu${UBUNTU_VERSION} From 102998c6a31e277039f357fc4d9bc416fa40a47e Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:50:43 -0400 Subject: [PATCH 11/56] fix: add authors Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6c626ef..b8523d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG UBUNTU_VERSION=22.04 FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu${UBUNTU_VERSION} -LABEL authors="Joshua J. Damanik" +LABEL authors="Joshua J. Damanik, vajonam" ARG VIRTUALGL_VERSION=3.1 ARG TURBOVNC_VERSION=3.1 From a31637c25df61f10d36d6a2d8740f6e15f5016fb Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:04:19 -0400 Subject: [PATCH 12/56] fix: drop firebox for now Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- menu.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/menu.xml b/menu.xml index 4f30f66..b5f5e41 100644 --- a/menu.xml +++ b/menu.xml @@ -16,11 +16,6 @@ /usr/bin/pcmanfm - - - /usr/bin/firefox - - /usr/bin/x-terminal-emulator -e htop From 92165ffa63d189aab6b46a679d5b07947cad1d7d Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:16:40 -0400 Subject: [PATCH 13/56] fix: remove some files to get rid of `No session for PID` popup Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index b8523d4..733fc22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,9 @@ COPY entrypoint.sh /entrypoint.sh COPY menu.xml /etc/xdg/openbox/ COPY supervisord.conf /etc/ +# get rid of errors https://github.com/meefik/linuxdeploy/issues/978#issuecomment-541551743 +RUN rm /etc/xdg/autostart/lxpolkit.desktop +RUN mv /usr/bin/lxpolkit /usr/bin/lxpolkit.ORIG # Needs to be ran with HOST networking so this are no longer needed. # # HTTP Port From c89d7003e4e1866f3eaf3b49044ecc48bf4fef91 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:27:16 -0400 Subject: [PATCH 14/56] fix: formatting Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 733fc22..a9644d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,8 +35,8 @@ RUN wget -qO /tmp/virtualgl_${VIRTUALGL_VERSION}_amd64.deb https://sourceforge.n && dpkg -i /tmp/virtualgl_${VIRTUALGL_VERSION}_amd64.deb \ && dpkg -i /tmp/turbovnc_${TURBOVNC_VERSION}_amd64.deb \ && rm -rf /tmp/*.deb -# Install prusaslicer +# Install prusaslicer WORKDIR /slic3r ADD get_latest_prusaslicer_release.sh /slic3r RUN chmod +x /slic3r/get_latest_prusaslicer_release.sh \ From 407e64c6e28ca24023d469f378c69769f442384e Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:36:06 -0400 Subject: [PATCH 15/56] fix: clean up layers add exec on get_ Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 16 ++++++++-------- get_latest_prusaslicer_release.sh | 0 2 files changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 get_latest_prusaslicer_release.sh diff --git a/Dockerfile b/Dockerfile index a9644d9..9c50138 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,18 +64,18 @@ RUN chmod +x /slic3r/get_latest_prusaslicer_release.sh \ && echo "file:///prints prints" >> /home/slic3r/.gtk-bookmarks -# Generate key for novnc -RUN openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/novnc.pem -out /etc/novnc.pem -days 365 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" +# Generate key for novnc and cleanup erros +RUN openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/novnc.pem -out /etc/novnc.pem -days 365 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" \ + && rm /etc/xdg/autostart/lxpolkit.desktop \ + && mv /usr/bin/lxpolkit /usr/bin/lxpolkit.ORIG ENV PATH ${PATH}:/opt/VirtualGL/bin:/opt/TurboVNC/bin -COPY entrypoint.sh /entrypoint.sh -COPY menu.xml /etc/xdg/openbox/ -COPY supervisord.conf /etc/ +ADD entrypoint.sh /entrypoint.sh +ADD menu.xml /etc/xdg/openbox/ +ADD supervisord.conf /etc/ + -# get rid of errors https://github.com/meefik/linuxdeploy/issues/978#issuecomment-541551743 -RUN rm /etc/xdg/autostart/lxpolkit.desktop -RUN mv /usr/bin/lxpolkit /usr/bin/lxpolkit.ORIG # Needs to be ran with HOST networking so this are no longer needed. # # HTTP Port diff --git a/get_latest_prusaslicer_release.sh b/get_latest_prusaslicer_release.sh old mode 100644 new mode 100755 From 6790299952daba585ddc2916c7527474b3489086 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:37:59 -0400 Subject: [PATCH 16/56] fix: update docs. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 8 -------- docker-compose.yml | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9c50138..0b9ddb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,14 +76,6 @@ ADD menu.xml /etc/xdg/openbox/ ADD supervisord.conf /etc/ - -# Needs to be ran with HOST networking so this are no longer needed. -# # HTTP Port -# EXPOSE 8080 - -# # VNC Port -# EXPOSE 5900 - VOLUME /configs/ VOLUME /prints/ diff --git a/docker-compose.yml b/docker-compose.yml index e15e191..1fa06f5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,5 +13,5 @@ services: volumes: - ./prints:/prints/ - ./data:/configs/ - network_mode: host + network_mode: host # THIS IS NEEDED FOR VIRTUALGL IMPORTANT restart: unless-stopped From 31adb031fa45bcb3ec9ba061b99c7d49ea15390b Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:41:49 -0400 Subject: [PATCH 17/56] docs: add explanation Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- docker-compose.yml | 2 +- entrypoint.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1fa06f5..45042be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,5 +13,5 @@ services: volumes: - ./prints:/prints/ - ./data:/configs/ - network_mode: host # THIS IS NEEDED FOR VIRTUALGL IMPORTANT + network_mode: host # THIS IS NEEDED FOR VIRTUALGL IMPORTANT, haven'tt figured out how to remove this yet restart: unless-stopped diff --git a/entrypoint.sh b/entrypoint.sh index 9d38154..0cf66e7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,6 +5,7 @@ rm -f /tmp/.X11-unix/X* DISPLAY=${DISPLAY:-:10} DISPLAY_NUMBER=$(echo $DISPLAY | cut -d: -f2) export NOVNC_PORT=${NOVNC_PORT:-8080} +export VNC_PORT=${VNC_PORT:-5900} VNC_RESOLUTION=${VNC_RESOLUTION:-1280x800} if [ -n "$VNC_PASSWORD" ]; then mkdir -p /root/.vnc @@ -14,7 +15,7 @@ if [ -n "$VNC_PASSWORD" ]; then else export VNC_SEC="-securitytypes TLSNone,X509None,None" fi -export LOCALFBPORT=$((5900 + DISPLAY_NUMBER)) +export LOCALFBPORT=$((${VNC_PORT} + DISPLAY_NUMBER)) export VGLRUN=/usr/bin/vglrun # fix perms and launch supervisor with the above environment variables From 717f1cd63a7551b4687ae2ee1e178a246ebdfa6e Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:42:15 -0400 Subject: [PATCH 18/56] docs: change res Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 45042be..ec05be7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: - NVIDIA_VISIBLE_DEVICES=0 - NVIDIA_DRIVER_CAPABILITIES=all - DISPLAY=:1 - - VNC_RESOLUTION=1900x1080 + - VNC_RESOLUTION=1920x1080 volumes: - ./prints:/prints/ - ./data:/configs/ From 4ffcbe600fb48e2f22ad874825328c61f3b6ed79 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:53:43 -0400 Subject: [PATCH 19/56] fix: remove debugging Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0cf66e7..427eee6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash set -e rm -f /tmp/.X*-lock rm -f /tmp/.X11-unix/X* From a22e77433030412a57a60c70544e68ff89a076f2 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:09:43 -0400 Subject: [PATCH 20/56] fix: no longer need X, or host mode! yay! can use VGL_DISPLAY=egl and it works! Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ec05be7..7203627 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,9 +9,9 @@ services: - NVIDIA_VISIBLE_DEVICES=0 - NVIDIA_DRIVER_CAPABILITIES=all - DISPLAY=:1 + - VGL_DISPLAY=egl # needed to run without X server - VNC_RESOLUTION=1920x1080 volumes: - ./prints:/prints/ - ./data:/configs/ - network_mode: host # THIS IS NEEDED FOR VIRTUALGL IMPORTANT, haven'tt figured out how to remove this yet restart: unless-stopped From 331d2031985bd29d96ea35e19982765230d4389c Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 13:09:07 -0400 Subject: [PATCH 21/56] fix: update to latest version and associated deps. and setup VGLRUN Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 11 ++++++----- entrypoint.sh | 4 ++-- supervisord.conf | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b9ddb8..cc43ce8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,11 @@ ARG UBUNTU_VERSION=22.04 FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu${UBUNTU_VERSION} LABEL authors="Joshua J. Damanik, vajonam" -ARG VIRTUALGL_VERSION=3.1 -ARG TURBOVNC_VERSION=3.1 +ARG VIRTUALGL_VERSION=3.1.1-20240228 +ARG TURBOVNC_VERSION=3.1.1-20240127 ENV DEBIAN_FRONTEND noninteractive +RUN # Install some basic dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ wget \ @@ -17,7 +18,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libegl1-mesa \ libgl1-mesa-glx \ openbox \ - locales-all \ + locales-all libpam0g libxt6 libxext6 dbus-x11 xauth x11-xkb-utils xkb-data, python3\ xterm \ novnc \ lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ @@ -30,8 +31,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install virtualgl and turbovnc -RUN wget -qO /tmp/virtualgl_${VIRTUALGL_VERSION}_amd64.deb https://sourceforge.net/projects/virtualgl/files/${VIRTUALGL_VERSION}/virtualgl_${VIRTUALGL_VERSION}_amd64.deb/download \ - && wget -qO /tmp/turbovnc_${TURBOVNC_VERSION}_amd64.deb https://sourceforge.net/projects/turbovnc/files/${TURBOVNC_VERSION}/turbovnc_${TURBOVNC_VERSION}_amd64.deb/download \ +RUN wget -qO /tmp/virtualgl_${VIRTUALGL_VERSION}_amd64.deb https://packagecloud.io/dcommander/virtualgl/packages/any/any/virtualgl_${VIRTUALGL_VERSION}_amd64.deb/download.deb?distro_version_id=35\ + && wget -qO /tmp/turbovnc_${TURBOVNC_VERSION}_amd64.deb https://packagecloud.io/dcommander/turbovnc/packages/any/any/turbovnc_${TURBOVNC_VERSION}_amd64.deb/download.deb?distro_version_id=35 \ && dpkg -i /tmp/virtualgl_${VIRTUALGL_VERSION}_amd64.deb \ && dpkg -i /tmp/turbovnc_${TURBOVNC_VERSION}_amd64.deb \ && rm -rf /tmp/*.deb diff --git a/entrypoint.sh b/entrypoint.sh index 427eee6..e3d95ed 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,7 +16,7 @@ else export VNC_SEC="-securitytypes TLSNone,X509None,None" fi export LOCALFBPORT=$((${VNC_PORT} + DISPLAY_NUMBER)) -export VGLRUN=/usr/bin/vglrun +export VGLRUN="${VGLRUN:-/usr/bin/vglrun}" # fix perms and launch supervisor with the above environment variables -chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord # -e TRACE +chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord -e TRACE diff --git a/supervisord.conf b/supervisord.conf index 1193783..e42ce73 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -16,7 +16,7 @@ redirect_stderr=true [program:prusaslicer] priority=1 -environment=DISPLAY=%(ENV_DISPLAY)s +environment=VGL_DISPLAY=%(ENV_VGL_DISPLAY)s command=/bin/bash -c '%(ENV_VGLRUN)s /slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/' autorestart=true redirect_stderr=true From ad38b1988c0e83f7d90d2d06404962944ef48654 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 13:12:14 -0400 Subject: [PATCH 22/56] fix: remove trace Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index e3d95ed..df64741 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,4 +19,4 @@ export LOCALFBPORT=$((${VNC_PORT} + DISPLAY_NUMBER)) export VGLRUN="${VGLRUN:-/usr/bin/vglrun}" # fix perms and launch supervisor with the above environment variables -chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord -e TRACE +chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord # -e TRACE From af8995588fb1aa27cc8ca5eb38f51c1c10c78423 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 13:18:19 -0400 Subject: [PATCH 23/56] fix: add log level environment variable Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 2 +- docker-compose.yml | 1 + entrypoint.sh | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc43ce8..6a191a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libegl1-mesa \ libgl1-mesa-glx \ openbox \ - locales-all libpam0g libxt6 libxext6 dbus-x11 xauth x11-xkb-utils xkb-data, python3\ + locales-all libpam0g libxt6 libxext6 dbus-x11 xauth x11-xkb-utils xkb-data python3\ xterm \ novnc \ lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ diff --git a/docker-compose.yml b/docker-compose.yml index 7203627..160b193 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: - NVIDIA_DRIVER_CAPABILITIES=all - DISPLAY=:1 - VGL_DISPLAY=egl # needed to run without X server + - SUPD_LOGLEVEL=INFO - VNC_RESOLUTION=1920x1080 volumes: - ./prints:/prints/ diff --git a/entrypoint.sh b/entrypoint.sh index df64741..c949a7f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,6 +17,6 @@ else fi export LOCALFBPORT=$((${VNC_PORT} + DISPLAY_NUMBER)) export VGLRUN="${VGLRUN:-/usr/bin/vglrun}" - +export SUPD_LOGLEVEL="${SUPD_LOGLEVEL:-TRACE}" # fix perms and launch supervisor with the above environment variables -chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord # -e TRACE +chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord -e $SUPD_LOGLEVEL From 3bda20a00e55e7939941e203e2f17769532fc327 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 13:19:11 -0400 Subject: [PATCH 24/56] fix: add VGL_DISPLAY param: Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index c949a7f..61bdf0a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,5 +18,7 @@ fi export LOCALFBPORT=$((${VNC_PORT} + DISPLAY_NUMBER)) export VGLRUN="${VGLRUN:-/usr/bin/vglrun}" export SUPD_LOGLEVEL="${SUPD_LOGLEVEL:-TRACE}" +export VGL_DISPLAY="${VGL_DISPLAY:-egl}" + # fix perms and launch supervisor with the above environment variables chown -R slic3r:slic3r /home/slic3r/ /configs/ /prints/ /dev/stdout && exec gosu slic3r supervisord -e $SUPD_LOGLEVEL From f616fbd8741f551d8de27a1ff65901d684d41fb0 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:08:20 -0400 Subject: [PATCH 25/56] fix: default display to 0 Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 61bdf0a..f69ba5f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,7 @@ set -e rm -f /tmp/.X*-lock rm -f /tmp/.X11-unix/X* -DISPLAY=${DISPLAY:-:10} +export DISPLAY=${DISPLAY:-:0} DISPLAY_NUMBER=$(echo $DISPLAY | cut -d: -f2) export NOVNC_PORT=${NOVNC_PORT:-8080} export VNC_PORT=${VNC_PORT:-5900} From 2747747d37001e973efd789bf1c52910e1580d51 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:28:42 -0400 Subject: [PATCH 26/56] feat: test moving to GTK3. Looks much more modern Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- get_latest_prusaslicer_release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/get_latest_prusaslicer_release.sh b/get_latest_prusaslicer_release.sh index 99abfab..5f6389d 100755 --- a/get_latest_prusaslicer_release.sh +++ b/get_latest_prusaslicer_release.sh @@ -4,8 +4,8 @@ TMPDIR="$(mktemp -d)" curl -SsL https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest > $TMPDIR/latest.json -url=$(jq -r '.assets[] | select(.browser_download_url|test("linux-x64-(?!GTK3).+.tar.bz2$"))| .browser_download_url' $TMPDIR/latest.json) -name=$(jq -r '.assets[] | select(.browser_download_url|test("linux-x64-(?!GTK3).+.tar.bz2$"))| .name' $TMPDIR/latest.json) +url=$(jq -r '.assets[] | select(.browser_download_url|test("linux-x64-(?!GTK2).+.tar.bz2$"))| .browser_download_url' $TMPDIR/latest.json) +name=$(jq -r '.assets[] | select(.browser_download_url|test("linux-x64-(?!GTK2).+.tar.bz2$"))| .name' $TMPDIR/latest.json) version=$(jq -r .tag_name $TMPDIR/latest.json) if [ $# -ne 1 ]; then From d9acfb9ae4cf1ba1fa6d273de33e3e4e0b40909d Mon Sep 17 00:00:00 2001 From: Mike Helfrich Date: Wed, 3 Apr 2024 17:39:02 -0400 Subject: [PATCH 27/56] Convert to LF files and add export on VNC_RESOLUTION --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f69ba5f..8f57aa0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,7 +6,7 @@ export DISPLAY=${DISPLAY:-:0} DISPLAY_NUMBER=$(echo $DISPLAY | cut -d: -f2) export NOVNC_PORT=${NOVNC_PORT:-8080} export VNC_PORT=${VNC_PORT:-5900} -VNC_RESOLUTION=${VNC_RESOLUTION:-1280x800} +export VNC_RESOLUTION=${VNC_RESOLUTION:-1280x800} if [ -n "$VNC_PASSWORD" ]; then mkdir -p /root/.vnc echo "$VNC_PASSWORD" | vncpasswd -f > /root/.vnc/passwd From 6009c62d89e2f4a71aa09afd309b09070e7fa218 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Wed, 3 Apr 2024 21:07:10 -0400 Subject: [PATCH 28/56] add vnc_resolution Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index f69ba5f..8f57aa0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,7 +6,7 @@ export DISPLAY=${DISPLAY:-:0} DISPLAY_NUMBER=$(echo $DISPLAY | cut -d: -f2) export NOVNC_PORT=${NOVNC_PORT:-8080} export VNC_PORT=${VNC_PORT:-5900} -VNC_RESOLUTION=${VNC_RESOLUTION:-1280x800} +export VNC_RESOLUTION=${VNC_RESOLUTION:-1280x800} if [ -n "$VNC_PASSWORD" ]; then mkdir -p /root/.vnc echo "$VNC_PASSWORD" | vncpasswd -f > /root/.vnc/passwd From 30aa433c05f0d61ece514981e460a821a27d73e6 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:02:43 -0400 Subject: [PATCH 29/56] fix: add env varitable to enable/disable hw accel for 3d. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8f57aa0..d43430e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x set -e rm -f /tmp/.X*-lock rm -f /tmp/.X11-unix/X* @@ -16,7 +16,12 @@ else export VNC_SEC="-securitytypes TLSNone,X509None,None" fi export LOCALFBPORT=$((${VNC_PORT} + DISPLAY_NUMBER)) -export VGLRUN="${VGLRUN:-/usr/bin/vglrun}" +if [ -n "$ENABLEHWGPU" ] && [ "$ENABLEHWGPU" = "true" ]; then + export VGLRUN="/usr/bin/vglrun" +else + export VGLRUN= +fi + export SUPD_LOGLEVEL="${SUPD_LOGLEVEL:-TRACE}" export VGL_DISPLAY="${VGL_DISPLAY:-egl}" From b3602e7460d283427fd7d447ac104b381602326b Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:12:49 -0400 Subject: [PATCH 30/56] fix: update docs and example compose Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 17 ++++++++++++++++- docker-compose.yml | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 80b2af8..c8afa33 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,22 @@ To use a VNC viewer with the container, the default port for X TigerVNC is 5900. Like other Docker containers, you can pass your Nvidia GPU into the container using the `NVIDIA_VISIBLE_DEVICES` and `NVIDIA_DRIVER_CAPABILITIES` envs. You can define these using the value of `all` or by providing more narrow and specific values. This has only been tested on Nvidia GPUs. -In unraid you can set these values during set up. For containers outside of unraid, you can set this by adding the following params or similar `-e NVIDIA_DRIVER_CAPABILITIES="all" NVIDIA_VISIBLE_DEVICES="all"`. If using Docker Compose, uncomment the enviroment variables in the relevant docker-compose.yaml file. +In unraid you can set these values during set up. For containers outside of unraid, you can set this by adding the following params or similar `-e NVIDIA_DRIVER_CAPABILITIES="all" NVIDIA_VISIBLE_DEVICES="all"`. If using Docker Compose, uncomment the enviroment variables in the relevant docker-compose.yaml file. + +In addtion to the above, to enable HW 3D acceleration (helps with complex models and visualizing the sliced layers), you must pass ane environment variable by adding a `-e ENABLEHWGPU=true` to the docker run command or adding `- ENABLEHWGPU=true` to your docker compose. + +### Other Environment Variables + +Default values shown below. + +- `DISPLAY=:0` sets the DISPLAY variable, this can be left as 0 +- `VGL_DISPLAY=egl` needed for HW 3D accelration with EGL support on the HOST graphics driver. +- `SUPD_LOGLEVEL=INFO` log level for supervisord +- `ENABLEHWGPU=true` enable HW 3D Accelaration +- `VNC_RESOLUTION=1280x800` resolution of the VNC server +- `VNC_PASSWORD=(None)` defaults to no VNC password, you can add one here. +- `NOVNC_PORT=8080` port for the novonc HTML5/web interface. +- `VNC_PORT=5900` port fo the vnc server, allows direct connections using a VNC client. Note the `DISPLAY` number above is added to the port number, so if your display is :1 then VNC port accepting connections will be `5901` ## Links diff --git a/docker-compose.yml b/docker-compose.yml index 160b193..659c6e1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,9 +8,10 @@ services: - SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt - NVIDIA_VISIBLE_DEVICES=0 - NVIDIA_DRIVER_CAPABILITIES=all - - DISPLAY=:1 + - DISPLAY=:0 - VGL_DISPLAY=egl # needed to run without X server - SUPD_LOGLEVEL=INFO + - ENABLEHWGPU=true - VNC_RESOLUTION=1920x1080 volumes: - ./prints:/prints/ From 327e67df864fcb7da8cdec5d51128825d9df3adc Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:15:43 -0400 Subject: [PATCH 31/56] fix: typos and AI fixed Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c8afa33..1bc610d 100644 --- a/README.md +++ b/README.md @@ -36,21 +36,20 @@ Like other Docker containers, you can pass your Nvidia GPU into the container us In unraid you can set these values during set up. For containers outside of unraid, you can set this by adding the following params or similar `-e NVIDIA_DRIVER_CAPABILITIES="all" NVIDIA_VISIBLE_DEVICES="all"`. If using Docker Compose, uncomment the enviroment variables in the relevant docker-compose.yaml file. -In addtion to the above, to enable HW 3D acceleration (helps with complex models and visualizing the sliced layers), you must pass ane environment variable by adding a `-e ENABLEHWGPU=true` to the docker run command or adding `- ENABLEHWGPU=true` to your docker compose. +In addition to the information above, to enable **HW 3D acceleration** (which helps with complex models and visualizing sliced layers), you must set an environment variable. You can do this by either adding `-e ENABLEHWGPU=true` to the `docker run` command or including `- ENABLEHWGPU=true` in your Docker Compose configuration. ### Other Environment Variables -Default values shown below. - -- `DISPLAY=:0` sets the DISPLAY variable, this can be left as 0 -- `VGL_DISPLAY=egl` needed for HW 3D accelration with EGL support on the HOST graphics driver. -- `SUPD_LOGLEVEL=INFO` log level for supervisord -- `ENABLEHWGPU=true` enable HW 3D Accelaration -- `VNC_RESOLUTION=1280x800` resolution of the VNC server -- `VNC_PASSWORD=(None)` defaults to no VNC password, you can add one here. -- `NOVNC_PORT=8080` port for the novonc HTML5/web interface. -- `VNC_PORT=5900` port fo the vnc server, allows direct connections using a VNC client. Note the `DISPLAY` number above is added to the port number, so if your display is :1 then VNC port accepting connections will be `5901` +Below are the default values for various environment variables: +- `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). +- `VGL_DISPLAY=egl`: Required for HW 3D acceleration with EGL support on the HOST graphics driver. +- `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. +- `ENABLEHWGPU=true`: Enables HW 3D acceleration. +- `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. +- `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. +- `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. +- `VNC_PORT=5900`: Defines the port for the VNC server, allowing direct connections using a VNC client. Note that the `DISPLAY` number is added to the port number (e.g., if your display is :1, the VNC port accepting connections will be `5901`). ## Links From 64350a7930ca85f7bbf627a22fd00b17b3e90291 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:17:03 -0400 Subject: [PATCH 32/56] fix: remove debug Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index d43430e..50685ce 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash set -e rm -f /tmp/.X*-lock rm -f /tmp/.X11-unix/X* From 9b0d581bf8aba0bc9f33d6ea4de5d0908daf2144 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:19:02 -0400 Subject: [PATCH 33/56] fix: more explanation Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1bc610d..9ccd36e 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Below are the default values for various environment variables: - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). - `VGL_DISPLAY=egl`: Required for HW 3D acceleration with EGL support on the HOST graphics driver. -- `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. +- `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. - `ENABLEHWGPU=true`: Enables HW 3D acceleration. - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. From 15d6eb127defdfc1dbba26cec31e6388e02ad26c Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:20:08 -0400 Subject: [PATCH 34/56] fix: defaults to false Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ccd36e..76a2c47 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Below are the default values for various environment variables: - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). - `VGL_DISPLAY=egl`: Required for HW 3D acceleration with EGL support on the HOST graphics driver. - `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. -- `ENABLEHWGPU=true`: Enables HW 3D acceleration. +- `ENABLEHWGPU=: Enables HW 3D acceleration. Default is not enabled. - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. - `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. From 3c79926faeefb0ae5ae0077669a9ddcfaf5f0d1b Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:27:47 -0400 Subject: [PATCH 35/56] fix: more docs Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76a2c47..7d84c6c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Like other Docker containers, you can pass your Nvidia GPU into the container us In unraid you can set these values during set up. For containers outside of unraid, you can set this by adding the following params or similar `-e NVIDIA_DRIVER_CAPABILITIES="all" NVIDIA_VISIBLE_DEVICES="all"`. If using Docker Compose, uncomment the enviroment variables in the relevant docker-compose.yaml file. -In addition to the information above, to enable **HW 3D acceleration** (which helps with complex models and visualizing sliced layers), you must set an environment variable. You can do this by either adding `-e ENABLEHWGPU=true` to the `docker run` command or including `- ENABLEHWGPU=true` in your Docker Compose configuration. +In addition to the information above, to enable **Hardware 3D acceleration** (which helps with visualizing complex models and sliced layers), you must set an environment variable. You can do this by either adding `-e ENABLEHWGPU=true` to the `docker run` command or including `- ENABLEHWGPU=true` in your Docker Compose configuration. ### Other Environment Variables @@ -45,7 +45,7 @@ Below are the default values for various environment variables: - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). - `VGL_DISPLAY=egl`: Required for HW 3D acceleration with EGL support on the HOST graphics driver. - `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. -- `ENABLEHWGPU=: Enables HW 3D acceleration. Default is not enabled. +- `ENABLEHWGPU=:` Enables HW 3D acceleration. Default is `false` to maintaing backward compatability. - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. - `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. From 07f7e18298c0a1d9c62c4008db9eb24d473dda1b Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:29:44 -0400 Subject: [PATCH 36/56] fix: typo Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d84c6c..9c1e2f4 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Below are the default values for various environment variables: - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). - `VGL_DISPLAY=egl`: Required for HW 3D acceleration with EGL support on the HOST graphics driver. - `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. -- `ENABLEHWGPU=:` Enables HW 3D acceleration. Default is `false` to maintaing backward compatability. +- `ENABLEHWGPU=:` Enables HW 3D acceleration. Default is `false` to maintain backward compatability. - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. - `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. From d705d44ba4d2ed4fec14c0e6858bbc337994180e Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:33:45 -0400 Subject: [PATCH 37/56] fix: tyo Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c1e2f4..89189da 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Below are the default values for various environment variables: - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). - `VGL_DISPLAY=egl`: Required for HW 3D acceleration with EGL support on the HOST graphics driver. - `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. -- `ENABLEHWGPU=:` Enables HW 3D acceleration. Default is `false` to maintain backward compatability. +- `ENABLEHWGPU=`: Enables HW 3D acceleration. Default is `false` to maintain backward compatability. - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. - `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. From 058c8fc2350135a18e81b5b7790dad2e1e369310 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:39:01 -0400 Subject: [PATCH 38/56] fix: formatting Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89189da..e161bc2 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,14 @@ In addition to the information above, to enable **Hardware 3D acceleration** (wh Below are the default values for various environment variables: - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). -- `VGL_DISPLAY=egl`: Required for HW 3D acceleration with EGL support on the HOST graphics driver. - `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. + - `ENABLEHWGPU=`: Enables HW 3D acceleration. Default is `false` to maintain backward compatability. +- `VGL_DISPLAY=egl`: Advanced setting to target specific cards if you have multiple GPUs +- `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. + - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. -- `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. - `VNC_PORT=5900`: Defines the port for the VNC server, allowing direct connections using a VNC client. Note that the `DISPLAY` number is added to the port number (e.g., if your display is :1, the VNC port accepting connections will be `5901`). ## Links From 0925b3c1f6748e1e4fe0f7f7e430486e53bf10bf Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:40:28 -0400 Subject: [PATCH 39/56] fix: more formatting Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e161bc2..3a03d98 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,14 @@ In addition to the information above, to enable **Hardware 3D acceleration** (wh Below are the default values for various environment variables: +-- - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). - `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. - +-- - `ENABLEHWGPU=`: Enables HW 3D acceleration. Default is `false` to maintain backward compatability. - `VGL_DISPLAY=egl`: Advanced setting to target specific cards if you have multiple GPUs - `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. - +-- - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. - `VNC_PORT=5900`: Defines the port for the VNC server, allowing direct connections using a VNC client. Note that the `DISPLAY` number is added to the port number (e.g., if your display is :1, the VNC port accepting connections will be `5901`). From 10dc59518860dd084515f6be33968086d179307e Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:41:05 -0400 Subject: [PATCH 40/56] fix: formatting Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 3a03d98..17d8bb0 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,12 @@ In addition to the information above, to enable **Hardware 3D acceleration** (wh Below are the default values for various environment variables: --- + - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). - `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. --- - `ENABLEHWGPU=`: Enables HW 3D acceleration. Default is `false` to maintain backward compatability. - `VGL_DISPLAY=egl`: Advanced setting to target specific cards if you have multiple GPUs - `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. --- - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. - `VNC_PORT=5900`: Defines the port for the VNC server, allowing direct connections using a VNC client. Note that the `DISPLAY` number is added to the port number (e.g., if your display is :1, the VNC port accepting connections will be `5901`). From ef96cfddb386d70e4b90cd50e962d14c9e52a09c Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:45:36 -0400 Subject: [PATCH 41/56] fix: add link for virtualg Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 17d8bb0..4314f2e 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ Below are the default values for various environment variables: [Prusaslicer](https://www.prusa3d.com/prusaslicer/) +[VirtualGL](https://virtualgl.org/) + [Supervisor](http://supervisord.org/) [GitHub Source](https://github.com/helfrichmichael/prusaslicer-novnc) From aee8731f7a6e086757939be6505d52be430b6e8f Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:46:18 -0400 Subject: [PATCH 42/56] fix: add turbovnc Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4314f2e..c71dce3 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ Below are the default values for various environment variables: [Prusaslicer](https://www.prusa3d.com/prusaslicer/) +[TruboVNC] (https://www.turbovnc.org/) + [VirtualGL](https://virtualgl.org/) [Supervisor](http://supervisord.org/) From 67c1150422a4d6af89954fb11b31f445896b6f25 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:47:29 -0400 Subject: [PATCH 43/56] fix: add updates Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c71dce3..1eafdba 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ To build a new image, clone this repository and run `docker compose up -f docker ### Using a VNC Viewer -To use a VNC viewer with the container, the default port for X TigerVNC is 5900. You can add this port by adding `-p 5900:5900` to your command to start the container to open this port for access. +To use a VNC viewer with the container, the default port for TurobVNC is 5900. You can add this port by adding `-p 5900:5900` to your command to start the container to open this port for access. See note below about ports related to `VNC_PORT` environment variable. ### GPU Acceleration/Passthrough From 48b821242f5bc7ec98817290491ee71ec4cc14d0 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:47:53 -0400 Subject: [PATCH 44/56] fix: whitepspace Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1eafdba..785312c 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ In addition to the information above, to enable **Hardware 3D acceleration** (wh Below are the default values for various environment variables: - - `DISPLAY=:0`: Sets the DISPLAY variable (usually left as 0). - `SUPD_LOGLEVEL=INFO`: Specifies the log level for supervisord. Set to `TRACE` to see output for various commands helps if you are debugging something. See superviosrd manual for possible levels. - `ENABLEHWGPU=`: Enables HW 3D acceleration. Default is `false` to maintain backward compatability. @@ -50,7 +49,7 @@ Below are the default values for various environment variables: - `NOVNC_PORT=8080`: Sets the port for the noVNC HTML5/web interface. - `VNC_RESOLUTION=1280x800`: Defines the resolution of the VNC server. - `VNC_PASSWORD=`: Defaults to no VNC password, but you can add one here. -- `VNC_PORT=5900`: Defines the port for the VNC server, allowing direct connections using a VNC client. Note that the `DISPLAY` number is added to the port number (e.g., if your display is :1, the VNC port accepting connections will be `5901`). +- `VNC_PORT=5900`: Defines the port for the VNC server, allowing direct connections using a VNC client. Note that the `DISPLAY` number is added to the port number (e.g., if your display is :1, the VNC port accepting connections will be `5901`). ## Links From 4b076aba8f727256ce659a33cf2e63d2eac9c346 Mon Sep 17 00:00:00 2001 From: Mike Helfrich Date: Thu, 4 Apr 2024 11:04:18 -0400 Subject: [PATCH 45/56] CHANGE: Add a default index.html file that enables autoreconnect and resizing. Also prefer LF for EOF. --- .gitattributes | 2 +- Dockerfile | 2 ++ vncresize.html | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 vncresize.html diff --git a/.gitattributes b/.gitattributes index dfe0770..4bb50dc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ # Auto detect text files and perform LF normalization -* text=auto +* text eol=lf \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6a191a6..3e0c960 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,6 +76,8 @@ ADD entrypoint.sh /entrypoint.sh ADD menu.xml /etc/xdg/openbox/ ADD supervisord.conf /etc/ +# Add a default file to resize, etc for noVNC. +ADD vncresize.html /usr/share/novnc/index.html VOLUME /configs/ VOLUME /prints/ diff --git a/vncresize.html b/vncresize.html new file mode 100644 index 0000000..698da50 --- /dev/null +++ b/vncresize.html @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file From d3d13423ef756367070b1c3fb3147938942aeb16 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:26:32 -0400 Subject: [PATCH 46/56] fix: more doco Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 785312c..a52c68f 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,35 @@ In unraid you can set these values during set up. For containers outside of unra In addition to the information above, to enable **Hardware 3D acceleration** (which helps with visualizing complex models and sliced layers), you must set an environment variable. You can do this by either adding `-e ENABLEHWGPU=true` to the `docker run` command or including `- ENABLEHWGPU=true` in your Docker Compose configuration. +Once enabled and started you can verify the GPU is being used by running `nvidia-smi -l` on the HOST machine and you should see `/slic3r/slic3r-dist/bin/prusa-slicer` as process using the GPU. + +``` ++---------------------------------------------------------------------------------------+ +| NVIDIA-SMI 535.161.07 Driver Version: 535.161.07 CUDA Version: 12.2 | +|-----------------------------------------+----------------------+----------------------+ +| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | +| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | +| | | MIG M. | +|=========================================+======================+======================| +| 0 NVIDIA GeForce GTX 1050 Ti Off | 00000000:0F:00.0 On | N/A | +| 36% 58C P0 N/A / 72W | 588MiB / 4096MiB | 2% Default | +| | | N/A | ++-----------------------------------------+----------------------+----------------------+ + ++---------------------------------------------------------------------------------------+ +| Processes: | +| GPU GI CI PID Type Process name GPU Memory | +| ID ID Usage | +|=======================================================================================| +| 0 N/A N/A 4129827 G /slic3r/slic3r-dist/bin/prusa-slicer 262MiB | ++---------------------------------------------------------------------------------------+ + +*some information above was edited for privacy +``` + + + + ### Other Environment Variables Below are the default values for various environment variables: From 69b86d6248698f6a2ecd16c4420ba2c1950d3057 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:31:11 -0400 Subject: [PATCH 47/56] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a52c68f..ab3767d 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,9 @@ Once enabled and started you can verify the GPU is being used by running `nvidia *some information above was edited for privacy ``` +The `GL Version` on the System Information screen inside the slicer should also show, the GPU model and driver version + +![image](https://github.com/vajonam/prusaslicer-novnc/assets/152501/250c93f5-e550-42f9-8cce-b942c93ef61e) From 612e34bccc06c8a0717f3b0e44ef2b092fed48bf Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:49:04 -0400 Subject: [PATCH 48/56] fix: remove stuff that is not interesting Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ab3767d..60cd67d 100644 --- a/README.md +++ b/README.md @@ -44,15 +44,9 @@ Once enabled and started you can verify the GPU is being used by running `nvidia +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.161.07 Driver Version: 535.161.07 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ -| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | -| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | -| | | MIG M. | -|=========================================+======================+======================| -| 0 NVIDIA GeForce GTX 1050 Ti Off | 00000000:0F:00.0 On | N/A | -| 36% 58C P0 N/A / 72W | 588MiB / 4096MiB | 2% Default | -| | | N/A | -+-----------------------------------------+----------------------+----------------------+ - + +.. removed for brevity .. + +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | From 4e597d9e5b8f4893436937455701994ba843369d Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:50:34 -0400 Subject: [PATCH 49/56] fix: smaller image Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60cd67d..b6cf111 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Once enabled and started you can verify the GPU is being used by running `nvidia The `GL Version` on the System Information screen inside the slicer should also show, the GPU model and driver version -![image](https://github.com/vajonam/prusaslicer-novnc/assets/152501/250c93f5-e550-42f9-8cce-b942c93ef61e) + From 7bb49a5f8cea7c7c1117cd12a1551bec15d948b8 Mon Sep 17 00:00:00 2001 From: Mike Helfrich Date: Thu, 4 Apr 2024 13:46:48 -0400 Subject: [PATCH 50/56] CHANGE: Add firefox-esr, cleanup the dockerfile slightly, and remove openbox and menu.xml. --- Dockerfile | 30 ++++++++++++------------------ menu.xml | 25 ------------------------- 2 files changed, 12 insertions(+), 43 deletions(-) delete mode 100644 menu.xml diff --git a/Dockerfile b/Dockerfile index 3e0c960..be9bc1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG UBUNTU_VERSION=22.04 FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu${UBUNTU_VERSION} -LABEL authors="Joshua J. Damanik, vajonam" +LABEL authors="Joshua J. Damanik - vajonam, Michael Helfrich - helfrichmichael" ARG VIRTUALGL_VERSION=3.1.1-20240228 ARG TURBOVNC_VERSION=3.1.1-20240127 @@ -11,24 +11,20 @@ ENV DEBIAN_FRONTEND noninteractive RUN # Install some basic dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ - wget \ - xorg \ - xauth \ - gosu supervisor x11-xserver-utils \ - libegl1-mesa \ - libgl1-mesa-glx \ - openbox \ - locales-all libpam0g libxt6 libxext6 dbus-x11 xauth x11-xkb-utils xkb-data python3\ - xterm \ - novnc \ + wget xorg xauth gosu supervisor x11-xserver-utils libegl1-mesa libgl1-mesa-glx \ + locales-all libpam0g libxt6 libxext6 dbus-x11 xauth x11-xkb-utils xkb-data python3 xterm novnc \ lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ freeglut3 libgtk2.0-dev libwxgtk3.0-gtk3-dev libwx-perl libxmu-dev libgl1-mesa-glx libgl1-mesa-dri \ - xdg-utils locales locales-all pcmanfm jq curl git bzip2 \ + xdg-utils locales locales-all pcmanfm jq curl git bzip2 gpg-agent software-properties-common \ + && mkdir -p /usr/share/desktop-directories \ + # Install Firefox without Snap. + && add-apt-repository ppa:mozillateam/ppa \ + && apt update \ + && apt install -y firefox-esr --no-install-recommends \ + # Clean everything up. && apt autoclean -y \ && apt autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/share/desktop-directories - + && rm -rf /var/lib/apt/lists/* # Install virtualgl and turbovnc RUN wget -qO /tmp/virtualgl_${VIRTUALGL_VERSION}_amd64.deb https://packagecloud.io/dcommander/virtualgl/packages/any/any/virtualgl_${VIRTUALGL_VERSION}_amd64.deb/download.deb?distro_version_id=35\ @@ -62,8 +58,7 @@ RUN chmod +x /slic3r/get_latest_prusaslicer_release.sh \ && ln -s /configs/.config/ /home/slic3r/ \ && mkdir -p /home/slic3r/.config/ \ && echo "XDG_DOWNLOAD_DIR=\"/prints/\"" >> /home/slic3r/.config/user-dirs.dirs \ - && echo "file:///prints prints" >> /home/slic3r/.gtk-bookmarks - + && echo "file:///prints prints" >> /home/slic3r/.gtk-bookmarks # Generate key for novnc and cleanup erros RUN openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/novnc.pem -out /etc/novnc.pem -days 365 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" \ @@ -73,7 +68,6 @@ RUN openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/novnc.pem -out /etc/n ENV PATH ${PATH}:/opt/VirtualGL/bin:/opt/TurboVNC/bin ADD entrypoint.sh /entrypoint.sh -ADD menu.xml /etc/xdg/openbox/ ADD supervisord.conf /etc/ # Add a default file to resize, etc for noVNC. diff --git a/menu.xml b/menu.xml deleted file mode 100644 index b5f5e41..0000000 --- a/menu.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - /usr/bin/vglrun /slic3r/slic3r-dist/prusa-slicer --datadir /configs/.config/PrusaSlicer/ - - - - - /usr/bin/x-terminal-emulator - - - - - /usr/bin/pcmanfm - - - - - /usr/bin/x-terminal-emulator -e htop - - - - \ No newline at end of file From 30b0b720166fd4978f7e666f8c8fd4dad4b4a7e3 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 14:01:39 -0400 Subject: [PATCH 51/56] fix: author that is just my github handle will like to leave it like that. the first is the author of the original dockerfile. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index be9bc1a..7c3d0ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG UBUNTU_VERSION=22.04 FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu${UBUNTU_VERSION} -LABEL authors="Joshua J. Damanik - vajonam, Michael Helfrich - helfrichmichael" +LABEL authors="Joshua J. Damanik, vajonam, Michael Helfrich - helfrichmichael" ARG VIRTUALGL_VERSION=3.1.1-20240228 ARG TURBOVNC_VERSION=3.1.1-20240127 From ec1b530ed4be8d48422660a9915cb8d311bb8f48 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 14:30:21 -0400 Subject: [PATCH 52/56] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6cf111..43745c3 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Below are the default values for various environment variables: [Prusaslicer](https://www.prusa3d.com/prusaslicer/) -[TruboVNC] (https://www.turbovnc.org/) +[TruboVNC](https://www.turbovnc.org/) [VirtualGL](https://virtualgl.org/) From 5859feb29e866939d82011c24f8a0f6246fe2a3f Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:49:20 -0400 Subject: [PATCH 53/56] fix: update authors. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7c3d0ec..22a584c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG UBUNTU_VERSION=22.04 FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu${UBUNTU_VERSION} -LABEL authors="Joshua J. Damanik, vajonam, Michael Helfrich - helfrichmichael" +LABEL authors="vajonam, Michael Helfrich - helfrichmichael" ARG VIRTUALGL_VERSION=3.1.1-20240228 ARG TURBOVNC_VERSION=3.1.1-20240127 From 7a614e8c67e9599fd32d43ea420fb9e24bcf3d04 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:07:44 -0400 Subject: [PATCH 54/56] feat: enable HW accel for firefox when loaded useful for faster browsing. Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 22a584c..10d259d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,9 @@ ADD supervisord.conf /etc/ # Add a default file to resize, etc for noVNC. ADD vncresize.html /usr/share/novnc/index.html +#Set firefox to run with hardware accel as well. + +RUN sed -i 's|exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"|if [ -n "$ENABLEHWGPU" ] \&\& [ "$ENABLEHWGPU" = "true" ]; then\n exec /usr/bin/vglrun $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nelse\n exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nfi|g' /usr/bin/firefox-esr VOLUME /configs/ VOLUME /prints/ From af1c4ab0292e7a511b8807dab4a55a4c03b27ea6 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:08:06 -0400 Subject: [PATCH 55/56] fix: remove space Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 10d259d..7513817 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,7 +75,7 @@ ADD vncresize.html /usr/share/novnc/index.html #Set firefox to run with hardware accel as well. -RUN sed -i 's|exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"|if [ -n "$ENABLEHWGPU" ] \&\& [ "$ENABLEHWGPU" = "true" ]; then\n exec /usr/bin/vglrun $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nelse\n exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nfi|g' /usr/bin/firefox-esr +RUN sed -i 's|exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"|if [ -n "$ENABLEHWGPU" ] \&\& [ "$ENABLEHWGPU" = "true" ]; then\n exec /usr/bin/vglrun $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nelse\n exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nfi|g' /usr/bin/firefox-esr VOLUME /configs/ VOLUME /prints/ From 8580dfcd30646ab35cd38d6e31028ff2ab844a94 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:09:49 -0400 Subject: [PATCH 56/56] fix: fomratting Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com> --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7513817..4c8287b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,9 +73,9 @@ ADD supervisord.conf /etc/ # Add a default file to resize, etc for noVNC. ADD vncresize.html /usr/share/novnc/index.html -#Set firefox to run with hardware accel as well. - +#Set firefox to run with hardware accel as if enabled. RUN sed -i 's|exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"|if [ -n "$ENABLEHWGPU" ] \&\& [ "$ENABLEHWGPU" = "true" ]; then\n exec /usr/bin/vglrun $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nelse\n exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@"\nfi|g' /usr/bin/firefox-esr + VOLUME /configs/ VOLUME /prints/