LinuxCommandLibrary

x11vnc

Remotely control an existing X11 session

TLDR

Launch a VNC server that allows multiple clients to connect

$ x11vnc -shared
copy

Launch a VNC server in view-only mode, and which won't terminate once the last client disconnects
$ x11vnc -forever -viewonly
copy

Launch a VNC server on a specific display and screen (both starting at index zero)
$ x11vnc -display :[display].[screen]
copy

Launch a VNC server on the third display's default screen
$ x11vnc -display :[2]
copy

Launch a VNC server on the first display's second screen
$ x11vnc -display :[0].[1]
copy

SYNOPSIS

x11vnc [options ...]

PARAMETERS

-display
    Specifies the X display to connect to (e.g., :0). Default is the current DISPLAY environment variable.

-port
    Specifies the TCP port number for the VNC server (default: 5900).

-password
    Sets the VNC password. Warning: This is insecure. Use -storepasswd or a password file.

-storepasswd
    Prompts for a VNC password and stores it in an encrypted file.
More secure than passing the password directly.

-usepw
    Specifies a password file to use for authentication, created by -storepasswd.

-rfbauth
    Specifies a VNC password file in standard VNC format.

-forever
    Keeps the server running even after all clients disconnect.

-xkb
    Forces x11vnc to use the X keyboard extension when possible.

-ssl
    Enables or disables SSL encryption for VNC connections.

-shared
    Allows multiple clients to connect simultaneously to the VNC server.

-geometry x
    Specifies the virtual screen size. Useful if the remote client has a different resolution than the server.

-loop
    Defines the loop cycle period in milliseconds.

DESCRIPTION

x11vnc is a VNC (Virtual Network Computing) server that allows remote access to an existing X Window System display. Unlike traditional VNC servers that create a virtual desktop, x11vnc leverages the already running X session.

This is particularly useful for remotely controlling the physical display of a Linux machine without disrupting any ongoing processes or requiring the user to log out. It supports features like password protection, encryption (via SSL), and various authentication methods. x11vnc is often used for remote administration, troubleshooting, or collaboration on a shared graphical desktop. It essentially turns your existing X display into a VNC server for remote viewing and control.

Compared to creating a new vnc session x11vnc connects to the display without needing to create a new vnc user-session. This can avoid issues and allows remote users to use a GUI application with the existing X session configuration.

CAVEATS

Using the -password option directly in the command line is insecure and should be avoided. It is recommended to use -storepasswd to store the password in an encrypted file.

If problems with the X display occur, it is recommended to ensure the user is logged in and that the display manager has been initialized.

TROUBLESHOOTING

If you encounter issues connecting, verify that the X display is active and accessible. Check firewall settings to ensure that the VNC port (default 5900) is open. Use the -display option to explicitly specify the correct X display if necessary.

SECURITY CONSIDERATIONS

Always use strong passwords and consider enabling SSL encryption (-ssl enable) to protect VNC connections from eavesdropping. Limit access to the VNC server to trusted networks only.

HISTORY

x11vnc was developed to provide a VNC server solution that could connect to existing X displays, addressing the limitations of traditional VNC servers that create separate virtual desktops. It has become a popular tool for remote administration and troubleshooting on Linux systems, particularly in situations where maintaining the existing X session is critical. The project has evolved over time with updates to improve security, performance, and compatibility with different X server versions.

SEE ALSO

vncserver(1), xauth(1)

Copied to clipboard