man(8)
π Xdummy β from the man(8) girlies π
okay bestie, buckle up, because this one is a whole journey π
β¨ NAME β¨
Xdummy β a hack to run Xorg or XFree86 X server with the "dummy" video driver. that's it, that's the name, it's giving chaos but make it β¨functionalβ¨
β¨ SYNOPSIS β¨
Xdummy <Xdummy-args> <Xserver-args>
β¨ DESCRIPTION β¨
okay so. Xdummy is a hack that lets you run a stock Xorg(1) or XFree86(1) X server with the "dummy" (RAM-only framebuffer) video driver, and the way it does that means it AVOIDS all the cursed stuff: the Linux VT switching, opening device files in /dev, keyboard and mouse conflicts, and every other problem that normally comes with using "dummy". no cap.
in other words, it's trying to make Xorg/XFree86 with the "dummy" device driver act way more like Xvfb(1). bestie glow-up fr fr π
the primary motivation for the Xdummy script is to give x11vnc a virtual X server, but with more features than Xvfb (or Xvnc) β though honestly you could use it for other reasons too (e.g. better automated testing than with Xvfb). and one thing that is lowkey iconic: the dummy server supports RANDR dynamic resizing while Xvfb does not. slay.
so for example, x11vnc+Xdummy terminal services are a little better than x11vnc+Xvfb. periodt.
to pull this off, while running the real Xserver, Xdummy intercepts system and library calls via the LD_PRELOAD method and modifies the behavior to make it work correctly (e.g. avoid the VT stuff). but listen β LD_PRELOAD tricks are usually "clever hacks" and so might not work in all situations or break when something changes. π
WARNING: take care in usingXdummy, although it never has it is possible that it could damage hardware. π one can use the-prconfoption to have it print out thexorg.confconfig that it would use and then inspect it carefully before actually using it. do that. please. π«Ά
this program no longer needs to be run as root as of 12/2009. however, if there are problems for certain situations (usually older servers) it may perform better if run as root (use the -root option.) when running as root remember the previous paragraph and that Xdummy comes without any warranty. π
gcc/cc and other build tools are required for this script to be able to compile the LD_PRELOAD shared object. be sure they are installed on the system. see -install and -uninstall described below. π
your Linux distribution may not install the dummy driver by default, e.g:
/usr/lib/xorg/modules/drivers/dummy_drv.so
some have it in a package named xserver-xorg-video-dummy you that need to install. (yes that's the original wording, we don't edit, we preserve πΈ)
β¨ OPTIONS β¨
π Xdummy-args:
-installβ compile theLD_PRELOADshared object and install it next to theXdummyscript file as:
/usr/bin/Xdummy.so
when that file exists it is used as the LD_PRELOAD shared object without recompiling. otherwise, each time Xdummy is run the LD_PRELOAD shared object is compiled as a file in /tmp (or -tmpdir).
if you set the environment variable INTERPOSE_GETUID=1 when building, then when Xdummy is run as an ordinary user, the shared object will interpose getuid() calls and pretend to be root. otherwise it doesn't pretend to be root. (gaslight gatekeep getuid β¨)
you can also set the CFLAGS environment variable to anything else you want on the compile cmdline.
-uninstallβ remove the file:
/usr/bin/Xdummy.so
the LD_PRELOAD shared object will then be compiled each time this program is run.
the X server is not started under-install,-uninstall, or-prconf. nope. not happening. π
:Nβ the DISPLAY (e.g.:15) is often the first argument. it is passed to the real X server and also used by theXdummyscript as an identifier.-geomgeom1[,geom2...] β take the geometry (e.g.1024x768) or list of geometries and insert them into theScreensection of the tweaked X server config file. use this to have a different geometry than the one(s) in the system config file.
the option -geometry can be used instead of -geom; x11vnc calls Xdummy and Xvfb this way. iykyk π
-nomodelinesβ when you specify-geom/-geometry,Xdummywill create Modelines for each geometry and put them in theMonitorsection. if you do not want this then supply-nomodelines.-depthn β use pixel color depth n (e.g.8,16, or24). this makes sure the X config file has aScreen.Displaysubsection of this depth. note this option is ALSO passed to the X server. π«Ά-DEPTHn β same as-depth, except not passed to X server.-tmpdirdir β specify a temporary directory, owned by you and only writable by you. this is used in place of/tmp/Xdummy.$USER/..to place theXdummy.soshared object, tweaked config files, etc.-nonrootβ run in non-root mode (working12/2009, now default) π-rootβ run as root (may still be needed in some environments.) same asXDUMMY_RUN_AS_ROOT=1.-nosudoβ do not try to usesudo(1)when re-running as root, usesu(1)instead.-xserverpath β specify the path to the Xserver to use. default is to try"Xorg"first and then"XFree86". if those are not in$PATH, it tries these locations:
/usr/bin/Xorg
/usr/X11R6/bin/Xorg
/usr/X11R6/bin/XFree86
-nβ do not run the command to start the X server, just show the command thatXdummywould run. theLD_PRELOADshared object will be built, if needed. also note anyXDUMMY*environment variables that need to be set.-prconfβ print, to stdout, the tweakedXorg/XFree86config file (-configand-xf86configserver options, respectively.) the Xserver is not started.-notweakβ do not tweak (modify) theXorg/XFree86config file (system or server command line) at all. the-geomand similar config file modifications are ignored.
it is up to you to make sure it is a working config file (e.g. "dummy" driver, etc.) perhaps you want to use a file based on the -prconf output. main character responsibility energy π€
-debugβ extra debugging output.-straceβstrace(1)the Xserver process (for troubleshooting.)-ltraceβltrace(1)instead ofstrace(can be slow.)-h,-helpβ print out this help.
πΈ Xserver-args:
most of the Xorg and XFree86 options will work and are simply passed along if you supply them. important ones that may be supplied if missing:
:Nβ X Display number for server to use.vtNNβ Linux virtual terminal (VT) to use (a VT is currently still used, just not switched to and from.)-configfile β driver"dummy"tweaked config file, a number of settings are tweaked besidesDriver.-xf86configfile β same vibe as-config, theXFree86-flavored spelling.
if -config/-xf86config is not given, the system one (e.g. /etc/X11/xorg.conf) is used. if the system one cannot be found, a built-in one is used. any settings in the config file that are not consistent with "dummy" mode will be overwritten (unless -notweak is specified.)
use -config xdummy-builtin to force usage of the builtin config. β¨
if "file" is only a basename (e.g. "xorg.dummy.conf") with no /'s, then no tweaking of it is done: the X server will look for that basename via its normal search algorithm. if the found file does not refer to the "dummy" driver, etc, then the X server will fail. π
β¨ EXAMPLES: β¨
Xdummy -install
Xdummy :1
Xdummy -debug :1
Xdummy -tmpdir ~/mytmp :1 -nolisten tcp
π¦ startx example:
startx -e bash -- Xdummy :2 -depth 16
(if startx needs to be run as root, you can su(1) to a normal user in the bash shell and then launch ~/.xinitrc or ~/.xsession, gnome-session, startkde, startxfce4, etc.)
π¦ xdm example:
xdm -config /usr/local/dummy/xdm-config -nodaemon
where the xdm-config file has line:
DisplayManager.servers: /usr/local/dummy/Xservers
and /usr/local/dummy/Xservers has lines:
:1 local /usr/local/dummy/Xdummy :1 -debug
:2 local /usr/local/dummy/Xdummy :2 -debug
(-debug is optional)
π¦ gdm/kdm example:
TBD.
π¦ Root permission and x11vnc:
Update: as of 12/2009 this program no longer must be run as root. so try it as non-root before running it as root and/or the following schemes. π«Ά
in some circumstances X server program may need to be run as root. if so, one could run x11vnc as root with -unixpw (it switches to the user that logs in) and that may be OK, some other ideas:
- add this to
sudoviavisudo:
ALL ALL = NOPASSWD: /usr/local/bin/Xdummy
- use this little suid wrapper:
/*
* xdummy.c
*
cc -o ./xdummy xdummy.c
sudo cp ./xdummy /usr/local/bin/xdummy
sudo chown root:root /usr/local/bin/xdummy
sudo chmod u+s /usr/local/bin/xdummy
*
*/ #include <unistd.h> #include <stdlib.h> #include <sys/types.h>
#include <stdio.h>
int main (int argc, char *argv[]) {
extern char **environ;
char str[100];
sprintf(str, "XDUMMY_UID=%d", (int) getuid());
putenv(str);
setuid(0);
setgid(0);
execv("/usr/local/bin/Xdummy", argv);
exit(1);
return 1; }
β¨ NOTES β¨
the Xorg/XFree86 "dummy" driver is currently undocumented. it works well in this mode, but it is evidently not intended for end-users. so it could be removed or broken at any time. π (no thoughts, just vibes, and the vibes are fragile)
if the display Xserver-arg (e.g. :1) is not given, or ":" is given that indicates Xdummy should try to find a free one (based on tcp ports.)
if the display virtual terminal, VT, (e.g. vt9) is not given that indicates Xdummy should try to find a free one (or guess a high one.)
this program is not completely secure WRT files in /tmp (but it tries to a good degree.) better is to use the -tmpdir option to supply a directory only writable by you. even better is to get rid of users on the local machine you do not trust :-) π₯
set XDUMMY_SET_XV=1 to turn on debugging output for this script.
okay that's the whole page bestie, you ate it up π
β¨ this was version 1.0, dated 19 Mar 2019, from the man(8) manual β Xdummy man page, love her, protect her, run her as non-root first πππ¦
π¦ where this page comes from
- debian bookworm: x11vnc 0.9.16-9 Β· GPL-2.0-only
- debian trixie: x11vnc 0.9.17-1 Β· GPL-2.0-only
- ubuntu jammy: x11vnc 0.9.16-8 Β· GPL-2.0-only
- ubuntu noble: x11vnc 0.9.16-10 Β· GPL-2.0-only
- ubuntu questing: x11vnc 0.9.17-1
- ubuntu resolute: x11vnc 0.9.17-2 Β· GPL-2.0-or-later
- ubuntu stonking: x11vnc 0.9.17-3build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms