nxagent(1)
๐ nxagent ๐
okay so you wanna know about nxagent โ the NX Agent (Xserver), manual section 1. buckle up bestie, this one's a whole journey ๐ฆ
โจ NAME โจ
nxagent โ a nested Xserver optimized for remote computing. that's it, that's the name, slay ๐
๐ธ SYNOPSIS ๐ธ
nxagent [options]
๐ DESCRIPTION ๐
okay so nxagent is an X server for remote application/desktop access, and it's basically in the same friend group as Xnest or Xephyr. same vibe, different energy โจ
here's the tea: nxagent implements a very efficient compression of the X11 protocol, and that compression is called the NX protocol. no cap.
the NX protocol is what makes your X applications actually usable over high latency and low bandwidth networks, and it still gives you that local, LAN-like usage experience even when you're connecting from completely off-site locations (think cable modem or GSM). it's giving โจmagicโจ honestly.
nxagent can totally be used standalone as a nested X server (with NX protocol disabled) โ that works fine โ but its real benefits? those show up when you use it over remote connections via the nxcomp compression library. the counterpart application on the other end (i.e. the client) is called nxproxy. they're a duo, iykyk ๐ซถ
when it's used in proxy <-> agent mode, nxagent adds the feature of being suspendible. sessions can be started from one client, suspended, and then resumed from another (or the same) client. iconic behavior, truly ๐
nxagent and nxproxy are utilized by various remote application/desktop frameworks for providing server-side GUI application access from remote client systems.
and currently, nxagent is co-maintained by three of these projects: The Arctica Project, TheQVD, and X2Go. three whole parents, main character energy fr fr ๐
๐ฆ STARTING THE SERVER ๐ฆ
nxagent should be run in user space. other than the system's local X.org server, nxagent does not require to be run as root. we love a low-maintenance icon ๐
when it's bundled with a remote application framework, you normally don't have to launch nxagent manually. nxagent startup is usually managed by the underlying framework (e.g. Arctica Session Manager, X2Go Server, etc.). so like... it just happens. gorgeous.
when nxagent starts up (e.g. by typing nxagent -ac :1 in a terminal window), it typically launches in "windowed desktop" mode. on your local X server, a new window appears โ and that window is itself an X server. windowception ๐ญ
however, nxagent also supports rootless (or seamless) application mode and a shadow session mode (similar to what VNC does).
Example: you can launch a complete desktop session inside this nested X server right now:
The Debian way...
$ export DISPLAY=:1
$ STARTUP=mate-session /etc/X11/Xsession
The Fedora / Gentoo / openSUSE way...
### FIXME / TODO ###
however, nxagent also supports rootless (or seamless) application mode and a shadow session mode (similar to what VNC does).
๐ OPTIONS ๐
nxagent accepts a range of default X server options as described below. those default options have to be provided via the command line. periodt.
furthermore, nxagent accepts some nx-X11 specific options, described further below.
last but not least, nxagent accepts several more options, the so-called nx/nx options, provided via the $DISPLAY environment variable or the -options command line option. see below for further details. okay? okay. ๐
๐ฅ STANDARD XSERVER OPTIONS ๐ฅ
:displaynumberโ the X server runs as the given displaynumber, which by default is0. if multiple X servers are to run simultaneously on a host, each must have a unique display number. see theDISPLAY NAMESsection of theX(__miscmansuffix__)manual page to learn how to specify which display number clients should try to use. โจ-a numberโ sets pointer acceleration (i.e. the ratio of how much is reported to how much the user actually moved the pointer).-acโ disables host-based access control mechanisms. enables access by any host, and permits any host to modify the access control list.
bestie. use with extreme caution. ๐ญ this option exists primarily for running test suites remotely.
-audit levelโ sets the audit trail level. the default level is1, meaning only connection rejections are reported. level2additionally reports all successful connections and disconnects. level4enables messages from theSECURITYextension, if present, including generation and revocation of authorizations and violations of the security policy. level0turns off the audit trail. audit lines are sent as standard error output.-auth authorization-fileโ specifies a file which contains a collection of authorization records used to authenticate access. see also thexdm(1)andXsecurity(__miscmansuffix__)manual pages.-bsโ disables backing store support on all screens.-brโ sets the default root window to solid black (default).-wrโ sets the default root window to solid white.-cโ turns off key-click.c volumeโ sets key-click volume (allowable range:0-100).-cc classโ sets the visual class for the root window of color screens. the class numbers are as specified in the X protocol. not obeyed by all servers.-co filenameโ this used to be the option for specifying the path to the RGB color database file. as the RGB color database is now embedded into the binary, this option has no effect but is kept for compatibility.
deprecated ๐
-coreโ causes the server to generate a core dump on fatal errors.-displayfd fdโ specifies a file descriptor in the launching process. rather than specifying a display number, the X server will attempt to listen on successively higher display numbers, and upon finding a free one, will write the port number back on this file descriptor as a newline-terminated string. the-pnoption is ignored when using-displayfd.
nxagent specific:
- other than in X.org's Xserver, you can use
-displayfdin conjunction with an explicit display number. if the explicit display number is not available (i.e., already in use),nxagenttries to figure out the next available display number,
e.g.:
nxagent -displayfd 2 :50
- if
-displayfd <X>is given with<X>equaling2(STDERR), then the display number string written to STDERR is beautified with some human-readable (machine-parseable) text. cute AND useful ๐
-syncโ this option tellsnxagentto synchronize its window and graphics operations with the real server. this is a useful option for debugging, but it will slow downnxagent's performance considerably. it should not be used unless absolutely necessary.
ngl it's giving "i'll be here a while" ๐ญ
-fullโ this option tellsnxagentto utilize full regeneration of real server objects and reopen a new connection to the real server each timenxagentregenerates. the sample server implementation regenerates all objects in the server when the last client of this server terminates. when this happens,nxagentby default maintains the same top-level window and the same real server connection in each new generation. if the user selects full regeneration, even the top-level window and the connection to the real server will be regenerated for each server generation.-class stringโ this option specifies the default visual class of the nested server. it is similar to the-ccoption from the set of standard options except that it will accept a string rather than a number for the visual class specification. the string must be one of the following six values:StaticGray,GrayScale,StaticColor,PseudoColor,TrueColor, orDirectColor. if both the-classand-ccoptions are specified, the last instance of either option takes precedence. the class of the default visual of the nested server need not be the same as the class of the default visual of the real server, but it must be supported by the real server. usexdpyinfo(__appmansuffix__)to obtain a list of supported visual classes on the real server before startingnxagent. if the user chooses a static class, all the colors in the default color map will be preallocated. if the user chooses a dynamic class, colors in the default color map will be available to individual clients for allocation.-deferglyphs whichfontsโ specifies the types of fonts for which the server should attempt to use deferred glyph loading. whichfonts can beall(all fonts),none(no fonts), or16(16 bit fonts only).-depth intโ this option specifies the default visual depth of the nested server. the depth of the default visual of the nested server need not be the same as the depth of the default visual of the real server, but it must be supported by the real server. usexdpyinfo(__appmansuffix__)to obtain a list of supported visual depths on the real server before startingnxagent.-geometry WxH+X+Yโ this option specifies the geometry parameters for the top-levelnxagentwindow. see "GEOMETRY SPECIFICATIONS" inX(__miscmansuffix__)for a discusson of this option's syntax. this window corresponds to the root window of the nested server. the width W and height H specified with this option will be the maximum width and height of each top-levelnxagentwindow.nxagentwill allow the user to make any top-level window smaller, but it will not actually change the size of the nested server root window. if this option is not specified,nxagentwill choose W and H to be 3/4ths the dimensions of the root window of the real server. for further values accepted see the documentation ofgeometry=<string>below.-dpi resolutionโ sets the resolution for all screens, in dots per inch. if this option is not specifiednxagentwill assume96. there's also-autodpiwhich will clone the real server's dpi.
heads up bestie: the resolution specified via -dpi is a per session setting. it cannot be changed on reconnect! this means that clients may look "wrong" when reconnecting a session that had been started with a different dpi than the current real xserver. ๐
dpmsโ enables DPMS (display power management services), where supported. the default state is platform and configuration specific.-dpmsโ disables DPMS (display power management services). the default state is platform and configuration specific.-f volumeโ sets feep (bell) volume (allowable range:0-100).-fc cursorFontโ sets default cursor font.-fn fontโ sets the default font.-fpfontPath โ sets where the server goes hunting for fonts. It's a comma separated list of directories, and the X server scours them for font databases. The full tea and the default list live in the FONTS section of this page. ๐-helpโ prints a usage message. that's it, that's the whole job ๐-Iโ makes every remaining command line argument get ignored. just like, gone. ๐-maxbigreqsizesize โ sets the maximum big request to size MB.-namestring โ names the top-level nxagent window string. default is the program name.-nolistentrans-type โ disables a transport type. like, TCP/IP connections get shut down with-nolisten tcp. you can throw this one multiple times to disable different transport types, no cap.-noresetโ stops a server reset from happening when the last client connection closes. this one overrides an earlier-terminatecommand line option.-pminutes โ sets the screen-saver pattern cycle time, in minutes.-pnโ lets the server keep running even if it can't establish all of its well-known sockets (those are the connection points for clients) โ as long as it gets at least one. this one is set by default โจ-nopnโ makes the server exit if it fails to establish all of its well-known sockets (connection points for clients). so, the opposite vibe.-rโ turns off auto-repeat.rโ turns on auto-repeat. (no dash bestie, it's literally justr๐ญ)-sminutes โ sets the screen-saver timeout time, in minutes.-suโ disables save under support on all screens.-tnumber โ sets the pointer acceleration threshold in pixels, i.e. after how many pixels the pointer acceleration should kick in.-terminateโ makes the server terminate at server reset instead of just continuing to run. overrides an earlier-noresetcommand line option.-toseconds โ sets the default connection timeout in seconds.-tstโ disables all testing extensions.vโ sets video-off screen-saver preference.-vโ sets video-on screen-saver preference.-wmโ forces the default backing-store of all windows to beWhenMapped. it's basically a backdoor way of getting backing-store to apply to all windows. so even though all mapped windows will have backing store, the backing store attribute value reported by the server for a window will be the last value established by a client. if it has never been set by a client, the server reports the default value,NotUseful. this behavior is required by the X protocol, which lets the server exceed the client's backing store expectations but doesn't give it a way to tell the client that it's doing so. ๐[+-]xineramaโ enables (+) or disables (-) XINERAMA provided via the PanoramiX extension. this is set to off by default.[+-]rrxineramaโ enables (+) or disables (-) XINERAMA provided via the RandR extension. by default this feature is enabled. to disable XINERAMA completely, make sure you use both options (-xineramaand-rrxinerama) on the command line. both. don't skip one. ๐ซถ
๐ SERVER DEPENDENT OPTIONS ๐
nxagent also accepts these non-standard options, bestie:
-logoโ turns on the X Window System logo display in the screen-saver. there is currently no way to change this from a client.nologoโ turns off the X Window System logo display in the screen-saver. again, there is currently no way to change this from a client.-renderdefault|mono|gray|color โ sets the color allocation policy that the render extension will use:defaultโ selects the default policy defined for the display depth of the X server.monoโ don't use any color cell.grayโ use a gray map of 13 color cells for the X render extension.colorโ use a color cube of at most4*4*4colors (that is 64 color cells).
-dumbSchedโ disables smart scheduling on platforms that support the smart scheduler.-schedIntervalinterval โ sets the smart scheduler's scheduling interval to interval milliseconds.
๐ NXAGENT SPECIFIC OPTIONS ๐
the nx-X11 system adds these command line arguments, and honestly? iconic. ๐
-forcenxโ force use of NX protocol messages, assuming communication throughnxproxy.-idstring โ the session id.-autograbโ enable autograb mode on nxagent startup. the autograb feature can be toggled via nxagent keystrokes.-textclipboardโ force text-only clipboard nxagent startup. see option file optiontextclipboard=<bool>for an explanation.-nxrealwindowpropโ set propertyNX_REAL_WINDOWfor each X11 client inside nxagent, providing the window XID of the corresponding window object on the X server that nxagent runs on.-reportwidsโ explicitly tells nxagent to report its externally exposed X11 window IDs to the session log (in machine readable form), so that external parsers can obtain that information from there.-reportprivatewidsโ explicitly tells nxagent to report X11 window IDs of internally created window objects to the session log (in machine readable form), so external parsers can obtain that information from there. heads up tho: this creates a lot of output and may affect performance. ๐-timeoutint โ auto-disconnect timeout in seconds (minimum allowed:60). default is0(no timeout).-norootlessexitโ don't exit if there are no clients in rootless mode.-autodpiโ detect the real server's DPI and set it in the agent session; the-dpicmdline option overrides-autodpi. note that using-autodpiwill also adapt the DPI on reconnect, which will cause newly started clients to respect the new DPI while clients that had been started before the reconnect still use the old DPI. this may lead to applications looking "weird". ๐-nomagicpixelโ disable magic pixel support at session startup; can be re-enabled via nx/nx option on session resumption.-norenderโ disable the use of the render extension.-nocomposite/-compositeโ disable/enable the use of the composite extension (default is disabled).-nopersistentโ disable disconnection/reconnection to the X display onSIGHUP. non-persistent sessions will terminate onSIGHUP.-noshmemโ disable use of shared memory extension.-shmemโ enable use of shared memory extension (default).-noshpixโ disable use of shared pixmaps.-shpixโ enable use of shared pixmaps (default).-noignoreโ don't ignore pointer and keyboard configuration changes mandated by clients. so as a result, configuration commands like disabling the keyboard bell (xset -b) will also affect the real X server. ๐ฎ-nokbresetโ don't reset the keyboard device if the session is resumed.-noxkblockโ this is only relevant if you also specify-keyboard=query. in that case nxagent will lock the keyboard settings and clients will get an error when trying to change keyboard settings via XKEYBOARD. with-noxkblockthe lock is not applied and clients are allowed to change the keyboard settings through XKEYBOARD.-tileWxH โ maximum size of the tile used when sending an image to the remote display (minimum allowed:32x32). the default depends on the link type:64x64for modem and isdn,4096x4096for all other link types.-irlimitโ maximum image data rate to the encoder input in kB/s. the default is no limit.-Dโ enable desktop mode (default).-Rโ enable rootless mode.-Sโ enable shadow mode.-Bโ enable proxy binding mode.-keystrokefileโ define path to a keyboard shortcut definitions file. default is~/.nx/keystrokes.cfgand/etc/nxagent/keystroke.cfg(first existing file is taken). if nxagent is run as x2goagent the defaults are~/.x2go/keystrokes.cfgand/etc/x2go/keystrokes.cfg. any keystrokes nxagent knows about that are not defined in this file are ignored. (only) if no file is found, built-in defaults are used. the keystroke file can be re-read by a keystroke (ctrl-alt-kby default). seeREADME.keystrokesandREADME.keystrokes.debugfor all keystrokes nxagent knows. at startup the active keystrokes are printed to the session output.-versionโ show version information and exit.-optionsfilepath|string โ path to an options file containing nx/nx options (see below). instead of a path, the options can be specified directly on the commandline by prefixing the options strings withnx/nx, which is mostly useful for testing/debugging.
okay so besides the command line options, nxagent can also be configured at session startup and at runtime (i.e. when resuming a suspended session) by these so-called nx/nx options. the options file is read on startup. it can be modified during runtime (but it must stay at the same path). on re-connect the modified file is then read and the changed options are applied. โจ
as nx/nx options, all options supported by nxcomp (see the nxproxy man page) and all nxagent nx/nx options (see below) can be used. when launching an nxcomp based nxagent session (i.e. proxy <-> agent), you will normally set the $DISPLAY variable like this:
$ export DISPLAY=nx/nx,listen=<proxy-port>,options=<options.file>:<nx-display-port>
$ nxagent <command-line-options> :<nx-display-port>
the value for <nx-display-port> is some value of a not-yet-used X11 display (e.g. :50). ๐ฆ
using an options file is recommended, but you can also put available nx/nx options (see below) into the DISPLAY variable directly. note that the $DISPLAY variable field is of limited length.
as <proxy-port> you can pick an arbitrary (unused) TCP port or Unix socket file path. this is the port/socket that you have to connect to with the nxproxy application.
the right hand side of an option (the part following the = character) can include URL encoded characters. it is required to URL encode at least , (as %2D) and = (as %3D) to avoid wrong parsing of the options string. ๐ธ
available nxagent options (as an addition to nx/nx options supported by nxcomp already):
options=<string>โ read your options from a file, bestie</p> ๐ this text file can hold one loooong line stuffed with comma-separatednx/nxoptions. Set it and forget it.rootless=<bool>โ kicks off nxagent in rootless mode, matches the-Ryou'd pass on the command line. It's a no-op when resuming (default:0, disabled) ๐geometry=<string>โ the desktop geometry for starting or resuming a session. no-op in rootless mode (default: 66% of the underlying X server geometry). You can either drop a standard X geometry string (WxH+X+Y) or sayallscreensfor a window that covers every available screen, oronescreenfor a window covering just one screen. And for historical reasonsfullscreenis also accepted as a synonym forallscreens. ๐fullscreen=<int>โ start or resume in fullscreen mode (default:0, off). Say1for a fullscreen window covering all available screens, or2for a fullscreen window covering only the first screen. ๐resize=<bool>โ sets resizing support (default:1, enabled) โจkeyboard=<string>orkbtype=<string>โ the keyboard config, and it takes one of these forms:
query|clone|<model>/<layout>|rmlvo/<rules>#<model>#<layout>#<variant>#<options>
queryโ use the default XKB keyboard layout (see below) and only let clients query the settings while blocking any changes. This one is especially helpful for setups where you need to set/modify the actual keyboard layout using core X protocol functions (e.g. viaxmodmap). It's used for MacOS X clients to handle some keyboard problems that are special for that platform. > Heads up though: in this case XKEYBOARD will always report the default layout, which will most likely not match the settings you're actually experiencing. ๐cloneโ ask the real X server for its keyboard settings using XKEYBOARD protocol functions and clone them. This is the recommended setting. For compatibility reasons it is not the default. ๐ญ<model>/<layout>โ use the given model and layout. A value ofnull/nullis equivalent toclone. You can't modify keyboard rules, variant or options this way โ instead preset values are used: these arebasefor rules and empty strings for variant and options.rmlvo/<rules>#<model>#<layout>#<variant>#<options>โ configure the keyboard according to the rmlvo (Rules+Model+Layout+Variant+Options) description given after the/and separated by#. This can be used to fully pass the keyboard configuration of nxagent right after the start. Example:rmlvo/base#pc105#de,us#nodeadkeys#lv3:rwin_switch๐ฆ
If keyboard is omitted, the internal defaults of nxagent will be used (rules: base, layout: us, model: pc102, empty variant and options).
keyconv=<string>โ set keycode conversion mode. Options are:
auto|on|off
By default (auto) nxagent will activate keycode conversion if it detects an evdev XKEYBOARD setup on the nxproxy side (the standard on Linux systems nowadays). Keycode conversion means certain keycodes are mapped to make the keyboard appear as a pc105 model. Using off suppresses this conversion, and with on it gets forced. โจ
clipboard=<string>โ pick your clipboard vibe:
both|client|server|none
bothโ allow clipboard data exchange both from nxagent to the real X server and vice-versa. This is the default.clientโ limit clipboard data exchange to work only one direction: from the real X server to nxagent. Clipboard will still work inside nxagent. This setting effectively prevents data leakage from the nxagent session to the outside. ๐serverโ limit clipboard data exchange to work only one direction: from nxagent to the real X server.noneโ disable any clipboard data exchange entirely. Clipboard will still work inside the nxagent and on the real X server, but no data exchange will be possible. ๐
textclipboard=<bool>โ enable (set to1) or disable (set to0) text-only clipboard. Text-only clipboard is the old (<= 3.5.99.26) clipboard behaviour where you could only copy and paste text strings (no graphics, no rich text, ...). Using this mode has been seen as a security feature since it effectively prevents transferring dangerous binary data, e.g. manipulated graphics by accident. On the other hand it's also less comfortable. (default: disabled) ๐streaming=<bool>โ enable (set to1) or disable (set to0) streaming support for images. Not fully implemented yet and thus non-functional. (default: disabled) ๐backingstore=<bool>โ disable (set to0) or enforce (set to1) backing store support (default: enforced). > In rootless mode backingstore is always disabled.composite=<bool>โ enable (set to1) or disable (set to0) Composite support in nxagent (default: enabled) ๐xinerama=<bool>โ enable (set to1) or disable (set to0) XINERAMA support in nxagent (default: enabled)shmem=<bool>โ enable/disable using shared memory. Accepted values:1(enable, default),0(disable)shpix=<bool>โ enable/disable shared pixmaps support. Accepted values:1(enable, default),0(disable)client=<string>โ type of connecting operating system (supported:linux,windows,solarisandmacosx)clients=<string>โ filename where to log output of the nxagent's clients. This is ignored if no session id has been provided โ in that case it points tostderr. Default:<sessiondir>/clients.shadow=<string>โ define the display that should be shadowed ๐shadowuid=<int>โ unique identifier for the shadow sessionshadowmode=<bool>โ full access (set to1) or viewing-only (set to0, default)state=<string>โ filename where to store the state of the nxagent (for easier interoperation with software like x2go). Default:sessiondir/state.defer=<int>โ defer image updates (enabled for all connection types except LAN), accepts values0,1and2.
The default value can be set via the command line (-defer). The value provided as an nx/nx option is set when resuming a session, so it overrides the command line default. ๐
The default depends on the link type (see man nxproxy).
Each defer level adds the following rules to the previous ones:
0โ Eager encoding. Default for link speedlanandlocal.1โ No data is put or copied on pixmaps, marking them always as corrupted and synchronizing them on demand, i.e. when a copy area to a window is requested, the source is synchronized before copying it. Default for link speedwan.2โ The put images over the windows are skipped, marking the destination as corrupted. The same happens for copy area and composite operations, spreading the corrupted regions of involved drawables. Default for link speedadsl,isdnandmodem.
tile=<string>โ set the maximum tile size in pixels (<W>x<H>) for bitmap data sent over the wire.
The default value can be set via the command line (-tile). The value provided as an nx/nx option is set when resuming a session, so it overrides the command line default. ๐
menu=<bool>โ support pulldown menu in nxagent session (only available on proxy <-> agent remote sessions) (default:1, enabled)magicpixel=<bool>โ enable/disable magic pixel support in fullscreen mode (default:1, enabled) โจcopysize=<int>โ maximum number of bytes that can be pasted from an NX session into an external application. Default is unlimited.autodpi=<bool>โ enable/disable deriving session DPI automatically from the real server (default:0, disabled); only takes effect on session startups, and gets ignored when reconnecting to a suspended session.sleep=<int>โ delay X server operations when suspended (provided in milliseconds). Set to0to keep the nxagent session fully functional when suspended (e.g. useful when mirroring an nxagent session via VNC). Graphic intensive applications will be affected by this more than others. The default is50ms. ๐ดtolerancechecks=<string>โ the pixmap format vibe check:
strict|safe|risky|bypass
strictโ means the number of internal and external pixmap formats must match exactly, and every internal pixmap format must be available in the external pixmap format array. This is the default.safeโ means the number of pixmap formats might diverge, but all internal pixmap formats must also be included in the external pixmap formats array. This is recommended, because it allows clients with more pixmap formats to still connect, but not lose functionality.riskyโ means the internal pixmap formats array is allowed to be smaller than the external pixmap formats array, but at least one pixmap format must be included in both. This is potentially unsafe. ๐bypassโ means all of these checks are essentially deactivated. This is a very bad idea. ๐
autograb=<bool>โ enable or disable autograb (default:0, disabled). Can be toggled during a session via keystroke. ๐
If you want to use nxagent as a replacement for Xnest or Xephyr, you can pass options like this:
$ echo nx/nx,fullscreen=1$DISPLAY >/tmp/opt
$ nxagent <command-line-options> -options /tmp/opt :<nx-display-port>
๐ธ XDMCP OPTIONS ๐ธ
okay so bestie, if your X server supports XDMCP, these are the options you get. and if you're like "what even is XDMCP", it's the X Display Manager Control Protocol โ go read the spec if you want the full lore, this is just the โจvibesโจ version. ๐
-query hostnameโ turns XDMCP ON and yeets Query packets over to thehostnameyou picked. ๐-broadcastโ XDMCP ON, and it broadcasts BroadcastQuery packets out to the whole network. whoever answers first wins the session, no takebacks. ๐-multicast [address [hop count]]โ XDMCP ON, and it multicasts BroadcastQuery packets out into the network. first display manager to respond gets chosen for the session, periodt.- if you give it an address, the multicast goes to that address.
- if you don't give it an address, the multicast goes to the default XDMCP IPv6 multicast group.
- if you give it a hop count, that's used as the maximum hop count for the multicast.
- and if you don't give a hop count? it's capped at a maximum of 1 hop, specifically so the multicast can't get routed beyond your local network. keeping it local, iykyk. ๐
-indirect hostnameโ XDMCP ON, and it sends IndirectQuery packets to thehostnameyou named.-port port-numberโ uses the port-number you specify for XDMCP packets instead of the default one.
โ ๏ธ ngl this one has a RULE: you must put it before any-query,-broadcast,-multicast, or-indirectoptions. order matters, bestie, don't test it.
-from local-addressโ tells it which local address to connect from. lowkey a lifesaver if the connecting host has multiple network interfaces and you need to pick one. the local-address can be written in any form that your host platform'sgethostbyname(3)implementation will accept. ๐ซถ-onceโ makes the server terminate (not reset, terminate) when the XDMCP session ends. dramatic exit, slay. ๐-class display-classโ XDMCP has this extra display qualifier that it uses during resource lookup for display-specific options. this option sets that value. the default is"MIT-Unspecified"โ and the manpage itself says that's "(not a very useful value)" so like. do with that what you will. ๐-cookie xdm-auth-bitsโ when you're testing XDM-AUTHENTICATION-1, there's a private key shared between the server and the manager, and this option sets the value of that private data. (and yes, it's "not that it is very private, being on the command line!" โ the original said it, not me ๐ญ)-displayID display-idโ yet another XDMCP-specific value. this one lets the display manager identify each display so it can locate the shared key. ๐
๐ง XKEYBOARD OPTIONS ๐ง
so X servers that support the XKEYBOARD extension (aka "XKB", the cooler nickname) accept all of these. ๐
๐จ important one: all layout files you specify on the command line have to live in the XKB base directory or a subdirectory of it, and you have to specify them as the relative path from the XKB base directory. the default XKB base directory is /usr/share/X11/xkb.
[+-]kbโ+enables,-disables the XKEYBOARD extension. that simple, no cap. โจ[+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask ] ] ] ]โ+enables,-disables AccessX key sequences. look at all those optional nested args, it's giving very customizable. ๐-xkbdir directoryโ sets the base directory for keyboard layout files.
โ ๏ธ heads up: this option is NOT available for setuid X servers โ meaning when the X server's real and effective uids are different. no can do, bestie. ๐
-ardelay millisecondsโ sets the autorepeat delay. that's the length of time, in milliseconds, that a key has to be held down before autorepeat even kicks in. โฑ๏ธ-arinterval millisecondsโ sets the autorepeat interval: the length of time, in milliseconds, that should pass between each autorepeat-generated keystroke. ๐น-xkbmap filenameโ loads the keyboard description in filename when the server starts up. main character entrance energy. ๐
๐ SECURITY EXTENSION OPTIONS ๐
okay so if your X server supports the SECURITY extension, it accepts one more option, and bestie, it's kind of a big deal:
-spfilename โ makes the server attempt to read and interpret filename as a security policy file, using the format described below. The file gets read at server startup, and then reread at each server reset. ๐
๐ the security policy file syntax ๐
Notation first, because the grammar below is giving very much formal-language energy: * means zero or more occurrences of the preceding element, and + means one or more occurrences. And when you see <foo/bar>, just ignore the text after the / โ it's only there to tell apart different instances of <foo> in the next section. iykyk ๐ฆ
<policy file> ::= <version line> <other line>*
<version line> ::= <string/v> '\n'
<other line > ::= <comment> | <access rule> | <site policy> | <blank line>
<comment> ::= # <not newline>* '\n'
<blank line> ::= <space> '\n'
<site policy> ::= sitepolicy <string/sp> '\n'
<access rule> ::= property <property/ar> <window> <perms> '\n'
<property> ::= <string>
<window> ::= any | root | <required property>
<required property> ::= <property/rp> | <property with value>
<property with value> ::= <property/rpv> = <string/rv>
<perms> ::= [ <operation> | <action> | <space> ]*
<operation> ::= r | w | d
<action> ::= a | i | e
<string> ::= <dbl quoted string> | <single quoted string> | <unquoted string>
<dbl quoted string> ::= <space> " <not dqoute>* " <space>
<single quoted string> ::= <space> ' <not squote>* ' <space>
<unquoted string> ::= <space> <not space>+ <space>
<space> ::= [ ' ' | '\t' ]*
Character sets, because of course there are character sets:
<not newline> ::= any character except '\n'
<not dqoute> ::= any character except "
<not squote> ::= any character except '
<not space> ::= any character except those in <space>
๐ the semantics, aka what it all actually MEANS ๐
<version line>โ the very first line in the file, and it specifies the file format version. If the server doesn't recognize the version<string/v>, it ignores the rest of the file ๐ญ (so get this one right, fr fr). The version string for the file format described right here is"version-1".- Once you're past the
<version line>, any lines that don't match the syntax above are just ignored. no drama. <comment>lines are ignored. ๐<sitepolicy>lines are currently ignored. They're intended to specify the site policies used by theXC-QUERY-SECURITY-1authorization method.<access rule>lines specify how the server should react to untrusted client requests that affect the X Window property named<property/ar>. The rest of this section describes how an<access rule>gets interpreted. ๐
So for an <access rule> to apply to a given instance of <property/ar>, <property/ar> has to be on a window that's in the set of windows specified by <window>. If <window> is any, the rule applies to <property/ar> on any window. If <window> is root, the rule applies to <property/ar> only on root windows.
If <window> is <required property>, here's how it goes down:
- If
<required property>is a<property/rp>, the rule applies when the window also has that<property/rp>, regardless of its value. โจ - If
<required property>is a<property with value>, then<property/rpv>must also have the value specified by<string/rv>. In this case the property must have typeSTRINGand format8, and should contain one or more null-terminated strings. If any of the strings match<string/rv>, the rule applies.
The definition of string matching is a simple case-sensitive string comparison, with one elaboration: the occurrence of the character '*' in <string/rv> is a wildcard meaning "any string." A <string/rv> can contain multiple wildcards anywhere in the string. For example, "x*" matches strings that begin with x, "*x" matches strings that end with x, "*x*" matches strings containing x, and "x*y*" matches strings that start with x and subsequently contain y. slay ๐ธ
There may be multiple <access rule> lines for a given <property/ar>. The rules are tested in the order that they appear in the file, and the first rule that applies is the one that's used. no takebacks.
<perms> specify the operations that untrusted clients may attempt, plus the actions the server should take in response to those operations.
<operation> can be r (read), w (write), or d (delete). The following table shows how X Protocol property requests map to these operations in The Open Group server implementation:
GetProperty r, or r and d if delete = True
ChangeProperty w
RotateProperties r and w
DeleteProperty d
ListProperties none, untrusted clients can always list all properties
<action> can be a (allow), i (ignore), or e (error).
a(allow) means execute the request as if it had been issued by a trusted client. main character energy honestly.i(ignore) means treat the request as a no-op. In the case ofGetProperty, ignore means return an empty property value if the property exists, regardless of its actual value. ๐ซฅe(error) means do not execute the request and return aBadAtomerror with the atom set to the property name.
Error is the default action for all properties, including those not listed in the security policy file. ๐
An <action> applies to all <operation>s that follow it, until the next <action> is encountered. So like, irwad means ignore read and write, allow delete. periodt.
GetProperty and RotateProperties may do multiple operations (r and d, or r and w). If different actions apply to the operations, the most severe action is applied to the whole request โ there is no partial request execution, bestie. The severity ordering is: allow < ignore < error. So if the <perms> for a property are ired (ignore read, error delete), and an untrusted client attempts GetProperty on that property with delete = True, an error is returned, but the property value is not. Similarly, if any of the properties in a RotateProperties don't allow both read and write, an error is returned without changing any property values. ๐ญ
๐ example security policy file ๐
Here it is, the moment you've all been waiting for:
version-1
# Allow reading of application resources, but not writing.
property RESOURCE_MANAGER root ar iw
property SCREEN_RESOURCES root ar iw
# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
# and allowing access may give away too much information.
property CUT_BUFFER0 root irw
property CUT_BUFFER1 root irw
property CUT_BUFFER2 root irw
property CUT_BUFFER3 root irw
property CUT_BUFFER4 root irw
property CUT_BUFFER5 root irw
property CUT_BUFFER6 root irw
property CUT_BUFFER7 root irw
# If you are using Motif, you probably want these.
property _MOTIF_DEFAULT_BINDINGS rootar iw
property _MOTIF_DRAG_WINDOW root ar iw
property _MOTIF_DRAG_TARGETS any ar iw
property _MOTIF_DRAG_ATOMS any ar iw
property _MOTIF_DRAG_ATOM_PAIRS anyar iw
# The next two rules let xwininfo -tree work when untrusted.
property WM_NAME any ar
# Allow read of WM_CLASS, but only for windows with WM_NAME.
# This might be more restrictive than necessary, but demonstrates
# the <required property> facility, and is also an attempt to
# say "top level windows only."
property WM_CLASS WM_NAME ar
# These next three let xlsclients work untrusted. Think carefully
# before including these; giving away the client machine name and command
# may be exposing too much.
property WM_STATE WM_NAME ar
property WM_CLIENT_MACHINE WM_NAME ar
property WM_COMMAND WM_NAME ar
# To let untrusted clients use the standard colormaps created by
# xstdcmap, include these lines.
property RGB_DEFAULT_MAP root ar
property RGB_BEST_MAP root ar
property RGB_RED_MAP root ar
property RGB_GREEN_MAP root ar
property RGB_BLUE_MAP root ar
property RGB_GRAY_MAP root ar
# To let untrusted clients use the color management database created
# by xcmsdb, include these lines.
property XDCCC_LINEAR_RGB_CORRECTION rootar
property XDCCC_LINEAR_RGB_MATRICES rootar
property XDCCC_GRAY_SCREENWHITEPOINT rootar
property XDCCC_GRAY_CORRECTION rootar
# To let untrusted clients use the overlay visuals that many vendors
# support, include this line.
property SERVER_OVERLAY_VISUALS rootar
# Dumb examples to show other capabilities.
# oddball property names and explicit specification of error conditions
property "property with spaces" 'property with "'aw er ed
# Allow deletion of Woo-Hoo if window also has property OhBoy with value
# ending in "son". Reads and writes will cause an error.
property Woo-Hoo OhBoy = "*son"ad
๐ NETWORK CONNECTIONS ๐
The X server supports client connections via a platform-dependent subset of the following transport types: TCPIP, Unix Domain sockets, and several varieties of SVR4 local connections. To learn how to specify which transport type clients should try to use, go peek at the DISPLAY NAMES section of the X(__miscmansuffix__) manual page. ๐ฆโจ
๐ GRANTING ACCESS ๐
okay so bestie, listen โ the X server ships with a platform-dependent subset of these authorization protocols, and that's the whole guest list:
MIT-MAGIC-COOKIE-1XDM-AUTHORIZATION-1XDM-AUTHORIZATION-2SUN-DES-1MIT-KERBEROS-5
how any of these actually work? that's not this page's business, go read Xsecurity(__miscmansuffix__) for the deets ๐
so the auth data these protocols need gets handed to the server in a private file, and you point at it with the -auth command line option. every time the server is about to accept its first connection after a reset (or like, when it's booting up), it reads that file. and here's the plot twist ๐ โ if the file has any authorization records in it, then the local host is not automatically allowed in anymore. nope. only clients that send one of the authorization records from that file in their connection setup info get through. gatekeeping, but make it secure ๐ชโจ
- wanna know the binary format of that file?
Xaumanual page, go off. - wanna maintain it and distribute its contents to remote hosts?
xauth(1), that's your girl.
๐ host-based access control, the other flavor
the X server also keeps a host-based access control list for deciding whether to accept connections from clients on a particular machine. and if no other authorization mechanism is in play, this list starts out with:
- the host the server is running on, and
- any machines listed in the file
/etc/Xn.hosts
โฆwhere n is the display number of the server. yes, that n is a placeholder, don't @ me ๐ญ
each line of that file should have either:
- an Internet hostname (e.g.
expo.lcs.mit.edu), or - a complete name in the format
family:name, as described in thexhost(1)manual page
โ ๏ธ and like, no leading or trailing spaces on any lines. none. zero. the vibes must be immaculate.
for example:
joesworkstation
corporate.company.com
star::
inet:bigcpu
local:
users can add or remove hosts from this list and enable or disable access control using the xhost command, from the same machine as the server. simple as ๐ซถ
๐ฅ the xfwp situation (iykyk)
if the X FireWall Proxy (xfwp) is being used without a sitepolicy, then host-based authorization must be turned on for clients to be able to connect to the X server via the xfwp. let me say that again for the people in the back ๐ข
if xfwp is run without a configuration file and thus no sitepolicy is defined, and if xfwp is using an X server where xhost + has been run to turn off host-based authorization checks โ then when a client tries to connect to this X server via xfwp, the X server will deny the connection. awkward ๐
see xfwp(1) for more info about this proxy.
๐ฌ real talk about X protocol permissions
the X protocol intrinsically does not have any notion of window operation permissions, and it places no restrictions on what a client can do. likeโฆ if a program can connect to a display, it has full run of the screen. that's it. that's the whole security model. ๐ญ
X servers that support the SECURITY extension fare better, because clients can be designated untrusted via the authorization they use to connect โ see the xauth(1) manual page for details. restrictions get imposed on untrusted clients that curtail the mischief they can do. see the SECURITY extension specification for a complete list of these restrictions. ๐
and for sites that have better authentication and authorization systems? they might wish to make use of the hooks in the libraries and the server to provide additional security models. build ur own, bestie ๐
๐จ SIGNALS ๐จ
the X server attaches special meaning to the following signals:
SIGHUPโ this signal makes the server close all existing connections, free all resources, and restore all defaults. it's sent by the display manager whenever the main user's main application (usually anxtermor a window manager) exits, to force the server to clean up and prepare for the next user. spring cleaning era ๐งนโจSIGTERMโ this signal makes the server exit cleanly. no drama, just closure ๐ฆSIGUSR1โ okay this one is used quite differently from either of the above. when the server starts, it checks to see if it has inheritedSIGUSR1asSIG_IGNinstead of the usualSIG_DFL. if that's the case, the server sends aSIGUSR1to its parent process after it has set up the various connection schemes.Xdmuses this feature to recognize when connecting to the server is possible. it's giving โจtelepathyโจ
๐ค FONTS ๐ค
the X server can obtain fonts from directories and/or from font servers. the list of directories and font servers the X server uses when trying to open a font is controlled by the font path.
the default font path is __default_font_path__ .
the font path can be set with the -fp option, or by xset(1) after the server has started. your call, bestie ๐
๐ FILES ๐
/etc/Xn.hostsโ Initial access control list for display number n/usr/share/fonts/X11/misc,/usr/share/fonts/X11/75dpi,/usr/share/fonts/X11/100dpiโ Bitmap font directories/usr/share/fonts/X11/Type1โ Outline font directories/usr/share/nx/rgbโ Color database/tmp/.X11-unix/Xnโ Unix domain socket for display number n/tmp/rcXnโ Kerberos 5 replay cache for display number n
๐ SEE ALSO ๐
Protocols: X Window System Protocol, NX Compression Protocol, The X Font Service Protocol, X Display Manager Control Protocol
Fonts: bdftopcf(1), mkfontdir(1), mkfontscale(1), xfs(1), xlsfonts(1), xfontsel(1), xfd(1), X Logical Font Description Conventions
Security: Xsecurity(__miscmansuffix__), xauth(1), Xau(1), xdm(1), xhost(1), xfwp(1), Security Extension Specification
Starting the server: xdm(1), xinit(1)
Controlling the server once started: xset(1), xsetroot(1), xhost(1)
Server-specific man pages: Xdec(1), XmacII(1), Xsun(1), Xnest(1), Xvfb(1), XFree86(1), XDarwin(1).
Server internal documentation: Definition of the Porting Layer for the X v11 Sample Server
๐ AUTHORS ๐
the first sample X server was originally written by Susan Angebranndt, Raymond Drewry, Philip Karlton, and Todd Newman, from Digital Equipment Corporation, with support from a large cast. it has since been extensively rewritten by Keith Packard and Bob Scheifler, from MIT. Dave Wiggins took over post-R5 and made substantial improvements. legends only, no cap ๐ซถ
the first implementation of nx-X11 (version 1.x up to 3.5.x) was written by NoMachine (maintained until 2011).
the current implementation of nx-X11 is maintained by various projects, amongst others The Arctica Project, TheQVD (Qindel Group) and X2Go.
this manual page was written by Per Hansen <spamhans@yahoo.de>, and modified by Marcelo Boveto Shima <marceloshima@gmail.com> and Mike Gabriel <mike.gabriel@das-netzwerkteam.de>. in 2016, the original Xserver.man page shipped with nx-X11 was merged into the nxagent man page and received a major update by Mike Gabriel <mike.gabriel@das-netzwerkteam.de>. iconic behavior tbh ๐
and that's the whole page, bestie!! this is Version 3.5.99.27, dated Jun 2023, and it's the nxagent(1) manual page. you made it to the end, main character energy fr fr ๐โญ๐
go touch some grass (or like, don't, run nxagent instead) ๐ฆโจ
๐ฆ where this page comes from
- debian trixie: nxagent 2:3.5.99.27-2 ยท GPL-2.0-only
- ubuntu noble: nxagent 2:3.5.99.27-1.1build2 ยท GPL-2.0-only
- ubuntu questing: nxagent 2:3.5.99.27-2build1
- ubuntu resolute: nxagent 2:3.5.99.27-2build2 ยท GPL-2.0-only
- ubuntu stonking: nxagent 2:3.5.99.27-3 ยท GPL-2.0-only
- Copyright 1984 - 1991, 1993, 1994, 1998 The Open Group
- Copyright 2011 - 2016, Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms