Merge branch 'feature/KASM-6980_kasmvnc_dev_container' into 'master'

Resolve KASM-6980 "Feature/ kasmvnc dev container"

Closes KASM-6980

See merge request kasm-technologies/internal/KasmVNC!163
This commit is contained in:
Matthew McClaskey 2025-03-03 18:04:20 +00:00
commit a05e397f5e
6 changed files with 79 additions and 7 deletions

5
.gitignore vendored
View File

@ -4,6 +4,7 @@
*.lo
.deps
.libs
*.swp
CMakeFiles
CMakeCache.txt
@ -12,6 +13,10 @@ Makefile
Makefile.in
config.h
libjpeg-turbo/
xorg.build/
install_manifest.txt
builder/build/
builder/www/
spec/tmp

View File

@ -71,6 +71,39 @@ For in-tree builds, these directories are the same.
Building KasmVNC
=================
Building the KasmVNC Server using Docker
----------------------------------------
```bash
git submodule init
git submodule update --remote --merge
sudo docker build -t kasmvnc:dev -f builder/dockerfile.ubuntu_jammy.dev .
sudo docker run -it -v ./:/src -p 6901:6901 kasmvnc:dev
```
Now from inside the container.
```bash
# build frontend
cd kasmweb
npm install
npm run build # <-- only run this on subsequent changes to front-end code
cd ..
# build dependencies
sudo builder/scripts/build-webp
sudo builder/scripts/build-build-libjpeg-turbo
# Build KasmVNC
builder/build.sh
```
Now run Xvnc and Xfce4 from inside the container
```bash
/src/xorg.build/bin/Xvnc -interface 0.0.0.0 -PublicIP 127.0.0.1 -disableBasicAuth -RectThreads 0 -Log *:stdout:100 -httpd /src/kasmweb/dist -sslOnly 0 -SecurityTypes None -websocketPort 6901 :1 &
/usr/bin/xfce4-session --display :1
```
Now open a browser and navigate to your dev VM on port 6901.
Building the KasmVNC Server on Modern Unix/Linux Systems
---------------------------------------------------------

View File

@ -245,7 +245,7 @@ if(ENABLE_NLS)
add_subdirectory(po)
endif()
add_subdirectory(tests)
####add_subdirectory(tests)
include(cmake/BuildPackages.cmake)

View File

@ -0,0 +1,25 @@
FROM kasmweb/ubuntu-jammy-desktop:develop
ENV KASMVNC_BUILD_OS ubuntu
ENV KASMVNC_BUILD_OS_CODENAME jammy
ENV XORG_VER 21.1.3
ENV XORG_PATCH 21
ENV DEBIAN_FRONTEND noninteractive
EXPOSE 6901
USER root
RUN sed -i 's$# deb-src$deb-src$' /etc/apt/sources.list && \
apt update && \
apt install -y socat sudo libxfont-dev cmake git libgnutls28-dev vim wget tightvncserver curl libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev pkg-config libfreetype6-dev libxtst-dev autoconf automake libtool xutils-dev libpixman-1-dev libxshmfence-dev libxcvt-dev libxkbfile-dev x11proto-dev libgbm-dev inotify-tools && \
echo "kasm-user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
RUN apt install -y nodejs
USER 1000
WORKDIR /src
ENTRYPOINT /bin/bash

View File

@ -22,6 +22,7 @@ ensure_libjpeg_is_fast() {
prepare_libjpeg_source() {
export JPEG_TURBO_RELEASE=$(curl -sX GET "https://api.github.com/repos/libjpeg-turbo/libjpeg-turbo/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]')
[ -d ./libjpeg-turbo ] && rm -rf ./libjpeg-turbo
mkdir libjpeg-turbo
curl -Ls "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_TURBO_RELEASE}.tar.gz" | \
tar xzvf - -C libjpeg-turbo/ --strip-components=1

View File

@ -2,18 +2,25 @@
set -euo pipefail
webp_tar_url=https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.4.tar.gz
WEBP_VERSION="1.2.4"
WEBP_TAR_URL="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz"
WEBP_TAR_FILE="/tmp/libwebp-${WEBP_VERSION}.tar.gz"
WEBP_SRC_DIR="/tmp/libwebp-${WEBP_VERSION}"
prepare_source() {
cd /tmp
wget "$webp_tar_url"
tar -xzf /tmp/libwebp-*
rm /tmp/libwebp-*.tar.gz
cd /tmp/libwebp-*
# Remove old files if they exist
[ -f "$WEBP_TAR_FILE" ] && rm "$WEBP_TAR_FILE"
[ -d "$WEBP_SRC_DIR" ] && rm -rf "$WEBP_SRC_DIR"
wget "$WEBP_TAR_URL"
tar -xzf "$WEBP_TAR_FILE"
cd "$WEBP_SRC_DIR"
}
build_and_install() {
export MAKEFLAGS=-j`nproc`
export MAKEFLAGS=-j$(nproc)
./configure --enable-static --disable-shared
make
make install
@ -21,3 +28,4 @@ build_and_install() {
prepare_source
build_and_install