
KDE Plasma容器化桌面环境支持NVIDIA GPU远程访问
这是一个基于KDE Plasma的容器化桌面环境项目,为Kubernetes优化设计。支持通过NVIDIA GPU实现OpenGL、Vulkan和Wine/Proton功能,利用WebRTC和HTML5技术提供远程云/HPC图形或游戏流媒体服务。采用独立X.Org X11服务器,无需额外主机配置。提供Selkies-GStreamer和KasmVNC两种Web界面,满足不同远程访问需求。
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. Spawns its own fully isolated X.Org X11 Server instead of using the host X Server, not requiring /tmp/.X11-unix host sockets or host configuration.
Use docker-nvidia-egl-desktop for a KDE Plasma Desktop container which directly accesses NVIDIA (and unofficially Intel and AMD) GPUs without using an X.Org X11 Server, supports sharing one GPU with many containers, supports Apptainer/Singularity, and automatically falling back to software acceleration in the absence of GPUs (but with lower graphics performance).
Please read Troubleshooting first, then use Discord or GitHub Discussions for support questions. Please only use Issues for technical inquiries or bug reports.
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, and SELKIES_HTTPS_KEY, 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 xgl -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-glx-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
latestand24.04for Ubuntu 24.04,22.04for Ubuntu 22.04, and20.04for Ubuntu 20.04. Persistent container tags are available in the form24.04-20210101010101. Replace all instances ofmypasswdwith your desired password.SELKIES_BASIC_AUTH_PASSWORDwill default toPASSWDif 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 your GPU does not support H.264 (AVCHD) under the NVENC - Encoding section in NVIDIA's Video Encode and Decode GPU Support Matrix.
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.
There is an internal TURN server inside the container that may be used when an external TURN server or host networking is not available.
Add environment variables -e SELKIES_TURN_PROTOCOL=udp -e SELKIES_TURN_PORT=3478 -e TURN_MIN_PORT=65534 -e TURN_MAX_PORT=65535 (change the ports accordingly) with the docker run command (or uncomment the relevant docker-compose.yml sections), where the SELKIES_TURN_PORT should not be used by any other host process or container, and the TURN_MIN_PORT/TURN_MAX_PORT port range has to contain at least two ports also not used by any other host process or container.
Then, open the ports with the docker run arguments -p 8080:8080 -p 3478:3478 -p 3478:3478/udp -p 65534-65535:65534-65535 -p 65534-65535:65534-65535/udp (or uncomment the relevant docker-compose.yml sections) in addition to the web server port.
If UDP cannot be used, at the cost of higher latency and lower performance, omit the ports containing /udp and use the environment variable -e SELKIES_TURN_PROTOCOL=tcp.
All these ports must be exposed to the internet if you need access over the internet. If you need use TURN within a local network, add -e SELKIES_TURN_HOST=[YOUR_INTERNAL_IP] with YOUR_INTERNAL_IP to the internal hostname or IP of the local network.
The Selkies-GStreamer WebRTC HTML5 interface will likely just start working if you open UDP and TCP ports 49152–65535 in your host server network and add --network host to the above docker run command, or network_mode: 'host' in docker-compose.yml. Note that running multiple desktop containers in one host under this configuration may be problematic and is not recommended. When deploying multiple containers, you must also pass a new DISPLAY environment variable such as -e DISPLAY=:22 into the container, that is not used with any other X11 server or container in the same host.
However, host networking may be restricted or not be desired because of security reasons or when deploying multiple desktop containers in one host. If not available, check if the container starts working after omitting --network host.
If having no TURN server does not work, you need an external TURN server. Read the WebRTC and Firewall Issues section and add the environment variables -e SELKIES_TURN_HOST=, -e SELKIES_TURN_PORT=, and pick one of -e SELKIES_TURN_SHARED_SECRET= or both -e SELKIES_TURN_USERNAME= and -e SELKIES_TURN_PASSWORD= environment variables to the docker run command based on your authentication method.
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_PASSWORDwith your desired password, and change the namemy-passto your preferred name of the Kubernetes secret with thexgl.ymlfile changed accordingly as well. It is possible to skip the first step and directly provide the password withvalue:inxgl.yml, but this exposes the password in plain text.
2. Create the pod after editing the xgl.yml file to your needs, explanations are available in the file:
kubectl create -f xgl.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
latestand24.04for Ubuntu 24.04,22.04for Ubuntu 22.04, and20.04for Ubuntu 20.04. Persistent container tags are available in the form24.04-20210101010101.SELKIES_BASIC_AUTH_PASSWORDwill default toPASSWDif 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 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.
There is an internal TURN server inside the container that may be used when an external TURN server or host networking is not available.
Uncomment the relevant environment variables SELKIES_TURN_PROTOCOL=udp, SELKIES_TURN_PORT=3478, TURN_MIN_PORT=65534, TURN_MAX_PORT=65535 (change the ports accordingly) within xgl.yml (within name: and value:), where the SELKIES_TURN_PORT should not be used by any other host process or container, and the TURN_MIN_PORT/TURN_MAX_PORT port range has to contain at least two ports also not used by


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量提升解决方案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频


实时语音翻译/同声传译工具
Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。


选题、配图、成文,一站式创作,让内容运营更高效
讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。


最强AI数据分析助手
小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。


像人一样思考的AI智能体
imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号