KDE Plasma Desktop container designed for Kubernetes, supporting OpenGL EGL and GLX, Vulkan, and Wine/Proton for NVIDIA GPUs through WebRTC and HTML5, providing an open-source remote cloud/HPC graphics or game streaming platform. Directly accesses the GPU without an X.Org X11 Server using EGL with VirtualGL and Vulkan, not requiring /tmp/.X11-unix
host sockets or host configuration.
Use docker-nvidia-glx-desktop for a KDE Plasma Desktop container with better performance, having fully optimized OpenGL and Vulkan for NVIDIA GPUs by spawning its own fully isolated X.Org X11 Server, also not using /tmp/.X11-unix
host sockets.
Please read Troubleshooting first, then use Discord or GitHub Discussions for support questions. Please only use Issues for technical inquiries or bug reports.
This container is composed fully of vendor-neutral applications and protocols except the NVIDIA userspace driver components, indicating that there is nothing stopping you from using this container with GPUs of other vendors including AMD and Intel. Use the container toolkit/runtime or Kubernetes device plugin of each respective vendor, or make sure that it provisions /dev/dri/card[n]
and /dev/dri/renderD[128 + n]
devices using --device=/dev/dri:rwm
with sufficient host user permissions for the devices (sudo chmod -R -f 777 /dev/dri
from the host), then set the environment variable SELKIES_ENCODER
to values including vah264enc
, x264enc
, vp8enc
, or vp9enc
if using the Selkies-GStreamer WebRTC interface. However, this is not officially supported and issues may arise. This container also supports running without any GPUs with software fallback (set the environment variable SELKIES_ENCODER
to values including x264enc
, vp8enc
, or vp9enc
if using the Selkies-GStreamer WebRTC interface).
Container startup may take some time at first launch as it could automatically install NVIDIA driver libraries compatible with the host.
For Windows applications or games, Wine, Winetricks, Lutris, Heroic Launcher, PlayOnLinux, and q4wine are bundled by default. Comment out the section where it is installed within Dockerfile
if the user wants containers without Wine.
The container requires host NVIDIA GPU driver versions of at least 450.80.02 and preferably 470.42.01 (the latest minor version in each major version), with the NVIDIA Container Toolkit to be also configured on the host for allocating GPUs. The latest minor versions (xx
in 000.xx.00
) are strongly encouraged. All Maxwell or later generation GPUs in the consumer, professional, or datacenter lineups should not have significant issues running this container, although the Selkies-GStreamer high-performance NVENC backend may not be available. Kepler GPUs are untested and likely does not support the NVENC backend, but can be mostly functional using fallback software acceleration.
The high-performance NVENC backend for the Selkies-GStreamer WebRTC interface is only supported in GPUs listed as supporting H.264 (AVCHD)
under the NVENC - Encoding
section of NVIDIA's Video Encode and Decode GPU Support Matrix. If your GPU is not listed as supporting H.264 (AVCHD)
, add the environment variable SELKIES_ENCODER
to values including x264enc
, vp8enc
, or vp9enc
in your container configuration for falling back to software acceleration, which also has a very good performance depending on your CPU.
There are two web interfaces that may be chosen in this container, the first being the default Selkies-GStreamer WebRTC HTML5 web interface (requires a TURN server or host networking for best performance), and the second being the fallback KasmVNC WebSocket HTML5 web interface. While the KasmVNC interface does not support audio forwarding, it can be useful for troubleshooting the Selkies-GStreamer WebRTC interface or using this container in constrained environments.
The KasmVNC interface can be enabled in place of Selkies-GStreamer by setting KASMVNC_ENABLE
to true
. KASMVNC_THREADS
sets the number of threads KasmVNC should use for frame encoding, defaulting to all threads if not set. When using the KasmVNC interface, environment variables SELKIES_ENABLE_BASIC_AUTH
, SELKIES_BASIC_AUTH_USER
, SELKIES_BASIC_AUTH_PASSWORD
, SELKIES_ENABLE_RESIZE
, SELKIES_ENABLE_HTTPS
, SELKIES_HTTPS_CERT
, SELKIES_HTTPS_KEY
, SELKIES_PORT
, NGINX_PORT
, and TURN_EXTERNAL_IP
, used with Selkies-GStreamer, are also inherited. As with the Selkies-GStreamer WebRTC interface, the KasmVNC interface username and password will also be set to the environment variables SELKIES_BASIC_AUTH_USER
and SELKIES_BASIC_AUTH_PASSWORD
, also using ubuntu
and the environment variable PASSWD
by default if not set.
1. Run the container with Docker, Podman, or other NVIDIA-supported container runtimes (NVIDIA Container Toolkit required):
docker run --name egl -it -d --gpus 1 --tmpfs /dev/shm:rw -e TZ=UTC -e DISPLAY_SIZEW=1920 -e DISPLAY_SIZEH=1080 -e DISPLAY_REFRESH=60 -e DISPLAY_DPI=96 -e DISPLAY_CDEPTH=24 -e PASSWD=mypasswd -e SELKIES_ENCODER=nvh264enc -e SELKIES_VIDEO_BITRATE=8000 -e SELKIES_FRAMERATE=60 -e SELKIES_AUDIO_BITRATE=128000 -e SELKIES_BASIC_AUTH_PASSWORD=mypasswd -p 8080:8080 ghcr.io/selkies-project/nvidia-egl-desktop:latest
Alternatively, use Docker Compose by editing the docker-compose.yml
file:
# Start the container from the path containing docker-compose.yml
docker compose up -d
# Stop the container
docker compose down
If the Selkies-GStreamer WebRTC HTML5 interface does not connect or is extremely slow, read Step 3 and the WebRTC and Firewall Issues section very carefully.
NOTE: The container tags available are
latest
and24.04
for Ubuntu 24.04,22.04
for Ubuntu 22.04, and20.04
for Ubuntu 20.04. Persistent container tags are available in the form24.04-20210101010101
. Replace all instances ofmypasswd
with your desired password.SELKIES_BASIC_AUTH_PASSWORD
will default toPASSWD
if unspecified. The container must NOT be run in privileged mode.
For Apptainer/Singularity (requiring NVIDIA drivers):
# Customize paths
export SINGULARITY_SELKIES_OVERLAY=~/my_mounting_point/nvidia-egl-desktop.sif
export SINGULARITY_SELKIES_SCRATCH_HOME=~/nvidia-egl-desktop
mkdir -pm755 "${SINGULARITY_SELKIES_SCRATCH_HOME}"
# Change size of overlay storage
singularity overlay create --sparse --size 1536 "${SINGULARITY_SELKIES_OVERLAY}"
singularity instance run --overlay "${SINGULARITY_SELKIES_OVERLAY}" --nv --no-mount cwd --home "${SINGULARITY_SELKIES_SCRATCH_HOME}:/home/ubuntu" --env "TZ=UTC,DISPLAY_SIZEW=1920,DISPLAY_SIZEH=1080,DISPLAY_REFRESH=60,DISPLAY_DPI=96,DISPLAY_CDEPTH=24,PASSWD=mypasswd,SELKIES_ENCODER=nvh264enc,SELKIES_VIDEO_BITRATE=8000,SELKIES_FRAMERATE=60,SELKIES_AUDIO_BITRATE=128000,SELKIES_BASIC_AUTH_PASSWORD=mypasswd" docker://ghcr.io/selkies-project/nvidia-egl-desktop:latest egl
Change SELKIES_ENCODER
to x264enc
, vp8enc
, or vp9enc
when using the Selkies-GStreamer interface if you are using software fallback without allocated GPUs or your GPU does not support H.264 (AVCHD)
under the NVENC - Encoding
section in NVIDIA's Video Encode and Decode GPU Support Matrix.
The environment variable VGL_DISPLAY
can also be passed to the container, but only do so after you understand what it implicates with VirtualGL, valid values being either egl[n]
, or /dev/dri/card[n]
only when --device=/dev/dri:rwm
was used for the container.
2. Connect to the web server with a browser on port 8080. You may also separately configure a reverse proxy to this port for external connectivity.
The default username is ubuntu
for both the web authentication prompt and the container Linux username. The environment variable PASSWD
(defaulting to mypasswd
) is the password for the container Linux user account, and SELKIES_BASIC_AUTH_PASSWORD
is the password for the HTML5 interface authentication prompt. If SELKIES_ENABLE_BASIC_AUTH
is set to true
for Selkies-GStreamer but SELKIES_BASIC_AUTH_PASSWORD
is unspecified, the HTML5 interface password will default to PASSWD
.
NOTE: Only one web browser can be connected at a time with the Selkies-GStreamer WebRTC interface. If the signaling connection works, but the WebRTC connection fails, read Step 3 and the WebRTC and Firewall Issues section.
Additional configurations and environment variables for the Selkies-GStreamer WebRTC HTML5 interface are listed in lines that start with parser.add_argument
within the Selkies-GStreamer Main Script or selkies-gstreamer --help
.
3. (Not Applicable for KasmVNC) Read carefully if the Selkies-GStreamer WebRTC HTML5 interface does not connect or is extremely slow.
A TURN server is required because you are self-hosting WebRTC, unlike commercial services using WebRTC.
Choose whether to use host networking, an internal TURN server, or an external TURN server.
1. Create the Kubernetes Secret
with your authentication password (change keys and values as adequate):
kubectl create secret generic my-pass --from-literal=my-pass=YOUR_PASSWORD
NOTE: Replace
YOUR_PASSWORD
with your desired password, and change the namemy-pass
to your preferred name of the Kubernetes secret with theegl.yml
file changed accordingly as well. It is possible to skip the first step and directly provide the password withvalue:
inegl.yml
, but this exposes the password in plain text.
2. Create the pod after editing the egl.yml
file to your needs, explanations are available in the file:
kubectl create -f egl.yml
If the Selkies-GStreamer WebRTC HTML5 interface does not connect or is extremely slow, read Step 4 and the WebRTC and Firewall Issues section very carefully.
NOTE: The container tags available are
latest
and24.04
for Ubuntu 24.04,22.04
for Ubuntu 22.04, and20.04
for Ubuntu 20.04. Persistent container tags are available in the form24.04-20210101010101
.SELKIES_BASIC_AUTH_PASSWORD
will default toPASSWD
if unspecified. The container must NOT be run in privileged mode.
Change SELKIES_ENCODER
to x264enc
, vp8enc
, or vp9enc
when using the Selkies-GStreamer interface if you are using software fallback without allocated GPUs or your GPU does not support H.264 (AVCHD)
under the NVENC - Encoding
section in NVIDIA's Video Encode and Decode GPU Support Matrix.
3. Connect to the web server spawned at port 8080. You may configure the ingress endpoint or reverse proxy that your Kubernetes cluster provides to this port for external connectivity.
The default username is ubuntu
for both the web authentication prompt and the container Linux username. The environment variable PASSWD
(defaulting to mypasswd
) is the password for the container Linux user account, and SELKIES_BASIC_AUTH_PASSWORD
is the password for the HTML5 interface authentication prompt. If SELKIES_ENABLE_BASIC_AUTH
is set to true
for Selkies-GStreamer but SELKIES_BASIC_AUTH_PASSWORD
is unspecified, the HTML5 interface password will default to PASSWD
.
NOTE: Only one web browser can be connected at a time with the Selkies-GStreamer WebRTC interface. If the signaling connection works, but the WebRTC connection fails, read Step 4 and the WebRTC and Firewall Issues section.
Additional configurations and environment variables for the Selkies-GStreamer WebRTC HTML5 interface are listed in lines that start with parser.add_argument
within the Selkies-GStreamer Main Script or selkies-gstreamer --help
.
4. (Not Applicable for KasmVNC) Read carefully if the Selkies-GStreamer WebRTC HTML5 interface does not connect or is extremely slow.
A TURN server is required because you are self-hosting WebRTC, unlike commercial services using WebRTC.
Choose whether to use host networking, an internal TURN server, or an external TURN server.
Note that this section is only required for the Selkies-GStreamer WebRTC HTML5 interface.
In most cases when either of your server or client has a permissive firewall, the default Google STUN server configuration will work without additional configuration. However, when connecting from networks that cannot be traversed with STUN, a TURN server is required.
Read the last steps of each Docker/Kubernetes instruction to use an internal TURN server. Alternatively, read the below sections.
For an easy fix to when the signaling connection works, but the WebRTC connection fails, open UDP and TCP ports 49152–65535 in your host server network (or use Full Cone NAT in your network router/infrastructure settings), then add the option --network=host
to your Docker command (or network_mode: 'host'
in docker-compose.yml
), or uncomment hostNetwork: true
in your egl.yml
file when using Kubernetes (note that your cluster may have not allowed this, resulting in an error). This exposes your container to the host network, which disables network isolation. Note that running multiple desktop containers in one host under this configuration may be problematic and is not recommended. You must also pass new environment variables such as -e DISPLAY=:22
, -e NGINX_PORT=8082
, -e SELKIES_PORT=8083
, and -e SELKIES_METRICS_HTTP_PORT=9083
into the container, all not overlapping with any other X11 server or container in the same host. Access the container using the specified NGINX_PORT
.
If this does not fix the connection issue (normally when the host is behind another additional firewall), you cannot use this fix for security or technical reasons, or when deploying multiple desktop containers in one host, read the below text to set up an external TURN server.
Read the instructions from Selkies-GStreamer if want to deploy an external TURN server or use a public TURN server instance. Read the last steps of each Docker/Kubernetes instruction to use an internal TURN server instead.
More information is available in the Selkies-GStreamer documentation.
With Docker (or Podman), use the -e
option to add the SELKIES_TURN_HOST
, SELKIES_TURN_PORT
environment variables. This is the hostname or IP and the port of the TURN server (3478 in most cases).
You may set SELKIES_TURN_PROTOCOL
to tcp
if you are only able to open TCP ports for the coTURN container to the internet, or if the UDP protocol is blocked or throttled in your client network. You may also set SELKIES_TURN_TLS
to true
with the -e
option if TURN over TLS/DTLS was properly configured with valid TLS certificates.
You also require to provide either only the environment variable SELKIES_TURN_SHARED_SECRET
for time-limited shared secret TURN authentication, or both the environment variables SELKIES_TURN_USERNAME
and SELKIES_TURN_PASSWORD
for legacy long-term TURN authentication, depending on your TURN server configuration. Provide just one of these authentication methods, not both.
If there is a TURN REST API server, provide the environment variable SELKIES_TURN_REST_URI
but not any other authentication credentials to the TURN REST URI within this infrastructure. If there is a shared TURN server within an infrastructure, consider reading the TURN REST API documentation or provide the link to your infrastructure administrator to deploy a TURN REST API server.
More information is available in the Selkies-GStreamer documentation.
Your TURN server will use only one out of three ways to authenticate the client, so only provide one type of authentication method. The time-limited shared secret TURN authentication only requires the Base64 encoded SELKIES_TURN_SHARED_SECRET
. The legacy long-term TURN authentication requires both SELKIES_TURN_USERNAME
and SELKIES_TURN_PASSWORD
credentials. The TURN REST API method only requires the SELKIES_TURN_REST_URI
URI.
If there is a shared TURN server within an infrastructure, consider reading the TURN REST API documentation or provide the link to your infrastructure administrator to deploy a TURN REST API server.
systemd
, polkit
, FUSE mounts, or sandboxed (containerized) application distribution systems like Flatpak, Snapcraft (snap), AppImage, Electron, chrome-sandbox, etc.This project has been developed and is supported in part by the National Research Platform (NRP) and the Cognitive Hardware and Software Ecosystem Community Infrastructure (CHASE-CI) at the University of California, San Diego, by funding from the National Science Foundation (NSF), with awards #1730158, #1540112, #1541349, #1826967, #2138811, #2112167, #2100237, and #2120019, as well as additional funding from community partners, infrastructure utilization from the Open Science Grid Consortium, supported by the National Science Foundation (NSF) awards #1836650 and #2030508, and infrastructure utilization from the Chameleon testbed, supported by the National Science Foundation (NSF) awards #1419152, #1743354, and #2027170. This project has also been funded by the Seok-San Yonsei Medical Scientist Training Program (MSTP) Song Yong-Sang Scholarship, College of Medicine, Yonsei University, the MD-PhD/Medical Scientist Training Program (MSTP) through the Korea Health Industry Development Institute (KHIDI), funded by the Ministry of Health & Welfare, Republic of Korea, and the Student Research Bursary of Song-dang Institute for Cancer Research, College of Medicine, Yonsei University.