[TUTORIAL] How To Setup VNC Server Linux For Remote Desktop ur Machine
This Tutorial Worked Fine For Centos Any Version
From the root ssh we gonna install VNC-server.
first install desktop package
yum groupinstall Desktop
yum install gnome-core xfce4 firefox
yum install tigervnc-server
Now make the service on after every reboot
chkconfig vncserver on
3 Adding VNC user
For security reasons i suggest add new vnc user..
Or u can Still using user=root
if want keep using root for vnc user
just skip the Adding VNC user part below and go directly to vnc password set and continue to the configuration part
In my case I am i will use new user for vnc.
user=XTony it will differ in your case. You can use any username for the same.
Now I will assign the vncpassword for the user with the user I just created before as:
su - XTony
[[email protected] ~]# su - XTony
[[email protected] ~]$ vncpasswd
[[email protected] ~]$
Now I will make the configuration file for the vncserver by creating file as follows:
at the last two line of the file uncomment it and give the entries like this.
Here your port comes to be 5901 & 1024x768 resolution for the VNC client, you can choose resolution of your own choice.
Now I will restart the VNC server service as root user:
service vncserver restart
[[email protected] ~]# service vncserver restart
Shutting down VNC server: [ OK ]
Starting VNC server: 1:XTony xauth: creating new authority file /home/XTony/.Xauthority
New 'server1.example.com:1 (XTony)' desktop is server1.example.com:1
Creating default startup script /home/XTony/.vnc/xstartup
Starting applications specified in /home/XTony/.vnc/xstartup
Log file is /home/XTony/.vnc/server1.example.com:1.log
[ OK ]
[[email protected] ~]#
If you need any help post below.
Interesting, thanks Any recommendations re VNC client to use on Windows…?
yes do you from windows to other machine or from machine to windows
if you mean from windows to linux : u can use TigerVNC
windows to windows : not need to install anything just make sure remote desktop option is activated in your destination windows and use remote desktop conection .
Sorry for not being clear: I was asking about windows to linux box, after setting it up following your tutorial… thanks.
Can the port be changed as well? And how to do that? (e.g. for use on a NAT VPS)
through an ADSL router that performs NAT, i.e. all the PC's have subnet
addresses (10.0.0.X), which means they cannot be accessed as such from a
remote VNC client through the Internet.
I know the public IP address of the router, but haven't found anything
to build an IP address for individual PC's in the LAN (the ones running
servers) that can be addressed from a remote VNC client.
OK, this is an expanded answer to the one I gave somebody else
asking about VNC'ing to a server behind NAT. I assumed that
they had control of the NAT, I didn't realise that some ISPs
NAT'd people's connections.
So, I'm assuming that this is your setup (xDSL with home router):
(fixed font for this, folks)
In this example, the router has an IP address a.b.c.d (static, I
Since the router is the only one
with a 'proper' (ie, public - ie, addressable through the internet)
IP address, you can only connect your VNCviewer to ports on this
lets say you want to connect your viewer to
port 5900 on PCs 1,2 & 3.
So you need to forward 3 ports on the
router to port 5900 on PC1,2 & 3.
So, go into your router config, find 'port forwarding' (this may
be called something else - anyone seen a different term for this?)
and setup (for example)
....so you can now connect via the internet to your PCs using
vncviewer, and connecting to a.b.c.d:1 will give you PC1,
a.b.c.d:2 will give you PC2 etc.
Does that make sense? Post the model of your router and somebody
can probably give you the exact details of the port forwarding
iam testing this tutorial for windows 8 to centos 6 and work as well without xrdp server (i dont recommend it for windows just install vnc server directly)
just after install vnc server on ur target machine eg:126.96.36.199
then install tigervnc in your windows machine
and connect to your target machine (for example)
i using 5901 because the port spefied in my configuration is 1 as below:
if i locate it to "3" as below
then i will connect to
Weren't you suppose to open ports 5901 to allow remote connections?...
@XTony, you have a very nice website. Which web designer did you use?
OMG! So true!
And nice to see you btw
↑ this! I'd asked whether it would be possible to change the port on which the VNC server listens, so that I could choose one of the ports already allocated to my NAT'd VPS by my provider (where I have no control over this, but have the list of randomly allocated ports to choose from).
Seems I'd correctly assumed the VNC client could be manually configured accordingly to use the chosen port, so no problem at the client (Windows) end.
Actually iam the designer
Nice skills there! Can I hire you to design my websites as well?
you dont need to open the port
for Nat users
the idea it not change the Vnc port
but forward a port to the vnc port as specified before
i have no probleme let me check it first
This tutorial is copied almost word for word too.
Yep, that works Can use iptables for that. This said, it adds to complexity with no added utility. Would be more elegant to simply set the port(s) in the VNC server config.
yep u can use iptable:
and make sure the following line is enabled, and set to "1":
Save the file, then run:
188.8.131.52 = to target machine
venet0 = Ethernet adapter
7705 = target Nat port
5901 = vnc port
iptables -t nat -A PREROUTING -d 184.108.40.206 -p tcp -m tcp --dport 5901:7705 -j DNAT --to-destination 220.127.116.11
18.104.22.168 = root server
iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE
** cough * backupsy.com * cough*
It gets better: https://i.kamranali.uk/0d14f93d878bc084d378.png
Until earlier the logo was also that of Asura Hosting
Actually you are not.
Could you please clarify why you are using a ripped version of backupsy.com's design for your site? And why are you posting ripped tutorials? I am really looking forward to your "explanation".
I've spoken to Alex Wacker at Backupsy. He is looking into it.
Oh, I think they know! @serverian = Oktay Kilic, Backupsy's owner
Hosting at OVH.
He is also displaying fake testimonials on his site and claims that they originate from WHT and LET... :-) Not to mention the very funny "HARRY UP!" in his header.
i just starting in the service before 3 days so dont show me as a scam
i will change the design soon
Maybe he needs a 3 day ban then?
Off-topic: When did you become an administrator @Ishaq? Congratulations anyway!
Good news! He changed the color of the site from blue to green. That makes it totally original, right?
Also no more "HARRY UP!"