| SCROTWMD(8) | System Manager's Manual | SCROTWMD(8) |
NAME
scrotwmd —
scrotwmos session display server
SYNOPSIS
scrotwmd |
[-f fd |
-s socket |
-g] |
DESCRIPTION
scrotwmd is the display server inside a
session. The programs of a container or a virtual machine talk Wayland to
scrotwmd, which has no screen of its own. It ships
their windows to the host compositor,
swm-wl(1), and takes their keyboard and
pointer input back, over the bus. It tells the host when a program's menu
opens and closes. A press outside the session's windows then closes the
menu. For X11 programs, it starts
/usr/bin/xwayland-satellite when the image has it.
Without it, X11 programs fail.
The root monitor starts scrotwmd for each
container session, and the guest starts it in a VM. Nobody runs it by hand.
In a virtual machine built from the scrotwmos initramfs,
scrotwmd is also the guest's first process: it
mounts the guest's disk, makes the session user's home, and runs itself
again with -g. The second copy, still root, maps the
VMM's pixel window and opens the bus on the console port, then drops to the
session user.
The options are as follows:
-ffd- The bus, already connected, on descriptor fd. Every host-side launcher passes it.
-g- Run as a virtual machine's guest, with the bus on the guest's console port.
-ssocket- Listen for the bus on the unix socket socket, for tests.
With none of -f,
-g, or -s,
scrotwmd listens on
/tmp/scrotwmd.sock. scrotwmd
serves one bus connection. When it listens, it accepts one connection,
closes the socket, and removes it at exit. When the bus closes,
scrotwmd shuts down as on
SIGTERM and exits 0.
Rendering
scrotwmd composites the windows into one
frame. It builds a frame only when something on screen changed or a program
asked for one. It builds none while every window is hidden. With a GPU
render node in /dev/dri, it draws with the GPU
(OpenGL ES 2), else with the CPU (pixman). Its log says which and why, for
example “renderer gles2 (i915)” or “renderer pixman (no
render node)”.
The log also says how frames reach the host compositor. When the host draws with the same GPU and offers it, each frame goes over in the GPU's own memory, with no copy: “frames as dma-bufs”. In a VM, the log says what a frame waits on, for example “a frame waits on its native fence (native context)”. Otherwise, with the GPU, each frame is read back into the host compositor's memory, and the log says why, for example “frames copied (dom0 offers no modifier)”.
When the GPU is lost, scrotwmd builds the
renderer again. After the third loss, it builds no more frames.
ENVIRONMENT
scrotwmd creates its own Wayland socket
and gives its name to the programs it starts in
WAYLAND_DISPLAY. They also get
DISPLAY when its X server runs,
XDG_RUNTIME_DIR as scrotwmd
has it or else /tmp,
XDG_ACTIVATION_TOKEN when it made one, and
CHROME_FLAGS from
/etc/scrotwmos/chromium-flags when that file is
valid. In a VM whose GPU path is Venus, they also get
MESA_LOADER_DRIVER_OVERRIDE=zink.
Of the rest of its environment, only a fixed list passes:
PATH, HOME,
USER, SHELL,
TERM, the locale, the D-Bus address,
SWM_DM_TAG, and a few GTK, Qt, and Mesa settings.
LD_PRELOAD and the other loader variables never
pass. Outside a guest, a HOME or
USER it lacks comes from the password file.
FILES
- /etc/scrotwmos/chromium-flags
- Chromium's flags, given to each program as
CHROME_FLAGS: one line of at most 256 bytes, words separated by single spaces, each--nameor--name=value, the name of lowercase letters, digits, and hyphens, the value of digits and dots. A file of any other form gives no flags, and the log says so once. - /tmp/scrotwmd.sock
- the bus socket with no option
- /usr/bin/xwayland-satellite
- the X server for X11 programs
SIGNALS
SIGINT,SIGTERM- Shut down, as on the bus's shutdown: each window is asked to close, then
the programs it started get
SIGHUP, thenSIGTERM, thenSIGKILL, 12 seconds at most, the display up until they are gone. Chromium's browser, Wayland or X11, getsSIGHUPfirst, not a close to each window, so it saves every window. An X11 Chromium's windows are asked to close once it is gone.
EXIT STATUS
The scrotwmd utility exits 0 on
success, and >0 if an error occurs.
As a guest's first process, it does not exit. When its
-g copy exits 0, it powers the guest off. When that
copy ends any other way, it reboots the guest.
SEE ALSO
scrotwmctl(1), swm-wl(1), scrotwmos.conf(5), scrotwmos(7), swm-vmm(8), vmm-gfx(8)
AUTHORS
Marco Peereboom <marco@peereboom.us>
| October 9, 2026 | Void Linux |