### Install and Configure KasmVNC on Alpine Source: https://docs.kasmvnc.com/docs/install/index.html Use these commands to download the package, install it, configure user permissions, and start the VNC server. ```bash # Please choose the package for your distro here (under Assets): # https://github.com/kasmtech/KasmVNC/releases wget doas apk add ./kasmvncserver_*.apk --allow-untrusted # Add your user to the kasmvnc-cert group doas adduser $USER kasmvnc-cert # YOU MUST DISCONNECT AND RECONNECT FOR GROUP MEMBERSHIP CHANGE TO APPLY # start KasmVNC, you will be prompted to create a KasmVNC user and select a desktop environment vncserver # Tail the logs tail -f ~/.vnc/*.log ``` -------------------------------- ### Install dbus-x11 package Source: https://docs.kasmvnc.com/docs/FAQ/index.html Install the required dbus-x11 package to resolve black screen issues in Gnome. ```bash sudo apt-get install dbus-x11 ``` -------------------------------- ### Install and Configure KasmVNC on Fedora Source: https://docs.kasmvnc.com/docs/install/index.html Commands to install the RPM package, configure user permissions, adjust system crypto policies for WebRTC, and manage the service via systemd. ```bash # Please choose the package for your distro here (under Assets): # https://github.com/kasmtech/KasmVNC/releases wget sudo dnf install ./kasmvncserver_*.rpm # Add your user to the kasmvnc-cert group sudo usermod -a -G kasmvnc-cert $USER # YOU MUST DISCONNECT AND RECONNECT FOR GROUP MEMBERSHIP CHANGE TO APPLY # You might need to relax system crypto policy for full functionality (WebRTC # UDP Transit). # Print current crypto policy. sudo update-crypto-policies --show # If the current policy is LEGACY or :SHA1, you don't need to change # system crypto policy. # Otherwise, change the current crypto policy to :SHA1: # You need to delete ":NO-SHA1" from your crypto policy if it's present. sudo update-crypto-policies --set :SHA1 # start KasmVNC, you will be prompted to create a KasmVNC user and select a desktop environment vncserver # Tail the logs tail -f ~/.vnc/*.log # Optionally use systemd to start KasmVNC on boot. sudo reboot # Needed for systemd to pick up $USER's kasmvnc-cert group systemctl --user enable kasmvncserver@:1 # :1 is Xorg DISPLAY number. systemctl --user start kasmvncserver@:1 # You can run multiple KasmVNC instances via systemd by passing a different # DISPLAY number: # systemctl --user enable kasmvncserver@:2 # systemctl --user start kasmvncserver@:2 # systemctl --user enable kasmvncserver@:3 # systemctl --user start kasmvncserver@:3 ``` -------------------------------- ### Install KasmVNC on Debian/Ubuntu/Kali Source: https://docs.kasmvnc.com/docs/install/index.html Commands to download, install, configure user permissions, and manage the KasmVNC service. ```bash # Please choose the package for your distro here (under Assets): # https://github.com/kasmtech/KasmVNC/releases wget sudo apt-get install ./kasmvncserver_*.deb # Add your user to the ssl-cert group sudo adduser $USER ssl-cert # YOU MUST DISCONNECT AND RECONNECT FOR GROUP MEMBERSHIP CHANGE TO APPLY # start KasmVNC, you will be prompted to create a KasmVNC user and select a desktop environment vncserver # Tail the logs tail -f ~/.vnc/*.log # Optionally use systemd to start KasmVNC on boot. sudo reboot # Needed for systemd to pick up $USER's ssl-cert group systemctl --user enable kasmvncserver@:1 # :1 is Xorg DISPLAY number. systemctl --user start kasmvncserver@:1 # You can run multiple KasmVNC instances via systemd by passing a different # DISPLAY number: # systemctl --user enable kasmvncserver@:2 # systemctl --user start kasmvncserver@:2 # systemctl --user enable kasmvncserver@:3 # systemctl --user start kasmvncserver@:3 ``` -------------------------------- ### Install FFmpeg with Extra Codecs Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Command to install FFmpeg with additional codec support on Debian-based systems. ```bash sudo apt install ffmpeg libavcodec-extra ``` -------------------------------- ### Install KasmVNC on RHEL 8 Source: https://docs.kasmvnc.com/docs/install/index.html Commands to download, install, and configure KasmVNC on RHEL 8, including enabling the powertools repository. ```bash # Choose the Oracle 8 rpm here: # https://github.com/kasmtech/KasmVNC/releases wget # Ensure KasmVNC dependencies are available sudo dnf config-manager --set-enabled powertools sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm sudo dnf localinstall ./kasmvncserver_*.rpm # Add your user to the kasmvnc-cert group sudo usermod -a -G kasmvnc-cert $USER # YOU MUST DISCONNECT AND RECONNECT FOR GROUP MEMBERSHIP CHANGE TO APPLY # start KasmVNC, you will be prompted to create a KasmVNC user and select a desktop environment vncserver # Tail the logs tail -f ~/.vnc/*.log # Optionally use systemd to start KasmVNC on boot. sudo reboot # Needed for systemd to pick up $USER's kasmvnc-cert group systemctl --user enable kasmvncserver@:1 # :1 is Xorg DISPLAY number. systemctl --user start kasmvncserver@:1 # You can run multiple KasmVNC instances via systemd by passing a different # DISPLAY number: # systemctl --user enable kasmvncserver@:2 # systemctl --user start kasmvncserver@:2 # systemctl --user enable kasmvncserver@:3 # systemctl --user start kasmvncserver@:3 ``` -------------------------------- ### Configure Runtime Settings Source: https://docs.kasmvnc.com/docs/configuration/index.html Example configuration for restricting client overrides and defining allowed runtime modifications. ```yaml runtime_configuration: allow_client_to_override_kasm_server_settings: false allow_override_standard_vnc_server_settings: true allow_override_list: - pointer.enabled - data_loss_prevention.clipboard.server_to_client.enabled - data_loss_prevention.clipboard.client_to_server.enabled - data_loss_prevention.clipboard.server_to_client.primary_clipboard_enabled ``` -------------------------------- ### Install KasmVNC on RHEL 9 Source: https://docs.kasmvnc.com/docs/install/index.html Commands to download, install, and configure KasmVNC on RHEL 9, including enabling the crb repository. ```bash # Choose the Oracle 9 rpm here: # https://github.com/kasmtech/KasmVNC/releases wget # Ensure KasmVNC dependencies are available sudo dnf config-manager --set-enabled crb sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm sudo dnf localinstall ./kasmvncserver_*.rpm # Add your user to the kasmvnc-cert group sudo usermod -a -G kasmvnc-cert $USER # YOU MUST DISCONNECT AND RECONNECT FOR GROUP MEMBERSHIP CHANGE TO APPLY # start KasmVNC, you will be prompted to create a KasmVNC user and select a desktop environment vncserver # Tail the logs tail -f ~/.vnc/*.log # Optionally use systemd to start KasmVNC on boot. sudo reboot # Needed for systemd to pick up $USER's kasmvnc-cert group systemctl --user enable kasmvncserver@:1 # :1 is Xorg DISPLAY number. systemctl --user start kasmvncserver@:1 # You can run multiple KasmVNC instances via systemd by passing a different # DISPLAY number: # systemctl --user enable kasmvncserver@:2 # systemctl --user start kasmvncserver@:2 # systemctl --user enable kasmvncserver@:3 # systemctl --user start kasmvncserver@:3 ``` -------------------------------- ### Install KasmVNC on Oracle Linux 8 Source: https://docs.kasmvnc.com/docs/install/index.html Commands to install dependencies, the KasmVNC package, and configure systemd for Oracle Linux 8. ```bash # Please choose the package for your distro here (under Assets): # https://github.com/kasmtech/KasmVNC/releases wget # Ensure KasmVNC dependencies are available sudo dnf config-manager --set-enabled ol8_codeready_builder sudo dnf install oracle-epel-release-el8 sudo dnf localinstall ./kasmvncserver_*.rpm # Add your user to the kasmvnc-cert group sudo usermod -a -G kasmvnc-cert $USER # YOU MUST DISCONNECT AND RECONNECT FOR GROUP MEMBERSHIP CHANGE TO APPLY # start KasmVNC, you will be prompted to create a KasmVNC user and select a desktop environment vncserver # Tail the logs tail -f ~/.vnc/*.log # Optionally use systemd to start KasmVNC on boot. sudo reboot # Needed for systemd to pick up $USER's kasmvnc-cert group systemctl --user enable kasmvncserver@:1 # :1 is Xorg DISPLAY number. systemctl --user start kasmvncserver@:1 # You can run multiple KasmVNC instances via systemd by passing a different # DISPLAY number: # systemctl --user enable kasmvncserver@:2 # systemctl --user start kasmvncserver@:2 # systemctl --user enable kasmvncserver@:3 # systemctl --user start kasmvncserver@:3 ``` -------------------------------- ### Enable Xvnc Debug Logging Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Use this command to start Xvnc with verbose logging directed to stderr. ```bash Xvnc :1 -Log *:stderr:100 ``` -------------------------------- ### Install KasmVNC on Oracle Linux 9 Source: https://docs.kasmvnc.com/docs/install/index.html Commands to install dependencies, the KasmVNC package, and configure systemd for Oracle Linux 9. ```bash # Please choose the package for your distro here (under Assets): # https://github.com/kasmtech/KasmVNC/releases wget # Ensure KasmVNC dependencies are available sudo dnf config-manager --set-enabled ol9_codeready_builder sudo dnf config-manager --set-enabled ol9_distro_builder sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm sudo dnf localinstall ./kasmvncserver_*.rpm # Add your user to the kasmvnc-cert group sudo usermod -a -G kasmvnc-cert $USER # YOU MUST DISCONNECT AND RECONNECT FOR GROUP MEMBERSHIP CHANGE TO APPLY # start KasmVNC, you will be prompted to create a KasmVNC user and select a desktop environment vncserver # Tail the logs tail -f ~/.vnc/*.log # Optionally use systemd to start KasmVNC on boot. sudo reboot # Needed for systemd to pick up $USER's kasmvnc-cert group systemctl --user enable kasmvncserver@:1 # :1 is Xorg DISPLAY number. systemctl --user start kasmvncserver@:1 # You can run multiple KasmVNC instances via systemd by passing a different # DISPLAY number: # systemctl --user enable kasmvncserver@:2 # systemctl --user start kasmvncserver@:2 # systemctl --user enable kasmvncserver@:3 # systemctl --user start kasmvncserver@:3 ``` -------------------------------- ### Downloads Directory Listing Response Source: https://docs.kasmvnc.com/docs/developer_api/index.html Example JSON response returned by the /api/downloads endpoint detailing file metadata. ```json { "files":[ { "filename":"test.txt", "date_modified":1727968832, "date_created":1727968832, "is_dir":false, "size":0, "owner":"kasm-user", "group":"kasm-user", "perms":"644" }, { "filename":"file2.txt", "date_modified":1727969010, "date_created":1727969010, "is_dir":false, "size":0, "owner":"kasm-user", "group":"kasm-user", "perms":"644" }, { "filename":"directory", "date_modified":1727969024, "date_created":1727969024, "is_dir":true, "size":0, "owner":"kasm-user", "group":"kasm-user", "perms":"755" }, { "filename":"important", "date_modified":1727969056, "date_created":1727969056, "is_dir":true, "size":0, "owner":"kasm-user", "group":"kasm-user", "perms":"755" } ] } ``` -------------------------------- ### Implement Containerized Application Unix Socket Source: https://docs.kasmvnc.com/docs/developer_api/index.html Python example for creating, binding, and communicating via a Unix domain datagram socket. ```python import os import socket import time # create and bind socket client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) client_socket_path = f"/tmp/relay-client-{str(time.time())}" client_socket.bind(client_socket_path) # allow others to read/write to the socket os.chmod(client_socket_path, 777) # send data server_relay_path = "/tmp/relay" request = bytearray(1024) sent = client_socket.sendto(request, 0, server_relay_path) print(f'sent: {sent}B') # receive response response = bytearray(1024) received, server = client_socket.recvfrom_into(response) print(f'received: {received}B') # clean up client_socket.close() os.unlink(client_socket_path) ``` -------------------------------- ### Manage KasmVNC Sessions and Users Source: https://docs.kasmvnc.com/docs/serverside/index.html Common command-line operations for starting sessions, managing user credentials, and monitoring logs. ```bash # Start a session and be guided to setup a user and select a default desktop environment vncserver # Start a session with the mate desktop environment vncserver -select-de mate # Add a new user with read/write permissions vncpasswd -u my_username -w -r # Tail the logs tail -f ~/.vnc/*.log # Get a list of current sessions with display IDs vncserver -list # Kill the VNC session with display ID :2 vncserver -kill :2 ``` -------------------------------- ### GET /api/clear_clipboard Source: https://docs.kasmvnc.com/docs/developer_api/index.html Clears the contents of the KasmVNC and X session clipboard. ```APIDOC ## GET /api/clear_clipboard ### Description Clears the KasmVNC and X session clipboard contents. ### Method GET ### Endpoint /api/clear_clipboard ``` -------------------------------- ### GET /api/downloads Source: https://docs.kasmvnc.com/docs/developer_api/index.html Retrieves a JSON listing of files within the user's downloads directory. ```APIDOC ## GET /api/downloads ### Description Provides a detailed listing of files in the user's downloads directory, in JSON. ### Method GET ### Endpoint /api/downloads ### Parameters #### Query Parameters - **path** (string) - Optional - path relative to the user's downloads directory. ### Response #### Success Response (200) - **files** (array) - List of file objects containing filename, date_modified, date_created, is_dir, size, owner, group, and perms. ``` -------------------------------- ### GET /api/get_screenshot Source: https://docs.kasmvnc.com/docs/developer_api/index.html Retrieves a screenshot of the current session with optional resizing and deduplication. ```APIDOC ## GET /api/get_screenshot ### Description Get a screenshot of the current session. You can pass a height and width that do not match the current aspect ratio, it will return the requested width with the height adjusted to keep the aspect ratio. ### Method GET ### Endpoint /api/get_screenshot ### Parameters #### Query Parameters - **width** (integer) - Optional - Defaults to actual remote screen width - **height** (integer) - Optional - Defaults to actual remote screen height - **quality** (integer) - Optional - JPEG quality, defaults to 7 - **deduplicate** (boolean) - Optional - Set to true if you want the API call to return nothing if the screenshot has not changed since the last request ``` -------------------------------- ### Retrieve Session Users JSON Response Source: https://docs.kasmvnc.com/docs/developer_api/index.html Example JSON structure returned by the /api/get_sessions endpoint. ```json { "users": [ {"username":"username1", "connected_since":"2025-07-16 08:07:39"}, {"username":"username2", "connected_since":"2025-07-16 08:07:39"}, {"username":"username3", "connected_since":"2025-07-16 08:07:39"} ] } ``` -------------------------------- ### Retrieve Frame Statistics Source: https://docs.kasmvnc.com/docs/developer_api/index.html Example request to the frame stats endpoint and the corresponding JSON response structure. ```text /api/get_frame_stats?client=auto ``` ```json { "frame" : { "resx": 1680, "resy": 971, "changed": 60, "server_time": 45 }, "server_side" : [ { "process_name": "Analysis", "time": 2 }, { "process_name": "Screenshot", "time": 3 }, { "process_name": "Encoding_total", "time": 25, "videoscaling": 17 }, { "process_name": "TightJPEGEncoder", "time": 3, "count": 1, "area": 786432 }, { "process_name": "TightWEBPEncoder", "time": 0, "count": 0, "area": 0 } ], "client_side" : [ { "client": "71.61.88.0_1627638469.484285::websocket", "client_time": 1, "ping": 54, "processes" : [ { "process_name": "scanRenderQ", "time": 0 } ] } ] } ``` -------------------------------- ### GET /api/send_full_frame Source: https://docs.kasmvnc.com/docs/developer_api/index.html Triggers a full frame update to be sent to all users with at least read permission. ```APIDOC ## GET /api/send_full_frame ### Description Send a full frame to all users with at least read permission. ### Method GET ### Endpoint /api/send_full_frame ``` -------------------------------- ### Retrieve Bottleneck Statistics JSON Source: https://docs.kasmvnc.com/docs/developer_api/index.html Example response structure for the /api/get_bottleneck_stats endpoint, showing CPU and network performance metrics per user connection. ```json { "myusername": { "71.61.88.0_1627638421.160028::websocket": [ 8.2, 9.6, 10.0, 9.4 ], "71.61.88.0_1627638469.484285::websocket": [ 8.2, 9.6, 2.6, 8.5 ] } } ``` -------------------------------- ### GET /api/get_bottleneck_stats Source: https://docs.kasmvnc.com/docs/developer_api/index.html Retrieves CPU and network bottleneck statistics for all active user connections. Metrics are provided as snapshots and time-averaged values ranging from 0 to 10. ```APIDOC ## GET /api/get_bottleneck_stats ### Description Returns CPU and network bottleneck statistics to identify performance constraints. Values range from 0 to 10, where 10 represents no constraints. ### Method GET ### Endpoint /api/get_bottleneck_stats ### Response #### Success Response (200) - **[username]** (object) - A dictionary containing connection identifiers as keys. - **[connection_id]** (array) - An array containing: [CPU, CPU Average, Network, Network Average]. #### Response Example { "myusername": { "71.61.88.0_1627638421.160028::websocket": [ 8.2, 9.6, 10.0, 9.4 ], "71.61.88.0_1627638469.484285::websocket": [ 8.2, 9.6, 2.6, 8.5 ] } } ``` -------------------------------- ### GET /api/get_sessions Source: https://docs.kasmvnc.com/docs/developer_api/index.html Retrieves a list of users currently connected to a shared session, including their connection timestamps. ```APIDOC ## GET /api/get_sessions ### Description Retrieves a list of users connected to a shared session. The `connected_since` field indicates the date and time in UTC that the user connected to the session. ### Method GET ### Endpoint /api/get_sessions ### Response #### Success Response (200) - **users** (array) - A list of user objects containing username and connection time. #### Response Example { "users": [ {"username":"username1", "connected_since":"2025-07-16 08:07:39"}, {"username":"username2", "connected_since":"2025-07-16 08:07:39"}, {"username":"username3", "connected_since":"2025-07-16 08:07:39"} ] } ``` -------------------------------- ### GET /api/get_frame_stats Source: https://docs.kasmvnc.com/docs/developer_api/index.html Retrieves timing statistics for frame processing, including server-side encoding processes and client-side performance metrics. ```APIDOC ## GET /api/get_frame_stats ### Description Returns timings for all major processes with respect to processing a single frame. This helps determine if the network or server-side CPU is causing a bottleneck. ### Method GET ### Endpoint /api/get_frame_stats ### Parameters #### Query Parameters - **client** (string) - Required - Specifies which client connection to return stats for. Options: 'auto' (first connection for owner), 'all' (all connections), 'none' (no client stats), or a specific connection ID (e.g., '71.61.88.0_1627638421.160028::websocket'). ### Response #### Success Response (200) - **frame** (object) - Contains frame dimensions (resx, resy), percentage of changes (changed), and total server processing time (server_time). - **server_side** (array) - List of server-side processes with their respective CPU times, execution counts, and area processed. - **client_side** (array) - List of client-side metrics including client ID, processing time, and ping. ### Response Example { "frame": { "resx": 1680, "resy": 971, "changed": 60, "server_time": 45 }, "server_side": [ { "process_name": "Analysis", "time": 2 }, { "process_name": "Encoding_total", "time": 25, "videoscaling": 17 } ], "client_side": [ { "client": "71.61.88.0_1627638469.484285::websocket", "client_time": 1, "ping": 54 } ] } ``` -------------------------------- ### Set Multiple Fallback Codecs Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Demonstrates how to provide a comma-separated list of codecs for the server to attempt in order. ```bash Xvnc :1 -VideoCodec h265_nvenc,h265_vaapi,h264_nvenc,h264_vaapi,h264 ``` -------------------------------- ### Verify Hardware Acceleration Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Commands to check VAAPI availability, FFmpeg NVENC support, and DRM device permissions. ```bash vainfo --display drm ``` ```text libva info: VA-API version 1.20.0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so libva info: Found init function __vaDriverInit_1_20 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.20 (libva 2.12.0) vainfo: Driver version: Mesa Gallium driver 25.0.7-0ubuntu0.24.04.2 for AMD Radeon Graphics (radeonsi, renoir, ACO, DRM 3.57, 6.8.0-90-generic) vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain10 : VAEntrypointVLD VAProfileHEVCMain10 : VAEntrypointEncSlice VAProfileJPEGBaseline : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointVLD VAProfileVP9Profile2 : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc ``` ```bash ffmpeg -hide_banner -encoders | grep nvenc ``` ```text V....D h264_nvenc NVIDIA NVENC H.264 encoder V....D hevc_nvenc NVIDIA NVENC hevc encoder V....D av1_nvenc NVIDIA NVENC av1 encoder ``` ```bash ls -l /dev/dri/ ``` ```text crw-rw---- 1 root video 226, 0 Jan 6 18:23 card0 crw-rw---- 1 root render 226, 128 Jan 6 18:23 renderD128 ``` ```bash sudo usermod -aG render $USER ``` -------------------------------- ### Configure Xvnc Video Streaming Modes Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Use these command-line arguments to adjust video quality, frame rate, and codec selection for different network conditions. ```bash Xvnc :1 \ -VideoCodec h265_nvenc,h265_vaapi,h264_nvenc,h264 \ -VideoQualityCRFCQP 15 \ -GroupOfPicture 12 \ -FrameRate 60 ``` ```bash Xvnc :1 \ -VideoCodec h264_nvenc,h264_vaapi,h264 \ -VideoQualityCRFCQP 23 \ -GroupOfPicture 24 \ -FrameRate 30 ``` ```bash Xvnc :1 \ -VideoCodec h265_nvenc,h265_vaapi,h265,h264 \ -VideoQualityCRFCQP 30 \ -GroupOfPicture 60 \ -FrameRate 24 ``` ```bash Xvnc :1 \ -VideoCodec h264 \ -VideoQualityCRFCQP 25 ``` ```bash Xvnc :1 \ -VideoCodec h264_nvenc \ -drinode /dev/dri/renderD129 ``` -------------------------------- ### Enable GPU Acceleration via CLI Source: https://docs.kasmvnc.com/docs/gpu_acceleration/index.html Use the -hw3d flag to enable DRI3 support and specify the render node with -drinode. ```bash vncserver -hw3d -drinode /dev/dri/renderD128 ``` -------------------------------- ### Enable GPU Acceleration via YAML Configuration Source: https://docs.kasmvnc.com/docs/gpu_acceleration/index.html Configure GPU settings in the kasmvnc.yaml file to enable hardware 3D acceleration. ```yaml desktop: gpu: hw3d: true drinode: /dev/dri/renderD128 ``` -------------------------------- ### Configure Group of Pictures (GOP) Size Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Sets the interval between keyframes, affecting responsiveness and bitrate. ```bash -GroupOfPicture <0-100> ``` -------------------------------- ### Configure Video Quality Parameter Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Sets the CRF or CQP value to control encoding quality, where lower values indicate higher quality. ```bash -VideoQualityCRFCQP <0-63> ``` -------------------------------- ### Configure Image Watermark Source: https://docs.kasmvnc.com/docs/configuration/index.html Sets up a PNG image watermark with tinting and repeat spacing. ```yaml data_loss_prevention: watermark: image: /data/kasm.png tint: 25,25,255,64 repeat_spacing: 20 ``` -------------------------------- ### Configure Text Watermark with Template Source: https://docs.kasmvnc.com/docs/configuration/index.html Sets up a repeating text watermark using a template string with user and timestamp variables. ```yaml network: ssl: pem_certificate: ${HOME}/.vnc/self.pem pem_key: ${HOME}/.vnc/self.pem udp: public_ip: 127.0.0.1 data_loss_prevention: watermark: repeat_spacing: 50 tint: 200,200,235,60 text: template: "Kasm Workspaces User ${USER} (${KASM_ID}) at %F %H:%M" font: auto font_size: 24 timezone_name: Asia/Taipei ``` -------------------------------- ### Create User via POST Source: https://docs.kasmvnc.com/docs/developer_api/index.html Bulk creation of users using a JSON array in a POST request. ```json [ { "user": "username1", "password": "password123", "write": true, "read": true, "owner": false }, { "user": "username2", "password": "password123", "write": true, "read": true, "owner": false } ] ``` -------------------------------- ### KasmVNC Default Configuration File Source: https://docs.kasmvnc.com/docs/configuration/index.html The default configuration file defines settings for desktop resolution, network protocols, user sessions, security, and encoding. Many settings can be overridden by the client unless restricted by the runtime configuration. ```yaml desktop: resolution: width: 1024 height: 768 allow_resize: true pixel_depth: 24 gpu: hw3d: false drinode: /dev/dri/renderD128 network: protocol: http interface: 0.0.0.0 websocket_port: auto use_ipv4: true use_ipv6: true udp: public_ip: 127.0.0.1 port: auto payload_size: auto stun_server: auto ssl: pem_certificate: /etc/ssl/certs/ssl-cert-snakeoil.pem pem_key: /etc/ssl/private/ssl-cert-snakeoil.key require_ssl: true # unix_relay: # name: # path: user_session: new_session_disconnects_existing_exclusive_session: false concurrent_connections_prompt: false concurrent_connections_prompt_timeout: 10 idle_timeout: never keyboard: remap_keys: ignore_numlock: false raw_keyboard: false pointer: enabled: true game_mode: false runtime_configuration: allow_client_to_override_kasm_server_settings: true allow_override_standard_vnc_server_settings: true allow_override_list: - pointer.enabled - data_loss_prevention.clipboard.server_to_client.enabled - data_loss_prevention.clipboard.client_to_server.enabled - data_loss_prevention.clipboard.server_to_client.primary_clipboard_enabled logging: log_writer_name: all log_dest: logfile level: 30 security: brute_force_protection: blacklist_threshold: 5 blacklist_timeout: 10 data_loss_prevention: visible_region: # top: 10 # left: 10 # right: 40 # bottom: 40 concealed_region: allow_click_down: false allow_click_release: false clipboard: delay_between_operations: none allow_mimetypes: - chromium/x-web-custom-data - text/html - image/png server_to_client: enabled: true size: unlimited primary_clipboard_enabled: false client_to_server: enabled: true size: unlimited keyboard: enabled: true rate_limit: unlimited logging: level: off watermark: # image: /etc/kasmvnc/picture.png # location: 10,10 # tint: 255,20,20,128 # repeat_spacing: 10 # text: # template: "${USER} %H:%M" # font: auto # font_size: 48 # timezone_name: Australia/Adelaide # angle: 0 encoding: max_frame_rate: 60 full_frame_updates: none rect_encoding_mode: min_quality: 7 max_quality: 8 consider_lossless_quality: 10 rectangle_compress_threads: auto video_encoding_mode: jpeg_quality: -1 webp_quality: -1 max_resolution: width: 1920 height: 1080 enter_video_encoding_mode: time_threshold: 5 area_threshold: 45% exit_video_encoding_mode: time_threshold: 3 logging: level: off scaling_algorithm: progressive_bilinear video_streaming_mode: codec: auto quality: 17 gop: 24 compare_framebuffer: auto zrle_zlib_level: auto hextile_improved_compression: true server: http: headers: - Cross-Origin-Embedder-Policy=require-corp - Cross-Origin-Opener-Policy=same-origin httpd_directory: /usr/share/kasmvnc/www advanced: x_font_path: auto kasm_password_file: ${HOME}/.kasmpasswd x_authority_file: auto auto_shutdown: no_user_session_timeout: never active_user_session_timeout: never inactive_user_session_timeout: never allow_environment_variables_to_override_config_settings: false command_line: prompt: true ``` -------------------------------- ### Identify GPU by Path Source: https://docs.kasmvnc.com/docs/gpu_acceleration/index.html Use the by-path directory to map render nodes to specific PCI addresses. ```bash ls -l /dev/dri/by-path/*-render | awk '{print $9,$11}' /dev/dri/by-path/pci-0000:04:00.0-render ../renderD128 ``` -------------------------------- ### Verify GPU Hardware Details Source: https://docs.kasmvnc.com/docs/gpu_acceleration/index.html Query PCI information for a specific device ID to confirm the hardware model. ```bash sudo lspci |grep 04:00.0 04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt (rev c7) ``` -------------------------------- ### Configure DRM Device Node Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Specifies the path to the DRM device for hardware acceleration. ```bash -drinode ``` ```bash Xvnc :1 -drinode /dev/dri/renderD128 ``` -------------------------------- ### Configure Target Framerate Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Sets the target frames per second for video encoding. ```bash -FrameRate <10-60> ``` -------------------------------- ### Identify GPU Drivers Source: https://docs.kasmvnc.com/docs/gpu_acceleration/index.html List render nodes and their associated drivers to determine which device to use. ```bash ls -l /sys/class/drm/renderD*/device/driver | awk '{print $9,$11}' /sys/class/drm/renderD128/device/driver ../../../bus/pci/drivers/i915 /sys/class/drm/renderD129/device/driver ../../../../bus/pci/drivers/nvidia /sys/class/drm/renderD130/device/driver ../../../../bus/pci/drivers/amdgpu ``` -------------------------------- ### Configure Video Codec Parameter Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Defines the syntax for specifying video codecs via command-line parameters. ```bash -VideoCodec ``` -------------------------------- ### VAAPI Initialization Error Log Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Error message displayed when the VAAPI device context fails to initialize. ```text FFMPEGVAAPIEncoder: Failed to create VAAPI device context ``` -------------------------------- ### Verify FFmpeg Encoder Support Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Command to list available FFmpeg encoders and filter for hardware acceleration support. ```bash ffmpeg -encoders | grep -E 'vaapi|nvenc' ``` -------------------------------- ### Performance Tuning Flags Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Configuration flags for adjusting video quality, framerate, and GOP size to improve encoding performance. ```bash -VideoQualityCRFCQP 28 ``` ```bash -FrameRate 24 ``` ```bash -GroupOfPicture 60 ``` -------------------------------- ### Configure Visible Regions with Percentages Source: https://docs.kasmvnc.com/docs/configuration/index.html Defines a rendering region using percentages of the total screen dimensions. Mixing percentage values with absolute or offset values is not supported. ```yaml data_loss_prevention: visible_region: top: 10% left: 10% right: 20% bottom: 20% ``` -------------------------------- ### System Log Check for DRM Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Command to inspect system logs for DRM-related messages. ```bash dmesg | grep -i drm ``` -------------------------------- ### VAAPI Device Specification Flag Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Command line flag to explicitly set the DRI render node. ```bash -drinode /dev/dri/renderD128 ``` -------------------------------- ### Implement noVNC Unix Relay Communication Source: https://docs.kasmvnc.com/docs/developer_api/index.html JavaScript implementation using rfb.subscribeUnixRelay and rfb.sendUnixRelayData to handle bidirectional socket communication. ```javascript rfb.subscribeUnixRelay("relay_name", (payload) => { const buffer = new Uint8Array(Array.from(payload)).buffer; const data = new DataView(buffer); // process the incoming data // send a response rfb.sendUnixRelayData("relay_name", new Uint8Array([...])); }); ``` -------------------------------- ### Configure Visible Regions with Offset Coordinates Source: https://docs.kasmvnc.com/docs/configuration/index.html Defines a rendering region using pixel offsets from the screen edges, useful when resolution is unknown. ```yaml data_loss_prevention: visible_region: top: -10 left: -10 right: -10 bottom: -10 ``` ```yaml data_loss_prevention: visible_region: top: 50 left: 10 right: -10 bottom: -10 ``` -------------------------------- ### Configure KasmVNC Unix Relay Source: https://docs.kasmvnc.com/docs/developer_api/index.html YAML configuration settings for enabling the Unix relay in KasmVNC. ```yaml network: unix_relay: name: relay_name path: relay_path ``` -------------------------------- ### POST /api/create_user Source: https://docs.kasmvnc.com/docs/developer_api/index.html Adds a new user to the session, supporting both individual query parameters and bulk JSON operations. ```APIDOC ## POST /api/create_user ### Description Add another user to the session. Can be called via query parameters or as a POST with JSON data for bulk operations. ### Method POST ### Endpoint /api/create_user ### Parameters #### Query Parameters - **name** (string) - Required - The username - **password** (string) - Required - The requested password - **write** (boolean) - Optional - Set to 'true' if the user should have write permissions - **read** (boolean) - Optional - Should the user have read access - **owner** (boolean) - Optional - Should the owner be able to manage users ### Request Example [ { "user": "username1", "password": "password123", "write": true, "read": true, "owner": false } ] ``` -------------------------------- ### Update User via POST Source: https://docs.kasmvnc.com/docs/developer_api/index.html Bulk update of user permissions using a JSON array in a POST request. ```json [ { "user": "username1", "write": true, "read": true, "owner": false }, { "user": "username2", "write": true, "read": true, "owner": false } ] ``` -------------------------------- ### rfb.subscribeUnixRelay Source: https://docs.kasmvnc.com/docs/developer_api/index.html Subscribes to data received from a Unix domain socket relay in noVNC. ```APIDOC ## rfb.subscribeUnixRelay(relay_name, callback) ### Description Listens for data received from the specified Unix domain socket relay. ### Parameters - **relay_name** (string) - The identifier for the relay connection. - **callback** (function) - A function to process the incoming payload. ``` -------------------------------- ### rfb.sendUnixRelayData Source: https://docs.kasmvnc.com/docs/developer_api/index.html Sends data back through the specified Unix domain socket relay in noVNC. ```APIDOC ## rfb.sendUnixRelayData(relay_name, data) ### Description Sends data back through the relay to the containerized application. ### Parameters - **relay_name** (string) - The identifier for the relay connection. - **data** (Uint8Array) - The data payload to send. ``` -------------------------------- ### Configure Visible Regions with Absolute Coordinates Source: https://docs.kasmvnc.com/docs/configuration/index.html Defines a specific rendering region using absolute pixel coordinates. ```yaml data_loss_prevention: visible_region: top: 10 left: 10 right: 1014 bottom: 758 ``` -------------------------------- ### Software Encoding Fallback Flag Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Flag to force the use of software-based H.264 encoding. ```bash -VideoCodec h264 ``` -------------------------------- ### Encoder Not Found Error Log Source: https://docs.kasmvnc.com/docs/video_streaming_mode/index.html Error message displayed when the requested VAAPI encoder is missing. ```text EncoderProbe: Could not find h264_vaapi encoder ``` -------------------------------- ### Remove User via POST Source: https://docs.kasmvnc.com/docs/developer_api/index.html Use this JSON structure with a POST request to the /api/remove_user endpoint for bulk user removal. ```json [ { "user": "username1" }, { "user": "username2" } ] ``` -------------------------------- ### POST /api/update_user Source: https://docs.kasmvnc.com/docs/developer_api/index.html Updates existing user permissions or credentials, supporting both individual query parameters and bulk JSON operations. ```APIDOC ## POST /api/update_user ### Description Update an existing user's settings. Can be called via query parameters or as a POST with JSON data for bulk operations. ### Method POST ### Endpoint /api/update_user ### Parameters #### Query Parameters - **name** (string) - Required - The target username - **password** (string) - Optional - The password to update - **write** (boolean) - Optional - Set to true if the user should have write permission - **read** (boolean) - Optional - Should the user have read access - **owner** (boolean) - Optional - Should the owner be able to manage users ### Request Example [ { "user": "username1", "write": true, "read": true, "owner": false } ] ``` -------------------------------- ### GET/POST /api/remove_user Source: https://docs.kasmvnc.com/docs/developer_api/index.html Removes a user from the KasmVNC session. Supports query parameters for single users or JSON body for bulk operations. ```APIDOC ## GET/POST /api/remove_user ### Description Remove a user from the KasmVNC session. Can be called as a GET request or a POST request for bulk operations. ### Method GET, POST ### Endpoint /api/remove_user ### Parameters #### Query Parameters - **name** (string) - Required - username of the user to remove #### Request Body - **Array of objects** (JSON) - Required - List of objects containing "user" keys for bulk removal ### Request Example [ { "user": "username1" }, { "user": "username2" } ] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.