LinuxCommandLibrary

x0vncserver

Remotely access an existing X11 session

TLDR

Start a VNC server using a passwordfile

$ x0vncserver -display [:0] -passwordfile [path/to/file]
copy

Start a VNC server using a specific port
$ x0vncserver -display [:0] -rfbport [port]
copy

SYNOPSIS

x0vncserver [OPTIONS...]

PARAMETERS

-display DISPLAY
    Specifies the X display to be shared. For example, :0 for the primary display.

-rfbport PORT
    Sets the TCP port number on which the VNC server will listen for incoming connections. Default is usually 5900 + display_number.

-rfbauth PASSWORD_FILE
    Specifies the path to the VNC password file used for authentication. This file is created using vncpasswd.

-PasswordFile PASSWORD_FILE
    An alias for -rfbauth.

-localhost
    If specified, the server will only listen for connections from the local machine (127.0.0.1), enhancing security by preventing external connections directly to this server.

-SecurityTypes TYPES
    A comma-separated list of security types to support. Common types include VncAuth (password authentication) and None (no authentication, highly insecure).

-PermitListen boolean
    Enables or disables the server's ability to listen for incoming connections. Default is usually true.

-PermitFileTransfer boolean
    Enables or disables file transfer functionality between the server and clients.

-geometry WIDTHxHEIGHT
    Sets the width and height of the shared screen area. This can be useful if you only want to share a portion of a large display.

-depth BITS
    Sets the color depth in bits per pixel (e.g., 8, 16, 24). Higher depths provide better color fidelity but use more bandwidth.

-verbose
    Increases the verbosity of the server's output, showing more diagnostic messages.

DESCRIPTION

x0vncserver is a VNC (Virtual Network Computing) server designed to share an existing X Window System display. Unlike vncserver, which typically creates a new, virtual X display session, x0vncserver attaches directly to a running X server (e.g., your current desktop session). This allows remote users to view and control the exact same screen, applications, and windows that the local user is interacting with. It's particularly useful for remote assistance, screen sharing, or accessing a live desktop from another machine. x0vncserver is often part of the TigerVNC distribution and provides a robust way to share interactive graphical sessions securely, often requiring a password for authentication. It operates by capturing the contents of the specified X display and sending updates to connected VNC clients, while also forwarding keyboard and mouse events back to the X server.

CAVEATS

Security Risk: x0vncserver shares your live desktop session. Anyone with the correct password can see and interact with your screen, potentially accessing sensitive information or performing actions on your behalf.
X Display Requirement: It requires an active X display session to connect to. It cannot start a new, independent graphical environment.
Authentication: Always use a strong password file created with vncpasswd. Running without authentication (using -SecurityTypes None) is highly discouraged in unsecure environments.
Firewall Configuration: Ensure that the port used by x0vncserver (default 5900 + display number, e.g., 5900 for :0) is open in your system's firewall if you intend to connect from a remote machine.

CREATING A PASSWORD FILE

Before running x0vncserver, you typically need to create a VNC password file. This is done using the vncpasswd command. You will be prompted to enter and verify a password.
vncpasswd
By default, this creates ~/.vnc/passwd. You then specify this file using the -rfbauth option.

TYPICAL USAGE EXAMPLE

To share your primary X display (:0) on port 5900 with password authentication using a file in your home directory, you would run:
x0vncserver -display :0 -rfbport 5900 -rfbauth ~/.vnc/passwd

HISTORY

x0vncserver is a component of the TigerVNC project, which itself is a derivative of the original RealVNC software, developed from the AT&T Laboratories Cambridge VNC project. While vncserver traditionally focused on virtual X displays, x0vncserver was developed to specifically address the need for efficiently sharing an already running X session (like your desktop), providing a modern and performant solution for remote control and assistance of live graphical environments. Its development reflects the ongoing evolution of VNC technology to meet diverse remote access requirements.

SEE ALSO

vncserver(1), vncviewer(1), vncpasswd(1), x11vnc(1)

Copied to clipboard