Xvnc(1)

🌸 NAME 🌸

Xvnc β€” the X VNC server. That's Xvnc(1) to you and me, and she's giving Virtual Network Computing main character energy. πŸ’…βœ¨

✨ SYNOPSIS ✨

Xvnc [options] :display#

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so Xvnc is the X VNC (Virtual Network Computing) server. She's based on a standard X server, but she has a "virtual" screen rather than a physical one. X applications display themselves on it as if it were a normal X display, but they can only be accessed via a VNC viewer β€” see vncviewer(1). πŸ‘€βœ¨

So Xvnc is really two servers in one β€” main character energy fr fr. To the applications, she's an X server; to the remote VNC users, she's a VNC server. By convention, we've arranged that the VNC server display number will be the same as the X server display number, which means you can use eg. snoopy:2 to refer to display 2 on machine "snoopy" in both the X world and the VNC world. πŸŒˆπŸ’–

The best way of starting Xvnc is via vncsession. This sets up the environment appropriately and starts a desktop environment. See the manual page for vncsession(8) for more information. 🫢

πŸ’… OPTIONS πŸ’…

Xvnc takes lots of options β€” running Xvnc -help gives a list. Many of these are standard X server options, which are described in the Xserver(1) manual page. In addition to options which can only be set via the command-line, there are also "parameters" which can be set both via the command-line and through the vncconfig(1) program. Flexible queen, periodt. πŸ‘‘

  • -depth depth β€” Specify the pixel depth in bits of the desktop to be created. Default is 24, other possible values are 16 and 32. Anything else is likely to cause strange behaviour by applications and may prevent the server from starting at all. ⚠️ So yeah, stick to the listed values, bestie β€” chaos is not the vibe here.
  • -geometry widthxheight β€” Specify the size of the desktop to be created. Default is 1024x768. πŸ“πŸŒΈ
  • -help β€” List all the options and parameters. She's helpful like that. ✨
  • -inetd β€” This significantly changes Xvnc's behaviour so that it can be launched from inetd. See the section below on usage with inetd. πŸ‘€
  • -pixelformat format β€” Specify pixel format for server to use (BGRnnn or RGBnnn). The default for depth 16 is RGB565 and for depth 24 and 32 is RGB888. πŸŽ¨πŸ’–
  • -rendernode path β€” DRM render node to use for DRI3 GPU acceleration. Specify an empty path to disable DRI3. Default is auto which makes Xvnc pick a suitable available render node. πŸš€πŸ¦‹

🌸 PARAMETERS 🌸

okay bestie, so you can set VNC parameters both from the command line and through the vncconfig(1) program β€” and if you've got a VNC-enabled Xorg server, you can also do it with Options entries in the xorg.conf file. ✨

Here's the vibe check on syntax: turn a param on with -param, or off with -param=0. If it takes a value, hit it with -param value. Other valid forms are param=value, -param=value, and --param=value. And yes, parameter names are case-insensitive β€” no cap, capitalization is not the moment. πŸ’…

  • -AcceptCutText β€” Accept clipboard updates from clients. Default is on. πŸ“‹
  • -AcceptKeyEvents β€” Accept key press and release events from clients. Default is on. ⌨️
  • -AcceptPointerEvents β€” Accept pointer movement and button events from clients. Default is on. πŸ–±οΈ
  • -AcceptSetDesktopSize β€” Accept requests to resize the size of the desktop. Default is on. πŸ–₯️
  • -AllowOverride β€” Comma separated list of parameters that can be modified using VNC extension. Parameters can be modified for example using vncconfig(1) program from inside a running session. (The default for this one is down below, keep scrolling 😭)
  • -AlwaysShared β€” Always treat incoming connections as shared, regardless of the client-specified setting. Default is off. 🀝
  • -AvoidShiftNumLock β€” Keys affected by NumLock often require a fake Shift to be inserted in order for the correct symbol to be generated. Turning on this option avoids these extra fake Shift events but may result in a slightly different symbol (e.g. a Return instead of a keypad Enter). πŸ™ˆ
  • -BlacklistThreshold count β€” The number of unauthenticated connection attempts allowed from any individual host before that host is black-listed. Default is 5. 🚫
  • -BlacklistTimeout seconds β€” The initial timeout applied when a host is first black-listed. The host cannot re-attempt a connection until the timeout expires. Default is 10. ⏳
  • -CompareFB mode β€” Perform pixel comparison on framebuffer to reduce unnecessary updates. Can be either 0 (off), 1 (always) or 2 (auto). Default is 2. πŸ”
  • -desktop desktop-name β€” Each desktop has a name which may be displayed by the viewer. It defaults to "<user>@<hostname>". 🏷️
  • -DisconnectClients β€” Disconnect existing clients if an incoming connection is non-shared. Default is on. If DisconnectClients is false, then a new non-shared connection will be refused while there is a client active. When combined with NeverShared this means only one client is allowed at a time. βœ‚οΈ
  • -FrameRate fps β€” The maximum number of updates per second sent to each client. If the screen updates any faster then those changes will be aggregated and sent in a single update to the client. Note that this only controls the maximum rate and a client may get a lower rate when resources are limited. Default is 60. 🎞️
  • -GnuTLSPriority priority β€” GnuTLS priority string that controls the TLS session’s handshake algorithms. See the GnuTLS manual for possible values. For GnuTLS < 3.6.3 the default value will be NORMAL to use upstream default. For newer versions of GnuTLS system-wide crypto policy will be used. πŸ”
  • -IdleTimeout seconds β€” The number of seconds after which an idle VNC connection will be dropped. Default is 0, which means that idle connections will never be dropped. πŸ’€
  • -ImprovedHextile β€” Use improved compression algorithm for Hextile encoding which achieves better compression ratios at the cost of using slightly more CPU time. Default is on. 🧩
  • -interface IP address β€” Listen on interface. By default Xvnc listens on all available interfaces. 🌐
  • -localhost β€” Only allow connections from the same machine. Useful if you use SSH and want to stop non-SSH connections from any other hosts. 🏠
  • -Log logname:dest:level[, ...] β€” Configures the debug log settings. dest can currently be stderr, stdout or syslog, and level is between 0 and 100, 100 meaning most verbose output. logname is usually * meaning all, but you can target a specific source file if you know the name of its "LogWriter". Default is *:stderr:30. πŸ“
  • -MaxConnectionTime seconds β€” Terminate when a client has been connected for N seconds. Default is 0. ⏱️
  • -MaxCutText bytes β€” The maximum size of a clipboard update that will be accepted from a client. Default is 262144. πŸ“Ž
  • -MaxDisconnectionTime seconds β€” Terminate when no client has been connected for N seconds. Default is 0. πŸ•°οΈ
  • -MaxIdleTime seconds β€” Terminate after N seconds of user inactivity. Default is 0. 😴
  • -NeverShared β€” Never treat incoming connections as shared, regardless of the client-specified setting. Default is off. πŸ™…β€β™€οΈ
  • -ApproveLoggedUserOnly β€” Approve only the user who is currently logged into the session. This is expected to be combined with "Plain" security type and with "PlainUsers=*" option allowing everyone to connect to the session. Default is off. πŸͺͺ
  • -pam_service name, -PAMService name β€” PAM service name to use when authenticating users using any of the "Plain" security types. Default is vnc. πŸ”‘
  • -Password password β€” Obfuscated binary encoding of the password which clients must supply to access the server. Using this parameter is insecure, use PasswordFile parameter instead.
🚨 bestie pls don't use this one unless you literally have to β€” it's giving insecure. Use PasswordFile instead. πŸ’€
  • -PasswordFile passwd-file, -rfbauth passwd-file β€” Password file for VNC authentication. There is no default, you should specify the password file explicitly. Password file should be created with the vncpasswd(1) utility. The file is accessed each time a connection comes in, so it can be changed on the fly. πŸ—οΈ
  • -PlainUsers user-list β€” A comma separated list of user names that are allowed to authenticate via any of the "Plain" security types (Plain, TLSPlain, etc.). Specify * to allow any user to authenticate using this security type. Specify %u to allow the user of the server process. Default is to deny all users. πŸ‘₯
  • -Protocol3.3 β€” Always use protocol version 3.3 for backwards compatibility with badly-behaved clients. Default is off. πŸ•ΉοΈ
  • -QueryConnect β€” Prompts the user of the desktop to explicitly accept or reject incoming connections. Default is off.
The vncconfig(1) program must be running on the desktop in order for QueryConnect to be supported. 🫢
  • -QueryConnectTimeout seconds β€” Number of seconds to show the Accept connection dialog before rejecting the connection. Default is 10. ⏲️
  • -RawKeyboard β€” Send keyboard events straight through and avoid mapping them to the current keyboard layout. This effectively makes the keyboard behave according to the layout configured on the server instead of the layout configured on the client. Default is off. ⌨️
  • -RemapKeys mapping β€” Sets up a keyboard mapping. mapping is a comma-separated string of character mappings, each of the form char->char, or char<>char, where char is a hexadecimal keysym. For example, to exchange the " and @ symbols you would specify the following: RemapKeys=0x22<>0x40. πŸ”€
  • -RequireUsername β€” Require username for the RSA-AES security types. Default is off. 🧾
  • -rfbport port β€” Specifies the TCP port on which Xvnc listens for connections from viewers (the protocol used in VNC is called RFB - "remote framebuffer"). The default is 5900 plus the display number. Specify -1 to disable listening on a TCP port. πŸ”Œ
  • -rfbunixmode mode β€” Specifies the mode of the Unix domain socket. The default is 0600. πŸ”’
  • -rfbunixpath path β€” Specifies the path of a Unix domain socket on which Xvnc listens for connections from viewers. πŸ›€οΈ
  • -RSAKey path β€” Path to the RSA key for the RSA-AES security types (RA2, RA2ne, RA2_256 and RA2ne_256) in PEM format. πŸ—οΈ
  • -SecurityTypes sec-types β€” Specify which security scheme to use for incoming connections. Valid values are a comma separated list of None, VncAuth, Plain, TLSNone, TLSVnc, TLSPlain, X509None, X509Vnc, X509Plain, RA2, RA2ne, RA2_256 and RA2ne_256. Default is TLSVnc,VncAuth. πŸ›‘οΈ
  • -SendCutText β€” Send clipboard changes to clients. Default is on. πŸ“€
  • -SendPrimary β€” Send the primary selection and cut buffer to the server as well as the clipboard selection. Default is on. 🎯
  • -SetPrimary β€” Set the primary selection as well as the clipboard selection. Default is on. ✨
  • -UseBlacklist β€” Temporarily reject connections from a host if it repeatedly fails to authenticate. Default is on. 🚫
  • -UseIPv4 β€” Use IPv4 for incoming and outgoing connections. Default is on. 4️⃣
  • -UseIPv6 β€” Use IPv6 for incoming and outgoing connections. Default is on. 6️⃣
  • -X509Cert path β€” Path to a X509 certificate in PEM format to be used for all X509 based security types (X509None, X509Vnc, etc.). πŸ“œ
  • -X509Key path β€” Private key counterpart to the certificate given in X509Cert. Must also be in PEM format. πŸ”
⚠️ Security tea: allowing override of parameters such as PAMService or PasswordFile can negatively impact security if Xvnc runs under a different user than the programs allowed to override the parameters. 🚨

When NoClipboard parameter is set, allowing override of SendCutText and AcceptCutText has no effect. πŸ™ˆ

Default for AllowOverride is desktop,AcceptPointerEvents,SendCutText,AcceptCutText,SendPrimary,SetPrimary.

πŸŽ€ USAGE WITH INETD πŸŽ€

okay so this is the part where Xvnc gets its main character moment and honestly? iconic. πŸ’… Setup the inetd(1) service the right way and Xvnc can be launched on demand the second a connection comes in, instead of you having to start it manually like some kind of peasant. no cap, it's giving automation.

when you hand it the -inetd option, Xvnc stops listening for TCP connections on some port and instead just uses its standard input and standard output as the connection. simple as that, bestie.

There are two modes, and they're controlled by the wait/nowait entry in the inetd.conf file. πŸ‘‘

nowait mode πŸ¦‹

In nowait mode, Xvnc uses its standard input and output directly as the connection to a viewer. That's it, that's the whole vibe. It never has a listening socket, so it literally cannot accept further connections from viewers (it can, however, connect out to listening viewers by use of the vncconfig program β€” so it's not totally antisocial 🫢).

Further viewer connections to the same TCP port result in inetd spawning off a new Xvnc to deal with each connection. When the connection to the viewer dies, that Xvnc and any associated X clients die with it. πŸ’€

This behaviour is most useful when combined with the XDMCP options -query and -once. A typical example in inetd.conf might be (all on one line):

5950   stream   tcp nowait nobody  /usr/local/bin/Xvnc Xvnc -inetd
-query localhost -once securitytypes=none

In this example, a viewer connection to :50 will result in a new Xvnc for that connection, which should display the standard XDM login screen on that machine. And it's usually OK to accept connections without a VNC password here, since the user still needs to log in via XDM anyway. so like, the door's open but the bouncer's still there. πŸšͺ✨

wait mode 🌸

In wait mode, when the first connection comes in, inetd gives the listening socket to Xvnc. This means that for a given TCP port, there is only ever one Xvnc at a time. Further viewer connections to the same port are accepted by that same Xvnc in the normal way. And even when the original connection is broken, the Xvnc will continue to run β€” it does not fold under pressure, bestie. 😀

If this is used with the XDMCP options -query and -once, the Xvnc and associated X clients will die when the user logs out of the X session in the normal way. It is important to use a VNC password in this case. πŸ”

fr fr, do NOT skip the password in wait mode. it's the whole point of the mode.

A typical entry in inetd.conf might be:

5951   stream   tcp wait   james     /usr/local/bin/Xvnc Xvnc -inetd
-query localhost -once passwordFile=/home/james/.config/tigervnc/passwd

In fact, typically you'd have one entry for each user who uses VNC regularly, each of whom has their own dedicated TCP port which they use. In this example, when user "james" connects to :51, he enters his VNC password, then gets the XDM login screen where he logs in in the normal way. But unlike the previous example, if he disconnects, the session remains persistent, and when he reconnects he'll get the same session back again. πŸ˜­πŸ’– When he logs out of the X session, the Xvnc will die, but of course a new one will be created automatically the next time he connects. the circle of life, literally.


✨ SEE ALSO ✨


πŸ‘‘ AUTHOR πŸ‘‘

Tristan Richardson, RealVNC Ltd. and others.

VNC was originally developed by the RealVNC team while at Olivetti Research Ltd / AT&T Laboratories Cambridge. TightVNC additions were implemented by Constantin Kaplinsky. Many other people have since participated in development, testing and support. This manual is part of the TigerVNC software suite. 🫢


and that's the whole page, bestie β€” go forth and share your screen πŸ’…

sign-off szn: this lil masterpiece ships as part of TigerVNC, and its footer tags it as Xvnc(1) β€” that's the source/version and the page label, and the date's just vibing wherever the build put it. mwah. πŸŽ€βœ¨

πŸ“¦ where this page comes from