User Tools

Site Tools


infrastructure:x11vnc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
infrastructure:x11vnc [2021/09/23 13:53] s_fuyedcinfrastructure:x11vnc [2021/12/09 10:26] (current) pmania
Line 1: Line 1:
-Ubuntu 18.04 +Please check the following page[[infrastructure/vnc]]
-Package https://github.com/LibVNC/x11vnc  How to use x11vnc +
- +
-**On remote machine (server)** +
- +
-Gnome Display Manager makes problems for starting a x11 session because of authorizations. +
-Install and use lightdm instead. +
-<code> +
-sudo apt-get install lightdm +
-</code> +
-Use dpkg to set the display manager to //lightdm//+
-<code> +
-sudo dpkg-reconfigure lightdm +
-</code> +
-With lightdm set as display manager we can install x11vnc on the server: +
-<code> +
-sudo apt-get install x11vnc +
-</code> +
- +
- +
-**On local machine (client)** +
- +
-Install a vncviewer. x11vnc recommends tightvnc.  +
-<code> +
-sudo apt install xfce4 xfce4-goodies xtightvncviewer +
-</code> +
- +
-**Preparing the server** +
- +
-Before the remote client can connect to the server, the server needs to be prepared. +
-On the server a monitor has to be connected. This enables the server to open an actual display, to which the remote client can attach itself to.  +
- +
-//If anything else than lightdm is used:// Once after every reboot, a user must log in to the server on site, because the virtual display is only launched after the first user's login. +
- +
-**Start server and connect to it (from client)** +
- +
-Launching the x11vnc server and connecting to it via tightvnc is done from the client's site. +
- +
-The following command launches x11vnc on the server through ssh. Replace the <server_user> with the name of a user with root-rights, and the <server_ip> the the server's IP address. +
-<code> +
-ssh -t -L 5900:localhost:5900 <server_user>@<server_ip> 'sudo x11vnc -localhost -display :0 -auth guess' +
-</code> +
-You'll be asked for the user's password first, then for a password of your choice for the vnc session. It's best to store this command in a bash alias, since it is required every time you want to establish a vnc connection. The first part connects to the server via ssh, the latter launches the x11vnc server on display :0, which is the same display as can be seen on the server's physical monitor.  +
- +
-Connecting visually to the x11vnc server from your client machine is done with the following command. As with the previous command, it is advised to create a bash alias for it.  +
-<code> +
-vncviewer -encodings "copyrect tight zrle hextile" localhost:+
-</code> +
- +
- +
-**Important notes on how to use** +
- +
-If work is done on the remote server, leave the server unlocked and simply close the tightvnc window, this will terminate the client's connection as well as the x11vnc server. It is advised to install //xscreensaver// on the server, which allows the server to lock and become password-protected after some idle time. Do __not__ lock the screen or log out, because it will close display :0, which prevents any control via vnc. +
- +
- +
-If any other user is currently connected to the server, it is indicated by your x11vnc-server's console output after entering the ssh password and before setting the vnc password: +
-<code> +
-bind: Address already in use +
-channel_setup_fwd_listener_tcpip: cannot listen to port: 5900 +
-Could not request local forwarding. +
-</code> +
-Furthermore, if this is ignored and the x11vnc server is launched anyway, the port will be set to the next free (5901) and display :1, but display :1 doesn't exist. If a second connection it attempted to the same server, it is refused with the following information: +
-<code> +
-Connected to RFB server, using protocol version 3.8 +
-vncviewer: VNC server closed connection +
-</code> +
- +
- +
-If a visual connection is temporarily not required, meaning if CLI suffices, use ssh to connect to the server and run //byobu// for a comfortable, multi-terminal environment. This is especially advised when monitoring rosnodes running on the server. The byobu instance is shared among all clients connected to the server. By detaching from the byobu session (F6) other users can re-use the shell command, executed by previous users.+
infrastructure/x11vnc.1632405204.txt.gz · Last modified: 2021/09/23 13:53 by s_fuyedc

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki