Logging into a multi-user system via VNC. How to get your VNC server up and running on Ubuntu Linux

November 25, 2009 at 01:21 pm

Connecting to a remote computer via VNC

  • Linux setup

Working with the VNC client. The material is aimed at inexperienced users.

1. Installing a VNC client
2. Connecting a VNC client to a remote computer
3. Disconnecting the VNC client from the remote computer
4. Tuning the VNC client
5. Common problems

To work with a remote computer via VNC, you need to run a client program (VNC viewer, VNC client) on the user’s computer. This program transmits data about keystrokes and mouse movements made by the user to a remote computer and displays information intended to be displayed on the screen.

1. Installing a VNC client
For Windows OS you can download and install the VNC client UltraVNC and TightVNC for free.

Mac OS X since version 10.5 has support for a VNC client in RemoteDesktop. For previous versions, you can use the VNC clients JollysFastVNC and .

For the Linux branch of Debian (Ubuntu), the VNC client is installed from the repository with the command:

Apt-get install vncviewer

For the RedHat branch (CentOS, Fedora) - with the command:

Yum install vnc

For FreeBSD, the VNC client (TightVNC) is installed from packages with the command:

Pkg_add -r tightvnc

2. Connecting a VNC client to a remote computer
To connect a VNC client to a remote computer, you need to specify its IP address or DNS name, and the display number (default, :0) or TCP port number (default, 5900). If the VNC server requires authorization, then when connecting to it, the VNC client will ask for a password. Please note that the VNC server access password is not associated with any account (user account) on the remote computer, but only serves to restrict access to the VNC server display.

After establishing a connection and opening the screen, depending on the settings of the VNC server, user authorization may be required to virtual server or an already running work session of a user may be opened.

Since several VNC servers can be running on a computer at the same time, the parameter is used to separate them display number. For example, one VNC server may be running on display:0, another on display:1. Each display number corresponds to the TCP port number on which the VNC server accepts connections. The port number for the display is obtained by adding the display number to the base port number - 5900. Display:0 corresponds to TCP port 5900, display:1 - port 5901.

3. Disconnecting the VNC client from the remote computer
When closing the VNC client window or after exiting the environment using desktop tools, depending on the settings of the VNC server, the user's working session can close, stopping all programs in use, or continue working and be available again when reconnection to the VNC server.
4. Tuning the VNC client
A large amount of information transmitted to the screen entails increased requirements for the channel speed - to its bandwidth and packet transmission time. Capacity pressure leads to uncomfortable delays when big changes information shown on the screen - opening new windows, scrolling, etc. Especially long delays will occur when displaying photographs and other images or interface elements that have a large number of colors and complex shapes.

The main parameter that affects the amount of transmitted data is the encoding algorithm of the transmitted graphics. To reduce the volume and, accordingly, speed up the work, it is recommended to use the Tight, ZLib, ZRLE algorithms - in comparison with uncompressed data (Raw), they provide tens of times compression, significantly loading the processor. These coding algorithms provide comfortable work even on channels with a speed of 256-512 Kbps.

To reduce the amount of information transmitted over the network, you can also set a high compression level (Compression Level, Compression Value), low level JPEG quality(JPEG Quality) and enable the color reduction mode (-bgr233, Restricted colors). The greatest effect of them, with a noticeable decrease in image quality, is provided by the mode of reducing the number of colors - volume transmitted information decreases by 1.5-3 times, respectively, the display on the screen is accelerated by 1.5-3 times.

JPEG is used by the Tight encoding algorithm to compress areas of the screen containing photographs and other complex images with a large number colors. Using Tight+JPEG reduces the amount of data transmitted by 2-5 times. Other JPEG encoding algorithms are not supported.

1. Drop-down menu “System -> Options”

The volume of transmitted data and the display speed on the channel is 1 Mbit/sec when opening the drop-down menu “System -> Parameters” (the menu is highlighted with a green dotted line in the figure):

5. Common problems
Can't connect to VNC server
Need to check:
  1. is there access to the Internet;
  2. whether the virtual server responds to pings;
  3. whether the VNC server is running on the virtual server;
  4. is there a firewall along the way that blocks access to the TCP port of the VNC server;
  5. Is the display number or TCP port of the VNC server specified correctly (port number = 5900 + display number).
Slow operation through a fairly fast channel
If the VNC client cannot agree with the VNC server on the use of a graphics encoding algorithm with data compression, the default algorithm is selected - Raw, which transfers data without compression. Also encoding without compression or with low level compression can be automatically selected by the VNC client when working over a fast local network. This problem can be fixed by forcing the encoding algorithm to be specified in the VNC client settings high level compression - ZLib, ZRLE, Tight.

However, for some combinations of client and server, this solution may not be useful due to errors in the negotiation of the encoding algorithm. For example, a TightVNC client with a RealVNC server can often only work with Raw encoding. The solution in this case is to change the VNC client or VNC server.

Virtual Network Computing (VNC) a system for remote access to a computer desktop using the RFB (Remote FrameBuffer) protocol. Control is carried out by transmitting keyboard keystrokes and mouse movements from one computer to another and relaying screen contents through a computer network.

The VNC system is platform independent: a VNC client, called VNC viewer, running on one operating system can connect to a VNC server running on any other OS. There are client and server implementations for almost all operating systems, including J2ME). Multiple clients can connect to one VNC server at the same time. The most popular ways to use VNC are remote technical support and access to a work computer from home.

VNC was developed by AT&T. Original source codes are available under the GNU General Public License, as are many of the VNC variants that currently exist.

Story

VNC was created at Olivetti & Oracle Research Lab, which at the time was owned by Oracle Corporation. In 1999, the laboratory was acquired by AT&T, which closed the development department in 2002.

The name arose from the Videotile thin client computer network, which was an LCD panel with pen input and fast

Developers who worked on VNC at AT&T Research Lab:

  • Tristan Richardson
  • Quentin Stafford-Fraser
  • James Weatherall
  • Ken Wood
  • Andy Harter
  • Charlie McLachlan
  • Paul Webster

Device

VNC consists of two parts: client and server. Server is a program that provides access to the computer screen on which it is running. Client (or viewer) is a program that receives a screen image from the server and interacts with it.

VNC is a very simple protocol based on graphic primitives: "Put a rectangle pixel data to a position specified by coordinates.” The server sends small rectangles to the client. This scheme in its primitive form consumes most of the channel's bandwidth. Various methods are used to reduce channel load. There are various encodings- methods for determining the most efficient way to transmit these rectangles. The VNC protocol allows the client and server to "agree" on what encoding will be used. The simplest encoding method supported by all clients and servers is “raw encoding”, in which pixels are transferred in left-to-right, top-to-bottom order, and after transferring the original screen state, only the changed pixels are transferred. This method works very well for small changes to the screen image (mouse movement on the desktop, typing under the cursor), but the channel load becomes very high when a large number of pixels are changed simultaneously, for example, when watching a video in full screen mode.

By default, VNC uses the TCP port range 5900 to 5906. Each port represents a corresponding X server screen (ports 5900 to 5906 are associated with screens:0 to:6). Java clients, available in many implementations that use a built-in web server for this purpose, such as RealVNC, communicate with screens in the same way, but on the port range from 5800 to 5806. Many Windows computers may use only one port due to the lack of multiplayer properties inherent

It is also possible to connect back from the server to the client. In this case, the client is switched to Listening mode and the connection is initiated by the server on the client's TCP port 5500.

Ports can be changed.

Safety

Initially, VNC does not use traffic encryption, but in the authentication procedure the password is not transmitted in clear text, but uses a challenge-response algorithm and is used both when connecting via the Internet and in local networks. SSH clients allow you to create SSH tunnels from all major platforms (Windows,

Also many modern versions VNC supports standard protocol extensions that implement encryption and/or compression of VNC traffic, access list delimitation (English) - official version, supported by the AT&T Laboratories team

  • TightVNC (English) - alternative version based on RealVNC
  • UltraVNC (English) - implementation of VNC for Microsoft Windows
  • Vinagre (English) - VNC client for the GNOME OS desktop environment What software Is VNC better?
  • Wikimedia Foundation.

    2010.

      VNC See what "VNC" is in other dictionaries:

      VNC- son las siglas en inglés de Virtual Network Computing (Computación Virtual en Red). VNC es un programa de software libre basado en una estructura cliente servidor el cual nos permite tomar el control del ordenador servidor remotamente a través de … Wikipedia Español

      - son las siglas en inglés de Virtual Network Computing (Computación en Red Virtual). VNC es un programa de software libre basado en una estructura cliente servidor el cual nos permite tomar el control del ordenador servidor remotamente a través de … Enciclopedia Universal

      VNC

      REDIRECT Virtual Network Computing ... Wikipedia Vnc

      VNC- typische VNC Sitzung in einem Fenster Virtual Network Computing (VNC) ist eine Software, die den Bildschirminhalt eines entfernten Rechners (Server) auf einem lokalen Rechner (Client) anzeigt und im Gegenzug Tastatur und Mausbewegungen des… … Deutsch Wikipedia

    - Cette page d'homonymie répertorie les différents sujets et articles partageant un même nom. VNC, sigle composé des trois lettres V, N et C, peut faire référence à : Virtual Network Computing, un logiciel d affichage graphique distant ;… … Wikipédia en Français

    How to help your users access a multi-user Linux system from anywhere

    VNC and X server architecture The graphical user interface (GUI) in Linux® uses the X Window System (abbreviated). X is an unusual GUI in several respects, in particular it is native network interface. X server, in essence, is a program network server. Network server programs provide client programs with access to local resources, and this is true for the X server as well. The peculiarity is that in the case of the X server, “local resources” are the display, keyboard and mouse with which the user works. In the most common configuration, X client programs run on the same computer as the server. Thus, LibreOffice, the GNU Image Manipulation Program (GIMP), or other programs are X clients that use X network protocols to accept data from the user and display the results on the same computer.

    However, when X is used on a network, the user sits at an X server computer, and the X clients are programs that need to be run on another computer. This configuration requires a second network protocol, establishing a connection. This second protocol could be telnet, Secure Shell (SSH), or X Display Manager Control Protocol (XDMCP). The server for this remote login protocol runs on the X client computer, and the remote login client runs on the X server computer. The remote login server runs X clients, which in turn establish a connection to the X server. illustrates this interaction. Dotted arrows indicate the beginning of the session. (With XDMCP, the XDMCP client is built into the X server program.)

    Figure 1: Remote Access X requires a client and server on both computers

    This configuration works great in many local networks, but is not without its shortcomings. For example, it requires a two-way network protocol to be initiated, which may be prevented by a firewall or Network Address Translation (NAT) router. (SSH removes this obstacle by allowing X sessions to be tunneled.) Additionally, although X servers exist for most platforms, they are not typically installed on computers running Windows control®. For these and other reasons, many people prefer to use another protocol, Remote Frame Buffer (RFB), which is implemented in the Virtual Network Computing (VNC) family of programs.

    VNC is a cross-platform tool that provides remote access to Linux, UNIX®, Mac OS X, Windows and other systems from any type of client. The user sits at a client computer and accesses a remote server computer. In Linux, a VNC server either mirrors the contents of the local X server screen to a remote computer, or contains its own own X server, capable of running independently of whatever controls the local screen. The result is shown in Figure 2. Again, the dotted arrow indicates the start of the session. This configuration eliminates the need for a reverse network connection, and since VNC clients and servers are available for many operating systems, the same client program provides access to any server.

    Figure 2. The VNC server includes an X server that can interact with local programs through the X client

    The disadvantage of VNC is that RFB authentication is based on passwords without usernames. So each user must start an independent VNC server session and establish a connection to that VNC instance by specifying the correct port number. This requirement is tolerable for a single-user system, but causes extreme inconvenience when working on a multi-user computer.

    To solve this problem, you can combine these two approaches: reconfigure the local XDMCP server so that it helps the X server built into VNC provide the missing multi-user authentication. (The resulting configuration is illustrated in Figure 3. The dotted arrow indicates the start of the session.) Now, when remote VNC users access the VNC server computer, they can enter usernames and access passwords for their own unique VNC sessions, so that the computer can be used for as long as any users.

    Figure 3: Adding XDMCP to a VNC configuration provides increased flexibility

    Setting up a VNC server

    There are several ways to run VNC, including using scripts, binding VNC to your desktop environment using desktop instruments and using xinetd to listen to VNC connections. This latter approach is described here because it allows VNC to run in a way that can use an XDMCP server. Before moving on to the instructions for setting up VNC to run through xinetd, you must select a VNC server.

    Selecting a VNC server

    There are several VNC server programs. (See section). Some of the most popular are TightVNC, TigerVNC and RealVNC. This article uses TightVNC as an example. Unfortunately, configuration details are both server and distribution specific, so the instructions here will need to be tailored to your software.

    Installing xinetd

    Many distributions install the xinetd superserver by default, but not all. Because the method described here assumes the use of xinetd, you must install xinetd if it is not already installed. On most distributions, xinetd can be installed using a package manager, for example by calling apt-get install xinetd on distributions on Debian based or zypper install xinetd in openSUSE.

    You may also need to configure the xinetd startup process. Typically, you can use the System V (SysV) startup script for a one-time startup:

    # /etc/init.d/xinetd start

    For settings automatic start xinetd, when booting a computer, requires knowledge of the operating methods of startup scripts for your distribution. Typically this is done with a utility such as chkconfig (used on Fedora, openSUSE and related distributions), update-rc.d (used on Debian and related distributions) or rc-update (used on Gentoo), something like this:

    # chkconfig xinetd on # update-rc.d xinetd enable # rc-update add xinetd default

    Enter only one from these commands or find the equivalent for your distribution.

    Note that xinetd may not start if it is not configured to run any services. So you may have to wait to run it until you have configured xinetd to manage your VNC server.

    Setting up xinetd

    Servers to be managed by xinetd place configuration files in the /etc/xinetd.d directory. Thus, to configure xinetd to manage VNC, you need to create or edit a file with the name type /etc/xinetd.d/vnc.(On some distributions, such as openSUSE, the VNC server package installs such a file.) Listing 1 shows an example.

    Listing 1. Example VNC settings for xinetd
    service vnc ( disable = no socket_type = stream protocol = tcp wait = no user = nobody server = /usr/bin/Xvnc server_args = -inetd -once -query localhost -geometry 1024x768 -depth 16 type = UNLISTED port = 5900 )

    This entry specifies several xinetd options, most of which should be left as is. Listed below are the settings that may need to be configured.

    • service. VNC with different parameters can be run on multiple ports, but in this case, in the first line of Listing 1, you need to give VNC a separate service name for each port.
    • server. This setting needs to be changed to point to the main VNC server binary, which is usually called Xvnc.
    • server_args. You will almost certainly want to change some of these values, as described below.
    • port. VNC uses port numbers 5900 and above. You can run the server with different parameter values ​​through different ports. In this case, each instance must be assigned its own port number.

    The trickiest part of setting up xinetd is setting the server arguments. You can use the arguments shown in Listing 1 as a model, changing some of them.

    • -query localhost . This option specifies that the VNC X server should check the localhost system for XDMCP authentication. It can be changed if you want to use one computer as a translator to access the programs of another.
    • -geometry 1024x768 . This option sets the virtual resolution of the VNC session. Note that this resolution does not have to match that of a regular X server running on the server machine. You can create multiple entries running at different resolutions so that users can log into the VNC server at the resolution that suits their needs. local systems.
    • -depth 16 . This parameter sets the color depth. The lower the value, the faster the display refreshes, but distortion may appear on a screen with many colors. Range acceptable values from 2 to 32.

    There are many other options, and some of them depend on the VNC server. Refer to your VNC server documentation.

    Setting up an XDMCP server

    Majority Linux distributions configure their XDMCP servers to only manage the local display. To enable remote access, you need to reconfigure the XDMCP server to accept access requests from a VNC server running on the same computer. The details depend on the XDMCP server. The three most commonly used on Linux are GNOME Display Manager (GDM), Light Display Manager (LightDM), and KDE Display Manager (KDM). Other XDMCP servers, such as XDM, require different settings than those described here. In any case, after reconfiguring the XDMCP server, you will have to restart it.

    Editing the XDMCP Configuration File

    If you are not sure which XDMCP server is being used on your system, you can determine this by viewing the process listing using the dm line, for example:

    $ ps ax | grep dm 929 ? Ss 0:00 /usr/bin/kdm 962 tty7 Ss+ 0:19 /usr/bin/Xorg -br:0 vt7 -nolisten tcp -auth \ /var/lib/xdm/authdir/authfiles/A:0-pp4shb 30157 pts/3 S+ 0:00 grep --color=auto dm

    The first line of this printout states that KDM is running, so in order for VNC to use XDMCP, you need to edit that server's configuration file. The configuration files of most XDMCP programs follow the same format. They contain sections with names given in square brackets, such as . The lines following the section name specify parameters using an equal sign, for example: enable=true . Table 1 lists the configuration file names, section names, and parameters that must be defined for XDMCP to work on several common Linux XDMCP servers.

    Table 1. Parameters that allow XDMCP to support VNC for different XDMCP servers

    The XDMCP section in the configuration file may be completely missing. If present, it may explicitly disable XMDCP support, contain commented out options, or be empty. Regardless initial state file, you must make sure that the XDMCP section is present and that support is enabled. As an example, let's look at configuring KDM to enable XDMCP:

    Enable=true

    Some distributions allow you to enable additional security measures that you may need to relax. One of them is a firewall. Firewall scripts are typically distribution-specific, so refer to your system's documentation for instructions on configuring a firewall. You want localhost to have access to port 177 and VNC clients to access port 5900 (or any other ports that are used for VNC).

    OpenSUSE has additional file configuration, which controls some types of access, including XDMCP access: /etc/sysconfig/displaymanager. Open this file in a text editor and find the following line:

    DISPLAYMANAGER_REMOTE_ACCESS="no"

    Change the value of this parameter to "yes" . If you leave "no" , the XDMCP server login window will not be displayed when connecting to a VNC server. In most distributions this change Not required: This file only uses openSUSE.

    Restarting the XDMCP server

    When the XDMCP server is configured to support remote connections, it needs to be restarted. On distributions that start X via a SysV init file, such as Debian and Gentoo, this can be done using the restart option:

    # /etc/init.d/gdm restart

    On a system that uses runlevel to run X, such as Fedora or openSUSE, you need to go to runlevel text mode(usually 3) and then return to the GUI level (usually 5):

    # telinit 3 # telinit 5

    Keep in mind that either approach logs you out of X, so save any work you've done in your X session before continuing.

    Testing and Debugging

    You can now log in from a remote computer using a VNC client. Most Linux distributions include the vncviewer command, so you can type:

    vncviewer

    To login remotename via VNC. If VNC is configured and working correctly, the result will be something like Figure 4. If you set up multiple VNC sessions on different ports, you can specify the VNC session number by passing it as part of the hostname. Enter:

    vncviewer:3

    To log into session 3 (via port 5903).

    Figure 4. When configured to work with XDMCP, VNC provides the usual Linux prompt

    If you do not see the XDMCP login screen when you run this test, you will need to debug. Below are some recommendations.

    • If vncviewer reports that the connection was refused, it most likely means that the superserver on the VNC server machine is not configured properly. Check xinetd configuration and try restarting the superserver. It is also possible that the firewall is blocking access to the VNC server computer.
    • If the VNC client starts and connects to the server, but you only see gray screen with a cursor that can be moved, the problem is most likely with the XDMCP server configuration. Check the settings above and restart the XDMCP server.
    • Review the event log files as you would normally do when debugging. You may need to search for all log files in the /var/log directory using links to your xinetd, XDMCP server, and VNC server.

    VNC Security Issues

    RFB is not a secure protocol; Most VNC clients and servers do not encrypt their data. (VNC encrypts its own passwords, but the approach described here does not use those passwords.) Be careful when choosing how and where to install VNC. If you want to use VNC on an unsecured network, there are three options:

    • use virtual private network(VPN);
    • tunnel protocol via SSH;
    • Use a VNC option that supports encryption, such as TigerVNC with Transport Layer Security encryption capability.

    When you enable VNC login windows as described in this article, external world At least two ports are opened (VNC and XDMCP). Both ports can be restricted by firewall rules to minimize the risk of abuse. Note that the XDMCP port (UDP 177) should only be open to localhost, so the firewall rule for it can be quite restrictive.

    Conclusion

    In general, connecting VNC and XDMCP is a useful method of providing remote login with a graphical user interface for multi-user Linux computers. This method has advantages over directly applying XDMCP in a cross-platform environment or when there are problems caused by a firewall or NAT. On multi-user computers, it is preferable to the more common direct VNC connection methods. There are safety issues to consider when using this method. Be prepared to set up firewall rules to limit unwanted outside access, and use encryption if data is traveling over an untrusted network.

    To install, we need a server or remote computer, local computer with a VNC client that supports connection via an SSH tunnel. Windows users we recommend RealVNC, UltraVNC or TightVNC. On Mac OS you can use the standard Screen Sharing utility, or on app store install other VNC applications. Linux users have a wider selection of programs, such as krdc, vinagre, TightVNC, RealVNC, Remmina, etc.

    Installing Desktop Environment and VNC Server

    Default Ubuntu images 16.04 does not have a graphical desktop shell and a VNC server, which must be installed additionally. First, let's install the packages latest version Xfce desktop environment and the TightVNC package from the Ubuntu repositories.

    On the ordered server, install the Xfce and TightVNC packages.

    $ sudo apt install xfce4 xfce4-goodies tightvncserver

    To complete initial setup VNC server and after installing it, use the vncserver command to set a strong password.

    $vncserver

    You will be prompted to enter and confirm your password and specify a viewing password. Users using a browsing password will not be able to do anything with the keyboard and mouse on a VNC machine. This can be useful for demonstrating something on your VNC server to other people.

    Performance vncserver completes the VNC installation by creating default configuration files, as well as creating information for connecting to our server. After installing these packages, you can configure the server.

    Setting up a VNC server

    First, let's specify the commands that the VNC server should execute upon startup. These commands are given in configuration file xstartup in a subdirectory .vnc yours home directory. The startup script was created while the command was running vncserver in the previous step, now we will change some commands to work with Xfce.

    When you first start VNC, it launches a default server instance on port 5901. This port is called the display port, and in VNC it is designated:1. VNC can launch many instances on other ports, for example, :2, :3, and so on. When working with VNC servers, remember that display port number:X runs on port 5900 X.

    Since we are going to make changes to the VNC server configuration, we first need to stop the server instance running on port 5901.

    $ vncserver -kill:1

    The output should look similar, down to the process ID:

    Conclusion
    Killing Xtightvnc process ID 17648

    Before making changes to the new xstartup file, let's do backup copy source file.

    $ mv ~/.vnc/xstartup ~/.vnc/xstartup.bak

    Now let's create a new xstartup file using nano or another text editor.

    $ nano ~/.vnc/xstartup

    Paste these commands into a file to run them automatically when you start or restart the VNC server, then save and close the file.

    ~/.vnc/xstartup
    #!/bin/bash
    xrdb $HOME/.Xresources
    startxfce4&

    First file command xrdb $HOME/.Xresources tells the VNC GUI framework to use a custom .Xresources file. File .Xresources saves certain user desktop settings, such as terminal colors, cursor theme, font rendering. The second command instructs the server to launch Xfce, which allows you to comfortably manage your server.

    In order for the VNC server to use these settings, we will make the file executable.

    $ sudo chmod x ~/.vnc/xstartup

    Now let's restart the VNC server.

    $vncserver

    The server should restart and display something similar to the console:

    Conclusion
    New "X" desktop is your_server_name.com:1
    Starting applications specified in /home/sammy/.vnc/xstartup
    Log file is /home/sammy/.vnc/liniverse.com:1.log

    Testing the VNC desktop

    First, let's create an SSH connection on the local machine for installation secure connection with VNC. You can do this using the terminal on Linux or OS X next command. Don't forget to replace username And server_ip_address to the name of your user with sudo rights and the IP address of your server.

    $ ssh -L 5901:127.0.0.1:5901 -N -f -l username server_ip_address

    If you are using graphical SSH client eg PuTTY, set server_ip_address as the connection IP address, and also set localhost:5901 as a forwarded port in your client's SSH connection settings.

    Next, you can use your VNC client to establish a connection to the VNC server on localhost:5901 . You will be prompted to authenticate. Use the password you set in the first step.

    Once the connection is successfully established, you will see the default Xfce desktop. It should look similar:

    You now have full access to server management and files in your home directory.

    Creating a VNC Service File

    First, let's create a unit file /etc/systemd/system/ using your text editor:

    $ sudo nano /etc/systemd/system/

    Copy and paste the following content into it. Make sure you change the User field value and the user name in the PIDFILE field to your values.

    $ /etc/systemd/system/

    Description=Start TightVNC server at startup
    After=syslog.target network.target


    Type=forking
    User=sammy
    PAMName=login
    PIDFile=/home/sammy/.vnc/%H:%i.pid
    ExecStartPre=-/usr/bin/vncserver -kill:%i > /dev/null 2>&1
    ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800:%i
    ExecStop=/usr/bin/vncserver -kill:%i


    WantedBy=multi-user.target

    $ sudo systemctl daemon-reload

    Let's activate the unit file.

    $ sudo systemctl enable

    Stop the current VNC server instance if it is running.

    $ sudo systemctl start

    Let's make sure that the service is running with this command:

    $ sudo systemctl status >

    If the launch was successful, the output should look similar to:

    Name Conclusion
    This email address is being protected from spambots. You need JavaScript enabled to view it.- TightVNC server on Ubuntu 16.04
    Loaded: loaded (/etc/systemd/system/ ; enabled; vendor preset: enabled)
    Active: active (running) since Mon 2016-04-25 03:21:34 EDT; 6s ago
    Process: 2924 ExecStop=/usr/bin/vncserver -kill:%i (code=exited, status=0/SUCCESS) ... systemd: Starting TightVNC server on Ubuntu 16.04...
    systemd: pam_unix(login:session): session opened for user finid by (uid=0)
    systemd: Started TightVNC server on Ubuntu 16.04.

    Ready! You were able to install and configure the VNC server on your Ubuntu 16.04 server. From now on, you can manage files, software and settings using the familiar graphical interface.

    We present to your attention a new course from the team The Codeby- "Penetration testing of Web Applications from scratch." General theory, Environment Preparation, Passive Fuzzing and Fingerprinting, Active Fuzzing, Vulnerabilities, Post Exploitation, Tooling, Social Engeneering and much more.


    Virtual Network Computing (VNC) allows for shared access to other remote users to the localhost desktop environment over the network. To provide access to the desktop, a VNC server must be running on the local host, and deleted users connect to the VNC server using some VNC viewer client.

    In this tutorial I will explain how to set up a VNC server on Linux. For this I will be using vino, a VNC server software for the GNOME desktop environment.

    To install the VNC server vino on a machine with Debian, Ubuntu or Linux Mint:

    $ sudo apt-get install vino

    To install the vino VNC server on a machine running Fedora, CentOS or RHEL:

    $ sudo yum install vino

    After installation, you can run vino and enable the VNC server by entering the vino-preferences command.

    $vino-preferences

    The above command will open the vino settings window to access the desktop as shown below. In the window where “Sharing” is located, check the box to allow other users to see your desktop. You can also set a VNC password. When the settings are done, this window can be closed.

    In theory, the vino-preferences utility itself should start the VNC server. If the VNC server is not running for some reason, you can start the VNC server manually as follows.

    $ /usr/lib/vino/vino-server &

    On the latest Linux Mint with the Cinnamon desktop, vino-preferences are known to be missing. To enable VNC server configuration in Mint on the Cinnamon desktop, use dconf-editor instead, as described here.

    You can check if vino is running by typing the following command.

    $ sudo netstat -pl | grep vino tcp 0 0 *:5900 *:* LISTEN 3246/vino-server tcp6 0 0 [::]:5800 [::]:* LISTEN 3246/vino-server tcp6 0 0 [::]:5900 [:: ]:* LISTEN 3246/vino-server

    As you can see above, vino-server is running on TCP port with numbers 5800 and 5900. You can use any software with VNC client function to connect to the VNC server.

    If the VNC server is configured so that you must confirm each VNC access to your desktop, you will see the following pop-up message every time a VNC connection request is received. Only after you enable VNC will the VNC client be able to access your desktop.