• The friendly Linux forum for all users.
Dismiss Notice
Welcome to Linux Forum! As we have just launched, please help us grow by telling your friends about us and posting in the forum. Thanks!

Linux Remote Control (VNC)

Discussion in 'LF Linux Articles' started by Jarret, Feb 16, 2017.

  1. Jarret

    Jarret Moderator Staff Member

    I am sure there have been times, for those of you who have multiple PCs in the home, when you wish you could be sitting in front of a different system for a few minutes. You hate having to go to the other system and you wish for a better way. The answer is Virtual Network Computing (VNC).

    With VNC you can control another system from your system without having to move to the other system. Before we start anything you need to create an account on the Real VNC website.

    Licensing

    For non-commercial use you can get a free license. The non-commercial license allows there to be 3 users and 5 systems connecting to the VNC Server. To get the license go to ‘https://manage.realvnc.com/pricing?_ga=1.178138533.1426530024.1486955341’ and select ‘Activate’ under ‘HOME’. If you truly want more connections then you can select another option that will require you to pay for the license key.

    You will be required to set up a free account. An e-mail will be sent to the e-mail address you supplied to verify your e-mail information. Open the e-mail and click ‘Verify’.

    On the last web page you were on there should be an option download the VNC Connect.

    Setting up a VNC System to Control

    You need to get the Server Software for the system which is to be controlled by another system or systems. The system to be controlled is the VNC Server. You can have more than one VNC Server on a network. On the VNC Server go to the web site ‘https://www.realvnc.com/download/vnc/linux/’, or use the last web page you were on, and select your Linux type. Once selected you will need to click on the button to Download the latest version of ‘VNC Connect’.

    The options for the different Linux downloads are:
    • Deb x86
    • Deb x64
    • RPM x86
    • RPM x64
    • Generic x86
    • Generic x64
    There is also the option to get the software for Windows, Mac OS X, Raspberry Pi, Solaris, HP-UX and AIX systems. Choose the appropriate version you need and download the file to your system. Preferably place the file in the ‘/tmp’ folder inside a sub-folder called ‘VNC Server’.

    Once downloaded you can then install the VNC Server. Open a Terminal and go to the folder ‘/tmp/VNC Server’, or whatever folder you placed the file into. Performing the ‘ls’ command you should see a file similar to ‘VNC-6.0.1-Linux-x64-DEB.tar.gz’. The name may be different depending on the version as well as the system type you selected to download.

    The file is a compressed file which must be extracted to allow you to access the files inside the compressed one. To extract the compressed file perform the command ‘tar -xvf [file name]’. In the example of my command, I would use the command ‘tar -xvf VNC-6.0.1-Linux-x64-DEB.tar.gz’.

    Once extracted there should be two files in the ‘/tmp’ folder with the one already downloaded. They should be similar to the following:
    1. VNC-Viewer-6.0.1-Linux-x64.deb
    2. VNC-Server-6.0.1-Linux-x64.deb
    The ‘VNC-Viewer’ file is the file needed to control the VNC Server. The ‘VNC-Server’ file is needed to create the VNC Server which is to be controlled. My files are ‘.deb’ since I have a Debian system. If you have a Red Hat Linux System then you would have file extensions ‘.rpm’.

    Debian VNC Server

    For the Debian Server I would select the ‘VNC-Server-6.0.1-Linux-x64.deb’ and double click it in the Graphical User Interface (GUI). From a Terminal you can also type the command ‘./VNC-Server-6.0.1-Linux-x64.deb’ to start the installation of the VNC Server.

    NOTE: Some compressed files will extract to the same folder as the downloaded file. Others may produce a folder in which the Server and Viewer files are placed.

    When you double-click on the icon in the GUI a program should start such as a ‘Package Installer’. If all dependencies are satisfied then you should be able to simply click on the ‘Install Package’ button. You will be asked for the Root password to complete the installation. Once the install is completed close the ‘Package Installer’.

    Red Hat VNC Server

    Download your appropriate Red Hat files, either ‘x86’ or ‘x64’, and place it in /tmp/VNC Server’ or wherevever you prefer. You should have two files which are named:
    1. VNC-Viewer-6.0.1-Linux-x64.rpm
    2. VNC-Server-6.0.1-Linux-x64.rpm
    The first file is used to install the viewer which is the program to control the VNC Server. The second file is used to make a VNC Server which is controlled by the VNC Viewer.

    In a GUI select the VNC Server file and double-click it to start the VNC Server installation. You should be prompted for the Root password to complete the installation. Once the installation is completed you can close the installer and be ready to license the VNC Server.

    Finishing the Licensing

    To start the Licensing app use the command ‘sudo vncserver-x11 -service’ from a Terminal.

    On one of your Desktop Panels should be an icon for the VNC Server. Click it and you should have the option to select ‘Licensing’. You will be prompted to log in with the e-mail address and password you previously created.

    Once your username and password are verified you will be prompted to add a password for users to use to connect to the VNC Server for security. Hopefully there is a window similar to that of Figure 1.

    Figure 01.jpg
    FIGURE 1

    Your system should be ready to be controlled from a client system using VNC Viewer.

    VNC Viewer

    On the Client System which you want to use to control the VNC Server, you need to install the VNC Viewer. Whether Debian or Red Hat you can double-click on the VNC Viewer in the GUI. You should be prompted for the Root Password to complete the installation.

    After the Viewer is installed close the installer and then open the VNC Viewer. Once the VNC Viewer is started you will need to check the box to accept the terms and conditions before pressing ‘OK’. The next window shows what you can do with the VNC Viewer. Click on ‘GOT IT’ to continue.

    You will be prompted for your credentials of your VNC Account. Use the e-mail address and password you set up previously. Once the VNC Viewer is started and ready you should see a list of VNC Server Systems listed. Choose the server and you will then be prompted for the password you set to connect to the server. Type in the password you set.

    You should then be able to control the VNC Server. Move the cursor and double click on icons to open the selected item.

    You download the VNC Viewer for all of the before mentioned systems as well as Android. The VNC Viewer can be downloaded from the Google Store. Connecting is the same since the VNC Viewer is similar. Be aware that the link may be slow on some systems since the client system should have good bandwidth as well as a processor to handle the connection and video. The VNC Server should also have adequate bandwidth to pass the video through to the client viewer.

    Stopping VNC Server

    At some point you may want to stop the VNC Server on your system. To stop the VNC Server in Service Mode you need to issue the following command in a Terminal. The command is as follows:

    sudo vncserver-x11 -service -stop

    Issue the command and the icon should disappear from the desktop panel where it had appeared when you started it. Once stopped, no VNC Client can connect to the VNC Server.

    The Raspberry Pi

    It was stated before that the Real VNC Server can be used on the Raspberry Pi. The Linux distro called Raspbian has the Real VNC Server already installed on it. To make it work you need to start the ‘raspi-config’ from a Terminal and open the connection for VNC.

    Once opened, VNC should operate fine. Use a VNC Viewer type program to access the Raspberry Pi by its IP Address. Keep in mind that the used Ports are:
    • 5801 – HTTP connections
    • 5901 – RFB Connections
    • 6001 – X Applications
    The Raspberry Pi should not require any of the licensing that the VNC Connect requires.

    I hope you try out a VNC connection and see what you can do with it. Enjoy!
     

Share This Page