TightVNC Installation
TightVNC Installation
About
Ravi Saive Last Updated: October 14, 2021 Open Source 44 Comments
A Beginners Guide To Learn Linux
for Free [with Examples]
[ You might also like: 11 Best Tools to Access Remote Linux Desktop ]
If you’ve installed a minimal version of the operating system, which gives only
a command-line interface not GUI. Therefore, you need to install a GUI
(Graphical User Interface) called GNOME or XFCE desktop which works very
well on remote VNC access.
Create a normal user, that will be used to connect to a remote desktop. For
example, I’ve used “tecmint” as a user, you can choose your own username.
First, switch to the user using (su – tecmint) and run ‘vncpasswd‘ to set the
VNC password for the user.
Note: This password is for accessing VNC remote desktop, and the password
we created in step 3 is for accessing the SSH session.
The above command asks you to supply a password twice and creates the
“.vnc” directory under the user’s home directory with a passwd file inside it.
You can check the password file is created, by using the following command.
# ls -l /home/tecmint/.vnc
-rw------- 1 tecmint tecmint 8 Jul 14 21:33 passwd
If you are adding another user, just switch to the user and add the vnc
password with the vncpasswd command.
session=gnome
geometry=1920x1200
localhost
alwaysshared
Search for
The session parameter defines the session you want to access, and the
geometry parameter adds the resolution of the VNC desktop.
Now exit from user login and return to root user login.
$ exit
TigerVNC comes with default configuration settings that allow you to map a
user to a specific port in the /etc/tigervnc/vncserver.users file:
# vim /etc/tigervnc/vncserver.users
If you are adding another user, just set the display port to :2 followed by the
username.
Step 6: Starting the Tigervnc Server
After making all changes, run the following command to start the VNC server.
Before starting the VNC session with a “tecmint” user, let me give you a small
intro about Port Numbers and ids.
By Default VNC runs on Port 5900 and ID:0 (which is for the root user). In our
scenario, I’ve created tecmint, ravi, Navin, and avishek. So, the ports and id’s
are used by these users as follows
To start and enable the VNC service for the user assigned to the display port
:1 , enter:
You can confirm that the VNC service is successfully started with:
# systemctl status vncserver@:1
To allow VNC access for other users, simply replace 1 with the display port
number.
Open port on iptables, firewalld or ufw, say for the user (tecmint) at 5901.
For multiple users, ravi, navin, and avishek. I open ports 5902, 5903, and 5904
respectively.
Now go to your Windows or Linux machine and download the VNC Viewer
client and install it in your system to access the desktop.
[ You might also like: How to Access Remote VNC Desktop from Web Browser
Using TightVNC Java Viewer ]
PREVIOUS ARTICLE: NEXT ARTICLE:
Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software
developer with over a decade in the field of Linux and Open
Source technologies
Was this article helpful? Please add a comment or buy me a coffee to show your
appreciation.
Related Posts
Manny
April 29, 2022 at 4:52 pm
Reply
le_berger_des_photons
January 12, 2022 at 9:39 pm
Why wouldn’t you create an icon on the desktop and/or an entry in the
list of programs to be able to click on and the vnc client starts to run
and asks for the address of the machine you want to control?
I installed it and don’t see that and I don’t know why. It seems the
developers really don’t want people to use it.
Reply
Rahul P.S
August 22, 2018 at 12:59 pm
Hello Ravi,
Reply
Author
Ravi Saive
August 23, 2018 at 12:12 pm
@Rahul,
Reply
Rahul P.S
December 11, 2018 at 2:31 pm
Reply
Author
Ravi Saive
December 11, 2018 at 5:25 pm
@Rahul,
Reply
martin
December 21, 2017 at 9:50 pm
Hi, thanks for the nice tutorial!
After following the steps, log in fails from VNC viewer, with error
message “the connection was closed unexpectedly”.
Examining the log in /home/my_username/.vnc i notice the lines
Bala
December 26, 2016 at 1:44 pm
Hi Ravi,
Reply
SANTANU MONDAL
October 27, 2016 at 12:37 pm
Please show me how configure ssh tunnel with VNC with steps
Reply
Aktar Alam
April 26, 2016 at 1:03 pm
Hi Ravi,
I followed your steps.
it worked fine ….
But my requirement was to configure the multiple vnc clients for the
same user. For e.g say user techmint.
So i added entry for the same in /etc/sysconfig/vncservers file as:
VNCSERVERS=”1:techmint 2:techmint”
VNCSERVERARGS[1]=”-geometry 1280×1024″
VNCSERVERARGS[2]=”-geometry 1280×1024″
Author
Ravi Saive
April 26, 2016 at 1:39 pm
@Aktar,
I think you can’t create multiple VNC sessions for same user,
have you tried with different multiple users? is the VNC
sessions worked for all?
Reply
Aktar Alam
April 27, 2016 at 10:51 am
Hi Ravi,
Reply
Author
Ravi Saive
April 27, 2016 at 10:56 am
@Aktar,
Thanks for sharing your findings and
configuration of both files, hope it will help
others who looking for similar problems, about
multiple VNC sessions for same users, i really
don’t have idea, i need to check and get back to
you..
Reply
Michael Tagui
April 20, 2016 at 3:00 am
Thanks a lot man, i really like your tutorial, it really makes the
installation very easy…
You deserve 100 stars
Reply
Simon
January 19, 2016 at 11:45 pm
Hello,
Kindly
Reply
antechno
December 28, 2014 at 8:24 am
http://youtu.be/N2UnYy2kdnk
Reply
Author
Ravi Saive
December 29, 2014 at 12:41 pm
@Antechno,
Are you taken written permission from us before creating videos
from our articles? this is against our copyright violation..I
request you to remove article either give proper credit to
original article..
Reply
luke
September 29, 2014 at 9:08 am
hi i did all steps and try start the service get this error
/etc/init.d/vncserver start
plymouth: ply-event-loop.c:493: ply_event_loop_new: Assertion
`loop->epoll_fd >=
0′ failed.
/etc/init.d/functions: line 543: 28173 Aborted /bin/plymouth –d
etails
system: centos6.4
Reply
DJ MHA
September 4, 2014 at 11:44 pm
Thanks for great efforts. It working great. Can you tell us how to
uninstall it properly?
Reply
James Roger
August 25, 2014 at 11:15 am
Reply
mohamad
August 12, 2014 at 7:42 pm
hi
my problem is in step 5
when i try to open commend : /etc/init.d/vncserver start
this error showing :
on centos-6-x86
Reply
Author
Ravi Saive
August 13, 2014 at 5:55 pm
Reply
steve
April 7, 2015 at 7:06 pm
Reply
Reply
Keshav
April 27, 2014 at 9:58 pm
boat
April 22, 2014 at 1:08 pm
Reply
MotherDawg
April 18, 2014 at 11:04 am
Oh Boy !
***************************************************************
2nd, This is ok for sysint and iptables. If, like the gentlemen named
Matheis, as of the date of publication of this article, one would be
using an advance distribution like Fedora 18, out Jan 15 2013 this
article is already old school.
With systemd and firewalld, most of this nice try does not work.
MotherDawg
Aka: NetWeezurd
Reply
Keshav
April 27, 2014 at 10:00 pm
Reply
Madhu
April 9, 2014 at 5:58 pm
Reply
soo
April 7, 2014 at 6:22 pm
/etc/init.d/vncserver start
thank you.
Reply
Maki
March 19, 2014 at 9:59 am
Thank you
Reply
venkat
March 17, 2014 at 6:21 pm
how to resolve too many security failures vnc server how to check vnc
server logs and how check which ip address are connected to vnc
server please guide me
Reply
Author
Ravi Saive
March 18, 2014 at 2:38 pm
Under user’s home directory you will see a .vnc directory where
you can see the log file of each vnc session like
‘mymachine.localnet:1.log’. And about checking vnc
connection sessions, you can use netstat command to list vnc
ports or use ps -fax to check running vnc services.
Reply
shamrat
March 7, 2014 at 3:14 pm
hi, I have managed to configure the vnc but when I log in there are
some files that I can not edit/delete as vncuser, how can I give vnc
user root lever access I have tried to do something like:
vncserver:0;0…… to give it root access on users file. But now I cant log
in to vnc either.
Reply
shamrat
February 27, 2014 at 8:56 pm
I followed the steps on my centos 6.5 final VPS trying to connect from
windows 7 but is says “connection refused (10061)” I also tried telnet
from comments above on SSH it says telnet: connect to address
xxx.xxx.xxx.xxx: Connection refused
Reply
brandon
February 17, 2014 at 7:04 am
Thank you!
Reply
tarun
January 26, 2014 at 4:16 pm
Reply
Arrey
December 11, 2013 at 11:25 pm
Thanks
Reply
Dave Matheis
October 24, 2013 at 11:37 am
I have been having trouble with this under Fedora since version 18.
Under Gnome 3.6 I could set it in forced fallback mode and using the
Cinnamon desktop could get it to work. Now with gnome 3.8 there is
no fallback mode option. I went all through your setup instructions,
with modification for using systemctl to start/stop vncserver, and it
all seems to work fine until I enter the VNC password. The remote
desktop window opens but says “Oh no! Something has gone wrong. A
problem has occurred and the system can’t recover. Please log out
and try again.”
I have been searching the web for a solution to this for nearly a year
and so far have not had any luck getting it to work. Any ideas?
Thanks,
Dave
Reply
Sidney Markowitz
January 7, 2014 at 3:39 am
I had a messy setup working for Cinnamon under Fedora 18, but
got the “Oh no!” again after upgrading to Fedora 19. However
now it appears that there is a much simpler solution in Fedora
19. Install tiger-vncserver, copy file vncserver@.service to
vncserver@:1.service and edit to replace the two uses of to the
correct user name and add the -geometry and -depth options
you want to the vncserver command line, just like you would to
use vnc with the Gnome desktop.
#!/bin/bash
exec /usr/bin/cinnamon-session
Reply
Radek Lát
January 27, 2014 at 10:12 pm
Reply
Brice FROMENTIN
August 11, 2013 at 3:26 pm
Reply
Mohd imran
October 15, 2014 at 5:57 pm
hi,
Best Regards
Mohd Imran Raini
Reply
Author
Ravi Saive
October 16, 2014 at 6:21 pm
Dear Imran,
Reply
Thank you for taking the time to share your thoughts with us. We
appreciate your decision to leave a comment and value your contribution
to the discussion. It's important to note that we moderate all comments
in accordance with our comment policy to ensure a respectful and
constructive conversation.
Rest assured that your email address will remain private and will not be
published or shared with anyone. We prioritize the privacy and security of
our users.
Name *
Email *
Save my name, email, and website in this browser for the next time I
comment.
Post Comment
Linux Server Monitoring Tools Learn Linux Tricks & Tips Best Linux Tools
HardInfo – Check Hardware Tips to Create ISO from CD, Watch 27 Best Tools for VMware
Information in Linux User Activity and Check Memory Administrators in 2023
Usages of Browser
20 Useful Commands of ‘Sysstat’ 5 Linux Command Line Based Tools
Utilities (mpstat, pidstat, iostat and How to Check Which Apache for Downloading Files and Browsing
sar) for Linux Performance Modules are Enabled/Loaded in Websites
Monitoring Linux
10 Best Open Source Forum
Monit – A Open Source Tool for 3 Ways to Extract and Copy Files Software for Linux in 2023
Managing and Monitoring Linux from ISO Image in Linux
40 Must-Have Free Open Source
System
10 Useful Sudoers Configurations Applications for 2023
10 Strace Commands for for Setting ‘sudo’ in Linux
24 Best Open Source Text Editors for
Troubleshooting and Debugging
How to Set or Change System Linux in 2023
Linux Processes
Hostname in Linux
Best RDP (Remote Desktop) Clients
How to Install Zabbix Monitoring
How to Set and Unset Local, User for Linux
Tool on Debian 11/10
and System Wide Environment
Smem – Reports Memory Variables in Linux
Consumption Per-Process and Per-
User Basis in Linux
Tecmint: Linux Howtos, Tutorials & Guides © 2023. All Rights Reserved.
The material in this site cannot be republished either online or offline, without our permission.
Hosting Sponsored by : Linode Cloud Hosting