LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

vncserver

Launch VNC remote desktop server

TLDR

Launch on next available display
$ vncserver
copy
Launch with specific geometry
$ vncserver -geometry [1920]x[1080]
copy
Launch on a specific display number
$ vncserver :[display_number]
copy
Kill specific display
$ vncserver -kill :[display_number]
copy
List running VNC servers
$ vncserver -list
copy

SYNOPSIS

vncserver [OPTIONS] [:DISPLAY]

DESCRIPTION

vncserver launches a VNC (Virtual Network Computing) desktop server. It creates a new X display that can be accessed remotely using a VNC viewer.Each server instance runs on a separate display number. The first available display is used if not specified.

PARAMETERS

-geometry WxH

Specify desktop size (default: 1920x1200).
-depth depth
Pixel depth in bits (16, 24, or 32; default: 24).
-kill :DISPLAY
Kill a previously started VNC server on the specified display.
-list
List all running VNC server instances.
-localhost [yes|no]
Only accept connections from localhost. Useful with SSH tunneling.
-SecurityTypes types
Comma-separated list of security types (None, VncAuth, Plain, TLSVnc, X509Vnc, etc.).
-desktop name
Desktop name displayed to connecting clients.
-fg
Run the server as a foreground process.
-autokill [yes|no]
Automatically kill the server when the session script exits (default: yes).
-xstartup script
Run a custom startup script instead of the default session script.
-noxstartup
Do not run any startup script after launching the server.
-rfbport port
TCP port for VNC connections (default: 5900 + display number).

CAVEATS

Password must be set with vncpasswd before first use. Display number is added to base port 5900 (e.g., display :1 uses port 5901). Firewall may need to allow VNC ports. VNC traffic is unencrypted by default; use SSH tunneling or TLS security types for secure connections.

SEE ALSO

vncviewer(1), vncpasswd(1), x11vnc(1), ssh(1)

Copied to clipboard
Kai