Linux command
x11docker 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run GUI app
x11docker [image] [command]
With GPU acceleration
x11docker --gpu [image] [command]
Share home directory
x11docker --home [image]
With audio
x11docker --pulseaudio [image]
Clipboard sharing
x11docker --clipboard [image]
说明
x11docker runs graphical applications from Docker containers with secure X11 display forwarding. It provides isolated display access using multiple backends including Xephyr, Xpra, and nxagent, preventing containers from accessing the host's X server directly. The tool supports GPU hardware acceleration, PulseAudio integration, and clipboard sharing between the container and host. This security-focused approach allows running untrusted GUI applications in containers while maintaining display isolation from the host desktop environment.
参数
- --gpu
- Enable hardware OpenGL acceleration.
- --home
- Provide a persistent per-container home directory on the host.
- --pulseaudio
- Enable PulseAudio sound support.
- --alsa
- Enable ALSA sound support.
- --pipewire
- Enable PipeWire sound support.
- --clipboard
- Share clipboard between host and container.
- --desktop
- Run a full desktop environment rather than a single application.
- --xephyr
- Use the Xephyr nested X server (default fallback).
- --xpra
- Use Xpra as the X server backend.
- --nxagent
- Use nxagent as the X server backend.
- --wayland
- Run in a Wayland compositor.
- --hostdisplay
- Share the host X socket (less secure, fallback).
- --share _PATH_
- Share a host file or folder with the container.
- --network, -I
- Allow network access from the container.
- --init _SYSTEM_
- Use an init system (e.g., systemd, runit, tini).
- --backend _BACKEND_
- Choose container backend: docker, podman, or host.
- --webcam
- Share webcams with the container.
- --printer
- Share host CUPS printers.
- --user _USER_
- Run the container as a specific user.
FAQ
What is the x11docker command used for?
x11docker runs graphical applications from Docker containers with secure X11 display forwarding. It provides isolated display access using multiple backends including Xephyr, Xpra, and nxagent, preventing containers from accessing the host's X server directly. The tool supports GPU hardware acceleration, PulseAudio integration, and clipboard sharing between the container and host. This security-focused approach allows running untrusted GUI applications in containers while maintaining display isolation from the host desktop environment.
How do I run a basic x11docker example?
Run `x11docker [image] [command]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --gpu do in x11docker?
Enable hardware OpenGL acceleration.