X11DOCKER(1)
π X11DOCKER(1) π
okay so bestie, this is the General Commands Manual page for x11docker, and honestly? it ate. grab a snack, we're going through every single line together. πβ¨
πΈ NAME πΈ
x11docker β run GUI applications and desktop environments in containers π¦
β¨ SYNOPSIS β¨
so, if you wanna run a container on a fresh new X server, you do this:
x11docker [OPTIONS] IMAGE [COMMAND]
x11docker [OPTIONS] -- IMAGE [COMMAND [ARGS ...]]
x11docker [OPTIONS] -- [CUSTOM_RUN_OPTIONS] -- IMAGE [COMMAND [ARGS ...]]
and if you wanna run a host application on a new X server instead:
x11docker [OPTIONS] --backend=host -- COMMAND [ARGS ...]
that's the whole vibe check. π
π DESCRIPTION π
x11docker runs GUI apps and full desktop environments inside containers, no cap. It plays nice with docker, podman, and nerdctl (that last one is experimental, lowkey a work in progress π).
It can run X servers from your host, or X servers inside containers of the image x11docker/xserver. It can even hand X servers over to host applications. And the best part? x11docker always spins up a fresh container from the image and yeets it into the void afterwards. no leftover mess, periodt. π§
π Optional features:
- GPU hardware acceleration
- Sound with
pulseaudioorALSA - Clipboard sharing
- Printer access
- Webcam access
- Persistent home folder
- Wayland support
- Language locale creation
- Several init systems and
DBusin container - Support of several container runtimes and backends
π Focus on security:
- Avoids X security leaks using additional X servers.
- Container user is same as host user to avoid root in container.
- Restricts container capabilities to bare minimum.
so like, x11docker sets up an unprivileged container user whose password is x11docker, and it locks the container capabilities down to the bare minimum. because of these security restrictions, some applications might act different than they would under a regular docker|podman run command β not a bug bestie, it's the whole point. π if you want a less restricted setup, go for --cap-default or --sudouser.
π OPTIONS π
real talk first: Short options do not accept arguments. like, none of them. that's the rule. π
--helpβ print this whole message and dip.--licenseβ show thex11dockerlicense (it's MIT) and exit.--versionβ show thex11dockerversion and exit.
π« Basic settings π«
--backend=docker|podman|nerdctl|hostβ which container backend you're using, orhostif you want no container at all.-d,--desktopβ tells x11docker there's a desktop environment living in the image.-i,--interactiveβ run with an interactive tty so you can actually type shell commands. main character energy. β¨--rootless [=yes|no]β use (or disallow) a rootless backend. and here's the default tea if you don't pass--rootless:--backend=docker: rootful unless the environment variableDOCKER_HOSTis set.--backend=podman: rootless except started as root.--backend=nerdctl: rootless except started as root
--xc [=yes|no|BACKEND]β run the X server inside a container of imagex11docker/xserver.BACKENDcan specify one ofdocker|podman|nerdctl.--xonlyβ just start an empty X server. that's it. that's the whole job. π«Ά
π Host integration π
--alsa [=ALSA_CARD]β sound viaALSA. you can pick the sound card you want withALSA_CARD. wanna see your options? list of available sound cards:aplay -l-c,--clipboard [=yes|no|oneway|superv|altv]β share the clipboard with the host. possible arguments:yesβ share clipboard in both directions. includes middle-mouse-click selection.onewayβ copy clipboard from container to host only. includes middle-mouse-click selection.supervβ keys[SUPER][v]copy clipboard from host to container. does not copy middle-mouse-click to container. otherwise same asoneway.altvβ same assupervbut using keys[ALT][v].noβ do not share clipboard.
-g,--gpu [=yes|no|iglx|virgl]β GPU access for hardware accelerated OpenGL. works best with open source drivers on host and in image. for closed source nvidia drivers, regard the terminal output π. direct rendering is supported by few X server options only.iglxenables indirect rendering (--xorgonly).virglallows GPU access for all X servers, but with limited performance and with--xconly.
-I,--network [=NET]β allow internet access. (i.e. allow Docker default.) for the optional argumentNET, see Docker documentation ofdocker runoption--network. Docker default isbridge.-l,--lang [=LOCALE]β set language variableLANG=LOCALEin the container. without an arg, the host variable--lang=$LANGis used. ifLOCALEis missing in the image,x11dockergenerates it withlocaledefin the container (needslocalespackage). examples forLOCALE:ru,en,de,zh_CN,cz,fr,fr_BE.-P,--printer [=MODE]β share host printers through the cups server. the optionalMODEcan besocketortcp. default:socket-p,--pulseaudio [=MODE]β sound withpulseaudio. needspulseaudioon host and in image. optional argMODEcan besocket,tcporhost.tcpmode needs network access with--network.--webcamβ share host webcam device files. say cheese πΈ
π Shared host folders or volumes π
-m,--home [=ARG]β create a persistentHOMEfolder for data storage. default: uses~/.local/share/x11docker/IMAGENAME.ARGcan be another host folder or a volume. (~/.local/share/x11dockerhas a softlink to~/x11docker.) (use--homebasedirto change this base storage folder.)--share=ARGβ share host file or folderARG. read-only withARG:ro. device files in/devcan be shared, too.ARGcan also be a volume instead of a host folder.
π₯οΈ X server options π₯οΈ
--autoβ automatically choose the X server (this is the default). influenced notably by options--desktop,--gpu,--wayland,--wm.-h,--hostdisplayβ share host display:0. quite bad container isolation! π least overhead of all X server options.-a,--xpraβ nested X server supporting seamless and--desktopmode.--xpra2β like--xpra --xc, but runs thexpraclient on the host.-A,--xpra-xwaylandβ like--xpra, but supports option--gpu.--xpra2-xwaylandβ like--xpra2, but supports option--gpu.-n,--nxagentβ nested X server supporting seamless and--desktopmode. faster than--xpra, but can have compositing issues. π-y,--xephyrβ nested X server for--desktopmode. without--desktop, a host window manager will be provided (option--wm).-Y,--weston-xwaylandβ desktop mode like--xephyr, but supports option--gpu. runs from console, within X and within Wayland.-x,--xorgβ core Xorg server. runs ootb from console. switch tty with<CTRL><ALT><F1>....<F12>.
β οΈ always switch to a black tty before switching to X to avoid possible crashes. fr fr, don't skip this step.
π¦ Special X server options π¦
-t,--ttyβ terminal only mode. does not run an X or Wayland server.--xvfbβ invisible X server usingXvfb. can be used for custom access withxpraorVNC.-X,--xwaylandβ blancXwayland, needs a running Wayland compositor.--xwinβ X server to run inCygwin/Xon MS Windows.--runxβ X server wrapper forVcXsrvandXwinon MS Windows.
π Wayland instead of X π
-W,--waylandβ automatically set up a Wayland environment. chooses one of the following options and regards--desktop.-T,--westonβWestonwithout X for pure Wayland applications. runs in X, in Wayland or from console.-K,--kwinβKWinwithout X for pure Wayland applications. runs in X, in Wayland or from console.-H,--hostwaylandβ share host Wayland without X for pure Wayland apps.
π¨ X and Wayland appearance options π¨
--border [=COLOR]β draw a colored border in windows ofxpra. argumentCOLORcan be e.g.orangeor#F00. thickness can be specified, too, e.g.red,3. default:blue,1--dpi=Nβ dpi value (Ndots per inch) to submit to X clients. influences font size of some applications.-f,--fullscreenβ run in fullscreen mode. give it the whole screen, it deserves it. π--output-count=Nβ multiple virtual monitors forWestonorKWin.--rotate=Nβ rotate display (--xorg,--westonand--weston-xwayland). allowed values:0,90,180,270,flipped,flipped-90,flipped-180,flipped-270. (flippedmeans mirrored)--scale=Nβ scale/zoom factorNforxpra,XorgorWeston. allowed for--xpra*and--xorg:0.25...8.0. allowed for--westonand--weston-xwayland:1...9.--size=WxHβ screen size of the new X server (e.g.800x600).-w,--wm [=ARG]β provide a host window manager to container applications. (in case of--xc, onlyopenboxis provided.) possibleARG:hostβ autodetection of a host window manager.COMMANDβ command for a desired host window manager.noneβ run without a window manager. same as--desktop.
-F,--xfishtankβ show fish tank on new X server. π iconic, no notes.
βοΈ X and Wayland special configuration βοΈ
--checkwindow [=ARG]β run container until all X windows are closed. ifARGis provided, run the container as long asgrepcan findARGin output ofxwininfo -root -children. this option helps to keep alive containers with self-forking applications likegnome-terminalor to stop endless running ones likechromium.--clean-xhostβ disable xhost access policies on host display.--composite [=yes|no]β enable or disable X extensionComposite. default isyesexcept for--nxagent. can cause or fix issues with some applications onnxagent.--display=Nβ run new X server with display numberN. must not be already in use.--keymap=LAYOUTβ set keyboard layout for the new X server, e.g.de,us,ru. for possibleLAYOUT, look at/usr/share/X11/xkb/symbols.--vt [=N]β use vt / ttyN. without optionalN, search an unused tty.--westonini=FILEβ customweston.inifor--westonand--weston-xwayland.--xhost [=STR]β set xhostSTRon the new X server (seeman xhost). without optionalSTR, will set:+SI:localuser:$USER. (use with care.--xhost=+allows access for everyone).--xoverip [=yes|no|listentcp|socat]β connect to X over TCP network. special setups only, usually only enabled byx11dockeritself.yesβ uselistentcpif possible, otherwisesocat.noβ use shared unix socket (general default).listentcpβ use X option-listen tcp.socatβ usesocatto create a fake TCP connection.
--xauth[=yes|trusted|untrusted|no]β sets up X cookie authentication, the little bouncer at the door of your display π Here's the tea on the possible arguments:yes|trustedβ turns on cookie authentication with trusted cookies. (This is the general x11docker default, bestie, so it's already serving π )untrustedβ untrusted cookie for untrusted apps, which limits their access to X resources. Lowkey the move if you wanna avoid MIT-SHM when you're using--hostdisplay.noβ disables cookie authentication entirely. Dangerous! Like, actually dangerous, not cute-dangerous π
--xtest[=yes|no]β turn the XTEST X extension on or off. Default isyesfor--xpraand--xvfb, andnofor every other X server. You literally need this to let xpra do keyboard and mouse control β¨
π Container user settings π
--group-add=GROUPβ add the container user to groupGROUP. Simple as that, no notes π«Ά--hostuser=USERβ run X (and the container user) as userUSER. Default is whatever$(logname)says. Heads up: x11docker must run as root for this to work.--password[=WORD]β change the container user's password and then exit. If you don't hand it aWORDargument it'll ask you interactively, no judgement. It's stored encrypted in~/.config/x11docker/passwdπ--sudouser[=nopasswd]β allowsuandsudofor the container user. Use with care, because this is a severe reduction of the default x11docker security, fr fr π You can optionally get passwordless sudo with the argumentnopasswd. The default password isx11docker.--user=Uβ create container userU(whereUis a name or a uid). Default is the same as the host user.Ucan also be an unknown user id, wild but okay. You can specify a group id by makingUbeuser:gid. And special case, iconique behaviour incoming:--user=RETAINkeeps the image's user settings π
π₯ Container capabilities π₯
In most setups x11docker sets --cap-drop=ALL and --security-opt=no-new-privileges, and it will show warnings if it's doing anything else. Custom capabilities can be added with --cap-add=CAP after -- β¨
--cap-defaultβ allow the default container capabilities. This includes--newprivileges=yes.--ipc[=ARG]β with no optionalARGit sets the run option--ipc=host, which is discouraged, just so you know π For the other possibleARGvalues, go check thedocker runreference.--limit[=FACTOR]β caps the CPU and RAM usage of the container at currently free RAM ΓFACTORand available CPUs ΓFACTOR. Allowed range is0 < FACTOR <= 1. If you use--limitwith noFACTORargument, the default is0.5πΈ--newprivileges[=yes|no|auto]β sets or unsets the run option--security-opt=no-new-privileges. With no argument the default isyes. In most cases the default isno.
π§ Container init system, elogind and DBus daemon π§
--dbus[=system]β runs the DBus user session daemon for the container command. With the argumentsystemit also runs a DBus system daemon. (If you actually want to run a DBus system daemon, better to reach for one of--init=systemd|openrc|runit|sysvinitinstead π«Ά)--hostdbusβ connect to the DBus user session from the host.--init[=tini|systemd|openrc|runit|sysvinit|s6-overlay|none]β run an init system as PID 1 in the container. This solves the zombie reaping issue, because yes, zombies are real and yes, they need dealing with π By default x11docker usestinior the similarcatatonit.--sharecgroupβ share/sys/fs/cgroup. This allows elogind inside the container if you use it together with one of--init=openrc|runit|sysvinit.
π Container special configuration: π
--env VAR=valueβ set a custom environment variable.--name=NAMEβ specify the container nameNAME.--no-entrypointβ disableENTRYPOINTin the image so other commands work too.--no-setupβ no x11docker setup inside the running container. This disallows several other options. See also--user=RETAIN.--runtime=RUNTIMEβ specify the container runtime. Ones x11docker knows about:runcβ default runtime of docker.crunβ default runtime of podman.nvidiaβ runtime fornvidia/nvidia-dockerimages.sysbox-runcβ runtime for powerful root in container π
--shell=SHELLβ set the preferred user shell. Example:--shell=/bin/zsh--snapβ enable support for Docker in snap.--stdinβ forward the stdin of x11docker to the container command.--workdir=DIRβ set the working directory toDIR.
π Additional commands π
You might need to move these to the background with CMD & π
--runasroot=CMDβ run commandCMDas root in the container.--runasuser=CMDβ run commandCMDwith user privileges in the container, before running the image command.--runfromhost=CMDβ run host commandCMDon a new X server.
β¨ Miscellaneous β¨
--build IMAGEβ build an image from a Dockerfile from the x11docker repository. Example:x11docker --build x11docker/fvwm .This works for all repositories beginning withdockerfileathttps://github.com/mviereck?tab=repositories. It only regards (only) the option--backend=BACKEND, bestie, that's the whole story.--cachebasedir=DIRβ custom base folder for cache files.--homebasedir=DIRβ custom base folder for the option--home.--fallback[=yes|no]β allow or deny fallbacks when a chosen option can't be fulfilled. By default, fallbacks are allowed π«Ά--launcherβ create an application launcher with the current options on the desktop, then exit. You can get a menu entry by moving the created*.desktopfile into~/.local/share/applicationsπΈ--mobyvmβ use MobyVM (for WSL2 only, that defaults to Linux Docker).--preset=FILEβ read a set of predefined options stored in fileFILE. So useful for shortcutting your often-used option combos, honestly iconic π
FILE is searched in the directory /etc/x11docker/preset, or in the directory ~/.config/x11docker/preset.
Multiple lines in FILE are allowed.
Comment lines must begin with # .
Local presets supersede global ones in /etc .
Special case: a preset file with the file name default will be applied automatically for all x11docker sessions π
π Output of parseable information on stdout π
You get output like this, for example: read xenv < <(x11docker --printenv x11docker/check) . The optional argument FILE lets you print the information into a file.
--printenv[=FILE]β print variables to access the new display.--printid[=FILE]β print container ID.--printinfofile[=FILE]β print path to internal x11docker info storage.--printpid1[=FILE]β print host PID of container PID 1.
π¦ Verbosity options π¦
-D,--debugβ enable rigorous error control and show some debug output.--printcheckβ show dependency check messages.-q,--quietβ suppress x11docker terminal messages π€«-v,--verboseβ be verbose. Output ofx11docker.logon stderr.-Vβ be verbose with colored output π
π§Ό Cleanup options (might need root permissions) π§Ό
--cleanupβ clean up orphaned containers and cache files. Those can linger around if x11docker is still running when the system shuts down, lowkey tragic. It terminates currently running x11docker containers too. It regards (only) the option--backend=BACKEND.
π Installation options (need root permissions) π
These options might not be available in packaged versions of x11docker, just so you know π«Ά
--installβ install x11docker from the current folder. Super useful for installing from an extracted zip file.--update[=diff]β download and install the latest release from github.--update-master[=diff]β download and install the latest master version. The optional argumentdiffshows the difference between the installed and new version without installing it π--removeβ remove x11docker from your system. This includes--cleanup. It preserves~/.local/share/x11dockerfrom the option--home.--remove-oldprefixβ before version 7.6.0 x11docker installed itself into/usr/bin. Now it installs into/usr/local/bin. Use--remove-oldprefixto remove/usr/bininstallations.
πΈ DEPENDENCIES πΈ
Package names and further optional dependencies live at: https://github.com/mviereck/x11docker/wiki/Dependencies
π Dependencies on host: π
For core functionality x11docker only needs bash, an X server and one of docker, podman or nerdctl. Depending on the chosen options x11docker might need some additional tools. It checks for them on startup and shows messages if some are missing, so you won't be left guessing π
- Most recommended: provide the image
x11docker/xserverto run X or Wayland in the container. The image contains all X related dependencies. Obsessed, honestly.
Otherwise, provide on host:
- Recommended to allow security and convenience:
- X servers: some of:
nxagentxpraXephyrXorg - Tools: all of:
xauthxclipxrandrxhostxinitcatatonit
- X servers: some of:
- Additionally for advanced GPU support:
westonXwaylandxpraxdotool
π Dependencies in image: π
No dependencies in image except for a few feature options. The most important ones:
--gpu: OpenGL/MESA packages, often collected in themesa-utilspackage. For closed source NVIDIA support look athttps://github.com/mviereck/x11docker/wiki/NVIDIA-driver-support-for-docker-container--pulseaudio: needspulseaudioon host andpulseaudioclient libs in image.--printer: needscupson host andcupsclient libs in image.
β¨ EXIT CODES β¨
0β Success π64β x11docker error130β Terminated by ctrl-c- other β Exit code of command in container
π₯ EXAMPLES π₯
FVWM window manager:
x11docker --desktop x11docker/fvwm
Xfce desktop:
x11docker --desktop x11docker/xfce
Accelerated glxspheres:
x11docker --gpu x11docker/check glxspheres64
Kodi media center with hardware acceleration, pulseaudio sound, shared Videos folder and persistant HOME:
x11docker --gpu --pulseaudio --home --share=~/Videos erichough/kodi
Firefox with shared Downloads folder and internet access:
x11docker -I --share $HOME/Downloads -- --tmpfs /dev/shm -- jess/firefox
π AUTHOR π
Written by Martin Viereck, Germany. Legend behaviour π«Ά
π REPORTING BUGS π
Please report issues and get help at: https://github.com/mviereck/x11docker/issues
π COPYRIGHT π
x11docker is published under the MIT licence. Check the output of x11docker --licence . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
π¦ SEE ALSO π¦
Further documentation at:
And that's the whole page, bestie β the X11DOCKER(1) manual, sourced from the x11docker project, dated as it is, and now fully in your brain π
β¨ Go forth and containerize responsibly, no cap π
π¦ where this page comes from
- fedora 43: x11docker 7.6.0-6.fc43 Β· MIT
- fedora 44: x11docker 7.6.0-7.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms