{"id":2423,"date":"2014-02-17T16:00:04","date_gmt":"2014-02-17T16:00:04","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=2423"},"modified":"2014-02-17T16:00:04","modified_gmt":"2014-02-17T16:00:04","slug":"install-vnc-server-on-ubuntu-server","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2014\/02\/17\/install-vnc-server-on-ubuntu-server\/","title":{"rendered":"How to install VNC server on Ubuntu Server 12.04"},"content":{"rendered":"<p>VNC is a protocol that is used to share the desktop with other users\/computers over the network\/Internet.In order to share a desktop, VNC server must be install and configure on the computer and VNC client must be run on the computer that will access the shared desktop.<\/p>\n<p>When we install the fresh copy of Ubuntu Server, it only gives us the \u201cCommand Line\u201d interface.<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/119.jpg\"><img fetchpriority=\"high\" decoding=\"async\" title=\"1\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/119.jpg?w=1260&amp;h=736\" width=\"630\" height=\"368\" \/><\/a><\/p>\n<p>But some people prefer GUI instead and for this they install Full version of Gnome on Ubuntu Server. Actually there is a better way and that is to install VNC. VNC provides a lightweight virtual desktop than full blown version of Gnome.<\/p>\n<p>To install the core\u00a0components of gnome, use this command:<\/p>\n<pre>sudo apt-get install gnome-core<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/1a.jpg\"><img decoding=\"async\" title=\"1a\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/1a.jpg?w=1260&amp;h=120\" width=\"630\" height=\"60\" \/><\/a><\/p>\n<p>To\u00a0install a virtual desktop,\u00a0use this command:<\/p>\n<pre>sudo apt-get install vnc4server<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/1b.jpg\"><img decoding=\"async\" title=\"1b\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/1b.jpg?w=1260&amp;h=116\" width=\"630\" height=\"58\" \/><\/a><\/p>\n<p>In order to use VNC, we need to\u00a0setup a password using the following command:<\/p>\n<pre>vncserver<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/216.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"2\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/216.jpg?w=1260&amp;h=506\" width=\"630\" height=\"253\" \/><\/a><\/p>\n<p>To make a tweak in startup script, we need to kill the session that we just created:<\/p>\n<pre>vncserver -kill :1<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/315.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"3\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/315.jpg?w=1260&amp;h=168\" width=\"630\" height=\"84\" \/><\/a><\/p>\n<p>Now open up the file that we need to edit:<\/p>\n<pre>cd ~\nnano .vnc\/xstartup<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/413.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"4\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/413.jpg?w=1260&amp;h=120\" width=\"630\" height=\"60\" \/><\/a><\/p>\n<p>And Modify the file so it looks like this:<\/p>\n<pre>#!\/bin\/sh\n# Uncomment the following two lines for normal desktop:\nunset SESSION_MANAGER\n#exec \/etc\/X11\/xinit\/xinitrc\ngnome-session --session=gnome-classic &amp;\n\n[ -x \/etc\/vnc\/xstartup ] &amp;&amp; exec \/etc\/vnc\/xstartup\n[ -r $HOME\/.Xresources ] &amp;&amp; xrdb $HOME\/.Xresources\nxsetroot -solid grey\nvncconfig -iconic &amp;\n#x-terminal-emulator -geometry 1280x1024+10+10 -ls -title \"$VNCDESKTOP Desktop\" &amp;\n#x-window-manager &amp;<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/57.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"5\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/57.jpg?w=1260&amp;h=786\" width=\"630\" height=\"393\" \/><\/a><\/p>\n<p>Next, create the VNC Session once more:<\/p>\n<pre>vncserver -geometry 1024x600<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/65.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"6\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/65.jpg?w=1260&amp;h=318\" width=\"630\" height=\"159\" \/><\/a><\/p>\n<p>Now, download\u00a0<a href=\"http:\/\/www.realvnc.com\/download\/viewer\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>VNCViewer<\/strong><\/a>\u00a0onto our desktop computer from which we want to access the shared desktop.\u00a0Connect using\u00a0ServerIP\/Name:1\u00a0(:1\u00a0is for the VNC server window), In my case it is\u00a0tendo:1.<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/75.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"7\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/75.jpg?w=630\" width=\"412\" height=\"247\" \/><\/a><\/p>\n<p>Enter the password that we created using the\u00a0<strong>vncserver<\/strong>\u00a0command:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/85.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"8\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/85.jpg?w=630\" width=\"469\" height=\"272\" \/><\/a><\/p>\n<p>We now have GUI access to our server.<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/94.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"9\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/94.jpg?w=1260&amp;h=770\" width=\"630\" height=\"385\" \/><\/a><\/p>\n<p>After reboot the server, we will not be able to connect to the server with VNC, this is because the \u201cvncserver -geometry 1024\u00d7600\u201d command that we typed above is not persistent. To solve this problem, we will use an excellent script of<a href=\"http:\/\/superuser.com\/questions\/147109\/automatically-start-vnc-server-on-startup\" target=\"_blank\" rel=\"noopener noreferrer\">Justin Buser<\/a>.<\/p>\n<p>As sudo user create the file (and directory if it doesn\u2019t exist):<\/p>\n<pre>sudo mkdir -p \/etc\/vncserver\nsudo touch \/etc\/vncserver\/vncservers.conf\nsudo nano \/etc\/vncserver\/vncservers.conf<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"r1\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r1.jpg?w=1260&amp;h=240\" width=\"630\" height=\"120\" \/><\/a><\/p>\n<p>Add servers as needed for each user by adding something like the following to the\u00a0vncservers.conf\u00a0file we just created:<\/p>\n<pre>VNCSERVERS=\"1:arbab\"\nVNCSERVERARGS[1]=\"-geometry 1024x600 -depth 24\"<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"r2\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r2.jpg?w=1260&amp;h=204\" width=\"630\" height=\"102\" \/><\/a><\/p>\n<p>Next, create an empty init script and make it executable:<\/p>\n<pre>sudo touch \/etc\/init.d\/vncserver\nsudo chmod +x \/etc\/init.d\/vncserver\nsudo nano \/etc\/init.d\/vncserver<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r3.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"r3\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r3.jpg?w=1260&amp;h=236\" width=\"630\" height=\"118\" \/><\/a><\/p>\n<p>Add the following to\u00a0\/etc\/init.d\/vncserver:<\/p>\n<pre>#!\/bin\/bash\nunset VNCSERVERARGS\nVNCSERVERS=\"\"\n[ -f \/etc\/vncserver\/vncservers.conf ] &amp;&amp; . \/etc\/vncserver\/vncservers.conf\nprog=$\"VNC server\"\nstart() {\n . \/lib\/lsb\/init-functions\n REQ_USER=$2\n echo -n $\"Starting $prog: \"\n ulimit -S -c 0 &gt;\/dev\/null 2&gt;&amp;1\n RETVAL=0\n for display in ${VNCSERVERS}\n do\n export USER=\"${display##*:}\"\n if test -z \"${REQ_USER}\" -o \"${REQ_USER}\" == ${USER} ; then\n echo -n \"${display} \"\n unset BASH_ENV ENV\n DISP=\"${display%%:*}\"\n export VNCUSERARGS=\"${VNCSERVERARGS[${DISP}]}\"\n su ${USER} -c \"cd ~${USER} &amp;&amp; [ -f .vnc\/passwd ] &amp;&amp; vncserver :${DISP} ${VNCUSERARGS}\"\n fi\n done\n}\nstop() {\n . \/lib\/lsb\/init-functions\n REQ_USER=$2\n echo -n $\"Shutting down VNCServer: \"\n for display in ${VNCSERVERS}\n do\n export USER=\"${display##*:}\"\n if test -z \"${REQ_USER}\" -o \"${REQ_USER}\" == ${USER} ; then\n echo -n \"${display} \"\n unset BASH_ENV ENV\n export USER=\"${display##*:}\"\n su ${USER} -c \"vncserver -kill :${display%%:*}\" &gt;\/dev\/null 2&gt;&amp;1\n fi\n done\n echo -e \"\\n\"\n echo \"VNCServer Stopped\"\n}\ncase \"$1\" in\nstart)\nstart $@\n;;\nstop)\nstop $@\n;;\nrestart|reload)\nstop $@\nsleep 3\nstart $@\n;;\ncondrestart)\nif [ -f \/var\/lock\/subsys\/vncserver ]; then\nstop $@\nsleep 3\nstart $@\nfi\n;;\nstatus)\nstatus Xvnc\n;;\n*)\necho $\"Usage: $0 {start|stop|restart|condrestart|status}\"\nexit 1\nesac<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r4.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"r4\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r4.jpg?w=1260&amp;h=790\" width=\"630\" height=\"395\" \/><\/a><\/p>\n<p>We\u2019ll need to run\u00a0vncserver\u00a0command AT LEAST ONCE AS EACH USER that want to login as. I put that in caps because if you skip that step none of it will work.<\/p>\n<p>Finally, do the following:<\/p>\n<pre>sudo update-rc.d vncserver defaults 99<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r5.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"r5\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r5.jpg?w=1260&amp;h=426\" width=\"630\" height=\"213\" \/><\/a><\/p>\n<p>Now, restart the service by typing:<\/p>\n<pre>sudo service vncserver restart<\/pre>\n<p><code><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r6.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"r6\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/r6.jpg?w=1260&amp;h=410\" width=\"630\" height=\"205\" \/><\/a><\/code><\/p>\n<h6>Ability to connect for multiple users:<\/h6>\n<p>Create a local user, using the following command:<\/p>\n<pre>sudo adduser hussain<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu1.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu1\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu1.jpg?w=1260&amp;h=610\" width=\"630\" height=\"305\" \/><\/a><\/p>\n<p>Switch to the newly created user and run\u00a0vncserver\u00a0command for it:<\/p>\n<pre>su hussain\nvncserver<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu2\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu2.jpg?w=1260&amp;h=584\" width=\"630\" height=\"292\" \/><\/a><\/p>\n<p>Move to the home directory and edit the\u00a0xstartup\u00a0file:<\/p>\n<pre>cd ~\nnano .vnc\/xstartup<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu3.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu3\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu3.jpg?w=1260&amp;h=166\" width=\"630\" height=\"83\" \/><\/a><\/p>\n<p>Modify the file so it looks like this:<\/p>\n<pre>\u00a0\n#!\/bin\/sh\n# Uncomment the following two lines for normal desktop:\nunset SESSION_MANAGER\n#exec \/etc\/X11\/xinit\/xinitrc\ngnome-session --session=gnome-classic &amp;[ -x \/etc\/vnc\/xstartup ] &amp;&amp; exec \/etc\/vnc\/xstartup\n[ -r $HOME\/.Xresources ] &amp;&amp; xrdb $HOME\/.Xresources\nxsetroot -solid grey\nvncconfig -iconic &amp;\n#x-terminal-emulator -geometry 1280x1024+10+10 -ls -title \"$VNCDESKTOP Desktop\" &amp;\n#x-window-manager &amp;<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu4.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu4\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu4.jpg?w=1260&amp;h=792\" width=\"630\" height=\"396\" \/><\/a><\/p>\n<p>Now open up the\u00a0\/etc\/vncserver\/vncservers.conf\u00a0file as sudo user:<\/p>\n<pre>sudo nano \/etc\/vncserver\/vncservers.conf<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu5.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu5\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu5.jpg?w=1260&amp;h=118\" width=\"630\" height=\"59\" \/><\/a><\/p>\n<p>Add servers for newly created user by adding something like this:<\/p>\n<pre>VNCSERVERS=\"1:arbab 2:hussain\"\nVNCSERVERARGS[1]=\"-geometry 1024x600 -depth 24\"\nVNCSERVERARGS[2]=\"-geometry 1024x600 -depth 24\"<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu6.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu6\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu6.jpg?w=1260&amp;h=248\" width=\"630\" height=\"124\" \/><\/a><\/p>\n<p>Restart the service:<\/p>\n<pre>sudo service vncserver restart<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu7.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu7\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu7.jpg?w=1260&amp;h=580\" width=\"630\" height=\"290\" \/><\/a><\/p>\n<p>Connect with newly created user using\u00a0tendo:2, Where\u00a0tendo\u00a0is my server name:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu8.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu8\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu8.jpg?w=630\" width=\"401\" height=\"239\" \/><\/a><\/p>\n<p>Enter the password that we created using the\u00a0<strong>vncserver<\/strong>\u00a0command:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu9.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu9\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu9.jpg?w=630\" width=\"424\" height=\"345\" \/><\/a><\/p>\n<p>We now have GUI access to our server for newly created user.<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu10.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nu10\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nu10.jpg?w=1260&amp;h=770\" width=\"630\" height=\"385\" \/><\/a><\/p>\n<h6>Preventing Gnome to start on boot on the server:<\/h6>\n<p>Gnome is automatically started on boot in Ubuntu 12.04 LTS, if we connect a monitor to our server we will see that GUI sitting there waiting for us to log in.<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/desktop.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"desktop\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/desktop.jpg?w=1260&amp;h=728\" width=\"630\" height=\"364\" \/><\/a><\/p>\n<p>To prevent it, edit the\u00a0gdm.conf\u00a0file:<\/p>\n<pre>sudo nano \/etc\/init\/gdm.conf<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nb11.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nb1\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nb11.jpg?w=1260&amp;h=118\" width=\"630\" height=\"59\" \/><\/a><\/p>\n<p>Comment these six lines:<\/p>\n<pre>#start on ((filesystem\n# and runlevel [!06]\n# and started dbus\n# and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1\n# or stopped udev-fallback-graphics))\n# or runlevel PREVLEVEL=S)<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nb2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"nb2\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/nb2.jpg?w=1260&amp;h=790\" width=\"630\" height=\"395\" \/><\/a><\/p>\n<p>Reboot the server and that GUI log-in screen will no longer appear:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/last.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"last\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/last.jpg?w=1260&amp;h=736\" width=\"630\" height=\"368\" \/><\/a><\/p>\n<h6>VNC encrypted through the ssh tunnel:<\/h6>\n<p>By default, VNC is not secure protocol.VNC uses encryption during initial connection and login (passwords are not sent in plain-text). Once, we connected then all the VNC data is unencrypted and hacker could sniff our VNC session.\u00a0It is better (safer) to start VNC server only on 127.0.0.1(localhost) and tunnel it over secure SSH tunnel (For this,there are options in Putty).<\/p>\n<p>On Ubuntu, edit\u00a0\/etc\/vncserver\/vncservers.conf:<\/p>\n<pre>sudo nano \/etc\/vncserver\/vncservers.conf<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/129.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"1\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/129.jpg?w=1260&amp;h=126\" width=\"630\" height=\"63\" \/><\/a><\/p>\n<p>Add the option \u201c-localhost\u201c:<\/p>\n<pre>VNCSERVERS=\"1:arbab 2:hussain\"\nVNCSERVERARGS[1]=\"-geometry 1024x600 -depth 24 -localhost\"\nVNCSERVERARGS[2]=\"-geometry 1024x600 -depth 24 -localhost\"<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/223.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"2\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/223.jpg?w=1260&amp;h=790\" width=\"630\" height=\"395\" \/><\/a><\/p>\n<p>Restart the service:<\/p>\n<pre>sudo service vncserver restart<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/320.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"3\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/320.jpg?w=1260&amp;h=588\" width=\"630\" height=\"294\" \/><\/a><\/p>\n<p>Here is visual, how to connect to VNC Server through PuTTY(SSH) from Windows Machine.<\/p>\n<p>Run\u00a0PuTTY,enter the IP address or hostname of the VNC Server:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/416.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"4\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/416.jpg?w=630\" width=\"464\" height=\"445\" \/><\/a><\/p>\n<p>On the left-hand panel, Go to\u00a0Connection<strong>\u00a0-&gt;<\/strong>\u00a0SSH\u00a0<strong>-&gt;<\/strong>\u00a0Tunnels:<\/p>\n<pre>Source Port:590x(Where x is a value that we set in vncservers.conf,like 1 for arbab)\nDestination:localhost:590x(Same x value that we used above in source port)<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/510.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"5\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/510.jpg?w=630\" width=\"466\" height=\"446\" \/><\/a><\/p>\n<p>Click\u00a0Open\u00a0button in order to connect to the Server via SSH:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/68.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"6\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/68.jpg?w=630\" width=\"464\" height=\"446\" \/><\/a><\/p>\n<p>Login to the Ubuntu (VNC Server) with username and password:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/77.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"7\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/77.jpg?w=1260&amp;h=674\" width=\"630\" height=\"337\" \/><\/a><\/p>\n<p>Upon successful connection to VNC Server, we\u2019ll find port\u00a05901\u00a0is in listening mode on localhost:<\/p>\n<pre>netstat -a<\/pre>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/88.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"8\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/88.jpg?w=1260&amp;h=638\" width=\"630\" height=\"319\" \/><\/a><\/p>\n<p>Run\u00a0VNC Viewer\u00a0and enter the\u00a0localhost:1(:1\u00a0is for\u00a0arbab\u00a0user, that we defined in vncservers file):<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/97.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"9\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/97.jpg?w=630\" width=\"405\" height=\"262\" \/><\/a><\/p>\n<p>Enter the password, in order to connect to the VNC Server:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/105.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"10\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/105.jpg?w=630\" width=\"498\" height=\"351\" \/><\/a><\/p>\n<p>Now, we are connected to remote VNC Server through ssh tunnel:<\/p>\n<p><a href=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/1112.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"11\" alt=\"\" src=\"http:\/\/rbgeek.files.wordpress.com\/2012\/06\/1112.jpg?w=1260&amp;h=776\" width=\"630\" height=\"388\" \/><\/a><\/p>\n<p>Hope this will help you!<\/p>\n<h3 class=\"zemanta-related-title\" style=\"margin: 0 0 10px 0; padding: 0; clear: both;\">Related articles across the web<\/h3>\n<ul class=\"zemanta-article-ul zemanta-article-ul-image\" style=\"margin: 0; padding: 0; overflow: hidden;\">\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/blog.shineservers.com\/install-vnc-server-centos\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/232740948_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/blog.shineservers.com\/install-vnc-server-centos\/\" target=\"_blank\" rel=\"noopener noreferrer\">How To Install VNC Server On CentOS<\/a><\/li>\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/blog.shineservers.com\/install-vnc-server-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/232740935_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/blog.shineservers.com\/install-vnc-server-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\">Install VNC Server On Ubuntu<\/a><\/li>\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/osamajaber.wordpress.com\/2013\/12\/20\/remote-you-without-monitor-using-vnc\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/232117847_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/osamajaber.wordpress.com\/2013\/12\/20\/remote-you-without-monitor-using-vnc\/\" target=\"_blank\" rel=\"noopener noreferrer\">Remote you without Monitor using VNC<\/a><\/li>\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/www.Ruchirablog.com\/ubuntu-remote-desktop\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/163740450_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/www.Ruchirablog.com\/ubuntu-remote-desktop\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to setup Ubuntu remote desktop<\/a><\/li>\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"https:\/\/www.digitalocean.com\/community\/articles\/how-to-setup-vnc-for-ubuntu-12\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/188805264_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"https:\/\/www.digitalocean.com\/community\/articles\/how-to-setup-vnc-for-ubuntu-12\" target=\"_blank\" rel=\"noopener noreferrer\">How To Setup VNC For Ubuntu 12<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>VNC is a protocol that is used to share the desktop with other users\/computers over the network\/Internet.In order to share a desktop, VNC server must be install and configure on the computer and VNC client must be run on the computer that will access the shared desktop. When we install the fresh copy of Ubuntu [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[53],"tags":[],"class_list":["post-2423","post","type-post","status-publish","format-standard","hentry","category-general"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/2423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=2423"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/2423\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=2423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=2423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=2423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}