acbd46
.TH vncserver 1 "" "TigerVNC" "Virtual Network Computing"
acbd46
.SH NAME
acbd46
vncserver \- start or stop a VNC server
acbd46
.SH SYNOPSIS
acbd46
.B vncserver
acbd46
.RI [: display# ]
acbd46
.RB [ \-name
acbd46
.IR desktop-name ]
acbd46
.RB [ \-geometry
acbd46
.IR width x height ]
acbd46
.RB [ \-depth
acbd46
.IR depth ]
acbd46
.RB [ \-pixelformat
acbd46
.IR format ]
acbd46
.RB [ \-fp
acbd46
.IR font-path ]
acbd46
.RB [ \-fg ]
acbd46
.RB [ \-autokill ]
acbd46
.RB [ \-noxstartup ]
acbd46
.RB [ \-xstartup
acbd46
.IR script ]
acbd46
.RI [ Xvnc-options... ]
acbd46
.br
acbd46
.BI "vncserver \-kill :" display#
acbd46
.br
acbd46
.BI "vncserver \-list"
acbd46
.SH DESCRIPTION
acbd46
.B vncserver
acbd46
is used to start a VNC (Virtual Network Computing) desktop.
acbd46
.B vncserver
acbd46
is a Perl script which simplifies the process of starting an Xvnc server.  It
acbd46
runs Xvnc with appropriate options and starts a window manager on the VNC
acbd46
desktop.
acbd46
acbd46
.B vncserver
acbd46
can be run with no options at all. In this case it will choose the first
acbd46
available display number (usually :1), start Xvnc with that display number,
acbd46
and start the default window manager in the Xvnc session.  You can also
acbd46
specify the display number, in which case vncserver will attempt to start
acbd46
Xvnc with that display number and exit if the display number is not
acbd46
available.  For example:
acbd46
acbd46
.RS
acbd46
vncserver :13
acbd46
.RE
acbd46
acbd46
Editing the file $HOME/.vnc/xstartup allows you to change the applications run
acbd46
at startup (but note that this will not affect an existing VNC session.)
acbd46
acbd46
.SH OPTIONS
acbd46
You can get a list of options by passing \fB\-h\fP as an option to vncserver.
acbd46
In addition to the options listed below, any unrecognised options will be
acbd46
passed to Xvnc - see the Xvnc man page, or "Xvnc \-help", for details.
acbd46
acbd46
.TP
acbd46
.B \-name \fIdesktop-name\fP
acbd46
Each VNC desktop has a name which may be displayed by the viewer. The desktop
acbd46
name defaults to "\fIhost\fP:\fIdisplay#\fP (\fIusername\fP)", but you can
acbd46
change it with this option.  The desktop name option is passed to the xstartup
acbd46
script via the $VNCDESKTOP environment variable, which allows you to run a
acbd46
different set of applications depending on the name of the desktop.
acbd46
.
acbd46
.TP
acbd46
.B \-geometry \fIwidth\fPx\fIheight\fP
acbd46
Specify the size of the VNC desktop to be created. Default is 1024x768.
acbd46
.
acbd46
.TP
acbd46
.B \-depth \fIdepth\fP
acbd46
Specify the pixel depth (in bits) of the VNC desktop to be created. Default is
acbd46
24.  Other possible values are 8, 15 and 16 - anything else is likely to cause
acbd46
strange behaviour by applications.
acbd46
.
acbd46
.TP
acbd46
.B \-pixelformat \fIformat\fP
acbd46
Specify pixel format for Xvnc to use (BGRnnn or RGBnnn).  The default for
acbd46
depth 8 is BGR233 (meaning the most significant two bits represent blue, the
acbd46
next three green, and the least significant three represent red), the default
acbd46
for depth 16 is RGB565, and the default for depth 24 is RGB888.
acbd46
.
acbd46
.TP
acbd46
.B \-cc 3
acbd46
As an alternative to the default TrueColor visual, this allows you to run an
acbd46
Xvnc server with a PseudoColor visual (i.e. one which uses a color map or
acbd46
palette), which can be useful for running some old X applications which only
acbd46
work on such a display.  Values other than 3 (PseudoColor) and 4 (TrueColor)
acbd46
for the \-cc option may result in strange behaviour, and PseudoColor desktops
acbd46
must have an 8-bit depth.
acbd46
.
acbd46
.TP
acbd46
.B \-kill :\fIdisplay#\fP
acbd46
This kills a VNC desktop previously started with vncserver.  It does this by
acbd46
killing the Xvnc process, whose process ID is stored in the file
acbd46
"$HOME/.vnc/\fIhost\fP:\fIdisplay#\fP.pid".  The
acbd46
.B \-kill
acbd46
option ignores anything preceding the first colon (":") in the display
acbd46
argument.  Thus, you can invoke "vncserver \-kill $DISPLAY", for example at the
acbd46
end of your xstartup file after a particular application exits.
acbd46
.
acbd46
.TP
acbd46
.B \-fp \fIfont-path\fP
acbd46
If the vncserver script detects that the X Font Server (XFS) is running, it
acbd46
will attempt to start Xvnc and configure Xvnc to use XFS for font handling.
acbd46
Otherwise, if XFS is not running, the vncserver script will attempt to start
acbd46
Xvnc and allow Xvnc to use its own preferred method of font handling (which may
acbd46
be a hard-coded font path or, on more recent systems, a font catalog.)  In
acbd46
any case, if Xvnc fails to start, the vncserver script will then attempt to
acbd46
determine an appropriate X font path for this system and start Xvnc using
acbd46
that font path.
acbd46
acbd46
The
acbd46
.B \-fp
acbd46
argument allows you to override the above fallback logic and specify a font
acbd46
path for Xvnc to use.
acbd46
.
acbd46
.TP
acbd46
.B \-fg
acbd46
Runs Xvnc as a foreground process.  This has two effects: (1) The VNC server
acbd46
can be aborted with CTRL-C, and (2) the VNC server will exit as soon as the
acbd46
user logs out of the window manager in the VNC session.  This may be necessary
acbd46
when launching TigerVNC from within certain grid computing environments.
acbd46
.
acbd46
.TP
acbd46
.B \-autokill
acbd46
Automatically kill Xvnc whenever the xstartup script exits.  In most cases,
acbd46
this has the effect of terminating Xvnc when the user logs out of the window
acbd46
manager.
acbd46
.
acbd46
.TP
acbd46
.B \-noxstartup
acbd46
Do not run the %HOME/.vnc/xstartup script after launching Xvnc.  This
acbd46
option allows you to manually start a window manager in your TigerVNC session.
acbd46
.
acbd46
.TP
acbd46
.B \-xstartup \fIscript\fP
acbd46
Run a custom startup script, instead of %HOME/.vnc/xstartup, after launching
acbd46
Xvnc. This is useful to run full-screen applications.
acbd46
.
acbd46
.TP
acbd46
.B \-list
acbd46
Lists all VNC desktops started by vncserver.
acbd46
acbd46
.SH FILES
acbd46
Several VNC-related files are found in the directory $HOME/.vnc:
acbd46
.TP
acbd46
$HOME/.vnc/xstartup
acbd46
A shell script specifying X applications to be run when a VNC desktop is
acbd46
started.  If this file does not exist, then vncserver will create a default
acbd46
xstartup script which attempts to launch your chosen window manager.
acbd46
.TP
acbd46
/etc/tigervnc/vncserver-config-defaults
acbd46
The optional system-wide equivalent of $HOME/.vnc/config. If this file exists
acbd46
and defines options to be passed to Xvnc, they will be used as defaults for
acbd46
users. The user's $HOME/.vnc/config overrides settings configured in this file.
acbd46
The overall configuration file load order is: this file, $HOME/.vnc/config,
acbd46
and then /etc/tigervnc/vncserver-config-mandatory. None are required to exist.
acbd46
.TP
acbd46
/etc/tigervnc/vncserver-config-mandatory
acbd46
The optional system-wide equivalent of $HOME/.vnc/config. If this file exists
acbd46
and defines options to be passed to Xvnc, they will override any of the same
acbd46
options defined in a user's $HOME/.vnc/config. This file offers a mechanism
acbd46
to establish some basic form of system-wide policy. WARNING! There is
acbd46
nothing stopping users from constructing their own vncserver-like script
acbd46
that calls Xvnc directly to bypass any options defined in
acbd46
/etc/tigervnc/vncserver-config-mandatory.  Likewise, any CLI arguments passed
acbd46
to vncserver will override ANY config file setting of the same name. The
acbd46
overall configuration file load order is:
acbd46
/etc/tigervnc/vncserver-config-defaults, $HOME/.vnc/config, and then this file.
acbd46
None are required to exist.
acbd46
.TP
acbd46
$HOME/.vnc/config
acbd46
An optional server config file wherein options to be passed to Xvnc are listed
acbd46
to avoid hard-coding them to the physical invocation. List options in this file
acbd46
one per line. For those requiring an argument, simply separate the option from
acbd46
the argument with an equal sign, for example: "geometry=2000x1200" or
acbd46
"securitytypes=vncauth,tlsvnc". Options without an argument are simply listed
acbd46
as a single word, for example: "localhost" or "alwaysshared".
acbd46
.TP
acbd46
$HOME/.vnc/passwd
acbd46
The VNC password file.
acbd46
.TP
acbd46
$HOME/.vnc/\fIhost\fP:\fIdisplay#\fP.log
acbd46
The log file for Xvnc and applications started in xstartup.
acbd46
.TP
acbd46
$HOME/.vnc/\fIhost\fP:\fIdisplay#\fP.pid
acbd46
Identifies the Xvnc process ID, used by the
acbd46
.B \-kill
acbd46
option.
acbd46
acbd46
.SH SEE ALSO
acbd46
.BR vncviewer (1),
acbd46
.BR vncpasswd (1),
acbd46
.BR vncconfig (1),
acbd46
.BR Xvnc (1)
acbd46
.br
acbd46
https://www.tigervnc.org
acbd46
acbd46
.SH AUTHOR
acbd46
Tristan Richardson, RealVNC Ltd., D. R. Commander and others.
acbd46
acbd46
VNC was originally developed by the RealVNC team while at Olivetti
acbd46
Research Ltd / AT&T Laboratories Cambridge.  TightVNC additions were
acbd46
implemented by Constantin Kaplinsky. Many other people have since
acbd46
participated in development, testing and support. This manual is part
acbd46
of the TigerVNC software suite.