From a327e79bc4f2bb2c4b3483acea63618539b53c96 Mon Sep 17 00:00:00 2001 From: netsgnut <284779+netsgnut@users.noreply.github.com> Date: Fri, 24 Oct 2025 10:47:51 -0700 Subject: [PATCH] fix(kasmvnc): change installed check and bump default version (#505) ## Description This PR makes the following changes to the `coder/modules/kasmvnc`: - Change the installation check from checking `vncserver` to `kasmvncserver`. - Bump the default KasmVNC installation version to [1.4.0](https://docs.kasmvnc.com/docs/release_notes/1.4.0). In images where there is already TightVNC installed, the current installation check will erroneously report that KasmVNC is already installed. By checking `kasmvncserver` instead, it ensures KasmVNC is installed. Tested on Debian, Kali and Alpine-based images. ## Type of Change - [ ] New module - [ ] New template - [X] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other ## Module Information **Path:** `registry/coder/modules/kasmvnc` **New version:** `v1.2.5` **Breaking change:** [ ] Yes [X] No ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun fmt`) - [X] Changes tested locally ## Related Issues None --- registry/coder/modules/kasmvnc/README.md | 2 +- registry/coder/modules/kasmvnc/main.tf | 2 +- registry/coder/modules/kasmvnc/run.sh | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/registry/coder/modules/kasmvnc/README.md b/registry/coder/modules/kasmvnc/README.md index 2bc862d4..7f01b45b 100644 --- a/registry/coder/modules/kasmvnc/README.md +++ b/registry/coder/modules/kasmvnc/README.md @@ -14,7 +14,7 @@ Automatically install [KasmVNC](https://kasmweb.com/kasmvnc) in a workspace, and module "kasmvnc" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/kasmvnc/coder" - version = "1.2.4" + version = "1.2.5" agent_id = coder_agent.example.id desktop_environment = "xfce" subdomain = true diff --git a/registry/coder/modules/kasmvnc/main.tf b/registry/coder/modules/kasmvnc/main.tf index ca7315ec..5a5b449b 100644 --- a/registry/coder/modules/kasmvnc/main.tf +++ b/registry/coder/modules/kasmvnc/main.tf @@ -23,7 +23,7 @@ variable "port" { variable "kasm_version" { type = string description = "Version of KasmVNC to install." - default = "1.3.2" + default = "1.4.0" } variable "desktop_environment" { diff --git a/registry/coder/modules/kasmvnc/run.sh b/registry/coder/modules/kasmvnc/run.sh index 04b8b9ee..089dce3e 100644 --- a/registry/coder/modules/kasmvnc/run.sh +++ b/registry/coder/modules/kasmvnc/run.sh @@ -8,10 +8,10 @@ error() { exit 1 } -# Function to check if vncserver is already installed +# Function to check if KasmVNC is already installed check_installed() { - if command -v vncserver &> /dev/null; then - echo "vncserver is already installed." + if command -v kasmvncserver &> /dev/null; then + echo "KasmVNC is already installed." return 0 # Don't exit, just indicate it's installed else return 1 # Indicates not installed @@ -158,7 +158,7 @@ case "$arch" in ;; esac -# Check if vncserver is installed, and install if not +# Check if KasmVNC is installed, and install if not if ! check_installed; then # Check for NOPASSWD sudo (required) if ! command -v sudo &> /dev/null || ! sudo -n true 2> /dev/null; then @@ -188,7 +188,7 @@ if ! check_installed; then ;; esac else - echo "vncserver already installed. Skipping installation." + echo "KasmVNC already installed. Skipping installation." fi if command -v sudo &> /dev/null && sudo -n true 2> /dev/null; then @@ -227,7 +227,7 @@ EOF # This password is not used since we start the server without auth. # The server is protected via the Coder session token / tunnel # and does not listen publicly -echo -e "password\npassword\n" | vncpasswd -wo -u "$USER" +echo -e "password\npassword\n" | kasmvncpasswd -wo -u "$USER" get_http_dir() { # determine the served file path @@ -290,7 +290,7 @@ VNC_LOG="/tmp/kasmvncserver.log" printf "🚀 Starting KasmVNC server...\n" set +e -vncserver -select-de "${DESKTOP_ENVIRONMENT}" -disableBasicAuth > "$VNC_LOG" 2>&1 +kasmvncserver -select-de "${DESKTOP_ENVIRONMENT}" -disableBasicAuth > "$VNC_LOG" 2>&1 RETVAL=$? set -e