TightVNC is a very handy remote desktop application which is based on VNC protocol. TightVNC is mostly used for Linux systems in order to manage a remote desktop environment with GUI. In this tutorial, we will look at how to install and configure properly to run desktop environments like KDE, GNOME, XFCE, etc. with TightVNC.
Install Ubuntu, Debian, Mint, Kali
We can use the following command to install deb
based distributions.
$ sudo apt install tightvncserver

Install CentOS, Fedora, RHEL
We can use the following command to install rpm
based distributions.
$ sudo yum install tightvncserver
Start VNC Server
Now we need to specify a desktop environment for our VNC session. Actually, we have not created a VNC session yet but we will create a new one to create default configuration files. We run the following command by providing a password for the VNC session.
$ vncserver

We can see that during VNC server start a password is specified which will be asked to the VNC clients want to connect this VNC server. Then the question wheter we want to create a view-only password. View-only password can be used to only view VNC sessions but can not control it. New VNC server session is create with the number 1 which means the server port is 5901
which is also called as ubuntu:1
.
xstartup Configuration File
All VNC Server related configuration is held in a file named xstartup
which is located in the user’s home directory .vnc
folder. Let’s print the default configuration. In this case, the VNC configuration file is located /home/ismail/.vnc/xstartup
.
$ cat .vnc/xstartup

Set Desktop Environment For KDE
In order to enable KDE desktop environment with a new VNC session, we need to add the following line to the xstartup
file.
startkde &
Set Desktop Environment For GNOME
In order to enable GNOME desktop environment with a new VNC session, we need to add the following line to the xstartup
file.
gnome-session &
Set Desktop Environment For XFCE
In order to enable GNOME desktop environment with a new VNC session, we need to add the following line to the xstartup
file.
startxfce4 &
Set Desktop Environment For LXDE
In order to enable GNOME desktop environment with a new VNC session, we need to add the following line to the xstartup
file.
lxsession &
Kill VNC Server or Session
As we have started a VNC server or session to create default configuration files. We need to kill it we can kill the VNC server with the -k
option and the session ID. In this example, we will kill the session ID 1
.
$ vncserver -kill :1

Start Server or Session
Now we can start a new server with the command vncserver
where the default configured desktop will be fired-up.
$ vncserver
Connect with VNC Client
VNC servers start with port number 5900
and count one by one with the session ID. For example, if we have given session ID 3 the port number will be configured as 5903
. We can connect with a VNC client which is explained in the following tutorial in detail.
Best VNC Viewer Clients For Linux
192.168.115.123:5901

verry good thanks.!
I have been accessing our LINUX CentOS computer remotely from several windows bases computers for approx 4 years now with Tightvnc. For the last week, I will get an ‘Authentication failure’ when I try to login remotely. The only way I can fix the issue is to reboot the host computer. Any idea what my be causing this issue & how to fix it?
Hi Tom,
I may be related to a temporary file but in order to understand the root of the problem, we need some log and investigation. We can provide support for this. Please contact with ismail.baydan@kaleinfo.com
Have a nice day.
I have a question: On my Samsung Galaxy Tab 2 10.1 wifi I tried to install Linux Distro Ubuntu using Linux Deploy and VNC Remote Desktop Viewer as stated in the Youtube Video. All went fine except for the VNC Viewer when trying to display Ubuntu Desktop. The message I get is: “The port that the Computer is listening to can not make a connection”……? So, Ubuntu never opens..! The VNC app I got from Google Playstore.com and it said before downloading that the app may not be fully optimized for your device….. Does your application have any faults to this application of installing Linux on my Tab 2..?
Thanks in Advance….James..
Can i limited the port, for example if i run “vncserver” with root user that start with port “1” but if i run again this command “vncserver” it again run the vnc service in port “2”
we need to limited the root or any other user fix port “1” and if we run “vncserver” so service not start in other ports
Can i limited the VNC port, for example if i run “vncserver” with root user that start with port “1” but if i run again this command “vncserver” it again run the vnc service in port “2”
So now we need to limited this if vnc service run in “1” port with root user so if root user again run this command service not run or run in same “1” port
It is possible ?
All I get is a grey screen with an X which is a cursor of sorts. Versions of server and viewer are the same.
I have the same issue 🙁
Same here, KDE Plasma 5.18
Same issue (grey screen) on my remote connection