{"id":1500,"date":"2012-01-05T11:22:47","date_gmt":"2012-01-05T15:22:47","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1500"},"modified":"2013-03-20T08:44:20","modified_gmt":"2013-03-20T12:44:20","slug":"howto-install-and-configure-vncserver-in-linux","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/howto-install-and-configure-vncserver-in-linux","title":{"rendered":"Howto Install and Configure VNCserver in Linux?"},"content":{"rendered":"<p>The common method to manage a Linux server remotely is through CLI interface via SSH, which many people often find it difficult as they are not familar with the Linux commands.<\/p>\n<p>The solution is to install a KDE Or GNOME Desktop on the Linux server and access it through VNC. VNC (Virtual Network Computing) is a graphical desktop sharing system which allows you to share a desktop of a remote server as if you are sitting in front of it.<\/p>\n<p>Following are the steps to install and configure VNC on a Linux server:<\/p>\n<p><strong>1.<\/strong> Install the vnc-server packages.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># yum install vnc*<\/span><\/pre>\n<\/blockquote>\n<p><strong>2.<\/strong> Now, edit the file \/etc\/sysconfig\/vncservers and add the following lines at the end:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">VNCSERVERS=\"1:root\"<\/span>\r\n<span style=\"color: #0000ff;\">VNCSERVERARGS[1]=\"-geometry 800x600\"<\/span><\/pre>\n<\/blockquote>\n<p>This will enable VNC on terminal 1 with 800&#215;600 resolution.<\/p>\n<p><strong>3.<\/strong> Next step is to create a startup file in .vnc directory under the user&#8217;s home directory, in this case it is \/root<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># nano \/root\/.vnc\/xstartup<\/span><\/pre>\n<\/blockquote>\n<p><strong>4.<\/strong> Now, add the following in the file<\/p>\n<blockquote>\n<pre>###########################<\/pre>\n<pre>#!\/bin\/sh\r\n\r\n# Uncomment the following two lines for normal desktop:\r\nunset SESSION_MANAGER\r\nexec \/etc\/X11\/xinit\/xinitrc\r\n\r\n[ -x \/etc\/vnc\/xstartup ] &amp;&amp; exec \/etc\/vnc\/xstartup\r\n[ -r $HOME\/.Xresources ] &amp;&amp; xrdb $HOME\/.Xresources\r\nxsetroot -solid grey\r\nvncconfig -iconic &amp;\r\nxterm -geometry 80x24+10+10 -ls -title \"$VNCDESKTOP Desktop\" &amp;\r\nstartkde &amp;\r\n\r\n#############################<\/pre>\n<\/blockquote>\n<p>The last line in the above file indicates that it will start the KDE desktop by default. To start the GNOME desktop, replace the last line with &#8220;exec gnome-session &amp;&#8221;<\/p>\n<p><strong>5.<\/strong> Set execute permissions on the file:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># chmod 755 \/root\/.vnc\/xstartup<\/span><\/pre>\n<\/blockquote>\n<p><strong>6.<\/strong> Now set a vnc password for user &#8216;root&#8217;<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># vncpasswd<\/span><\/pre>\n<\/blockquote>\n<p><strong>7.<\/strong> Once done, start the vncserver and it should show something like below:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"><strong># vncserver<\/strong><\/span>\r\nNew 'server.hostname:1 (root)' desktop is server.hostname:1\r\nStarting applications specified in \/root\/.vnc\/xstartup\r\nLog file is \/root\/.vnc\/server.hostname:1.log<\/pre>\n<\/blockquote>\n<p>where, server.hostname above is your server&#8217;s hostname. The log file will be created under the .vnc directory of the users home directory. The Linux server side part is done.<\/p>\n<p><strong>8.<\/strong> Now, download and install VNC-Viewer on your computer (client-side). Open vnc-viewer and enter &#8220;server.hostname:1&#8221; (use your server IP instead of server.hostname) and the vnc password you have set above. You will now be connected to the graphical interface of your Linux server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The common method to manage a Linux server remotely is through CLI interface via SSH, which many people often find it difficult as they are not familar with the Linux commands.<br \/>\nThe solution is to install a KDE Or GNOME Desktop on the Linux server and access it through VNC. VNC (Virtual Network Computing) is a graphical desktop sharing system which allows you to share a desktop of a remote server as if you are sitting in front of it.<br \/>\nFollowing are the steps to install and configure VNC on [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1331,1335,1333,1332,1337,1338,1339,1336],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1500"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1500"}],"version-history":[{"count":9,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1500\/revisions"}],"predecessor-version":[{"id":2280,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1500\/revisions\/2280"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}