{"id":72,"date":"2011-09-15T20:57:31","date_gmt":"2011-09-16T00:57:31","guid":{"rendered":"http:\/\/www.grumpyland.com\/blog\/?p=72"},"modified":"2015-04-23T10:10:19","modified_gmt":"2015-04-23T14:10:19","slug":"tutorial-installing-vnc-for-centos-6-vps","status":"publish","type":"post","link":"https:\/\/www.grumpyland.com\/blog\/72\/tutorial-installing-vnc-for-centos-6-vps\/","title":{"rendered":"Installing VNC for Centos 6 (VPS)"},"content":{"rendered":"<h2>How to Install VNC on Centos 6 (VPS)<\/h2>\n<p>Well, I usually don&#8217;t make these tutorials because there are often tons out there already available. However, I found the existing ones incomplete or inadequate to complete the task. So, this is meant to start from the very very fresh starting point.<\/p>\n<p>First, let&#8217;s install essentials to run a VNC &#8211; the desktop.<br \/>\nYou can choose any desktop environment you like, but this tutorial is going to focus with XFCE. (Who can afford to install Gnome\/KDE on a VPS anyway?)<\/p>\n<p>CentOS 6 min (version that usually comes with vps) by default does not come with specific desktop environment package information, so, we need to add that first if you plan to use any other than default.<br \/>\nFor example we&#8217;ll use XFCE (desktop environment).<\/p>\n<p>First, we need the source to install XFCE from since default centos repos do not carry it. So, install epel. Also, instead of giving you a direct link, which is bound to be wrong in time, go to this page:<\/p>\n<p>http:\/\/download.fedoraproject.org\/pub\/epel\/6\/i386\/<\/p>\n<p>now find &#8220;epel-release-X-X.noarch.rpm&#8221;. The X-X should be the newest version they have.<\/p>\n<pre lang=\"sh\" line=\"1\" escaped=\"true\">wget http:\/\/download.fedoraproject.org\/pub\/epel\/6\/i386\/epel-release-X-X.noarch.rpm\r\nrpm -ivh epel-release-X-X.noarch.rpm<\/pre>\n<p>Now you should have the package info for xfce4 and you can confirm this by doing either of below<\/p>\n<pre lang=\"sh\" line=\"3\" escaped=\"true\">yum search xfce4                       \r\nyum groupinfo Xfce<\/pre>\n<p>Next, install the desktop environment along with necessary parts for it.<\/p>\n<pre lang=\"sh\" line=\"5\" escaped=\"true\">yum groupinstall Desktop Fonts Xfce<\/pre>\n<p>That will take a while&#8230;<\/p>\n<p>Next, we move onto installing the actual VNC. In centos 6, the vncserver is called &#8220;tigervnc-server&#8221; as opposed to the previous name &#8220;vncserver&#8221;.<\/p>\n<pre lang=\"sh\" line=\"6\" escaped=\"true\">yum install -y tigervnc-server<\/pre>\n<p>We also need users to run the VNC environment since we don&#8217;t want to run it under root.<\/p>\n<pre lang=\"sh\" line=\"7\" escaped=\"true\">useradd testuser                       \r\npasswd testuser<\/pre>\n<p>now login to testuser via new SSH connection&#8230; or if you&#8217;re lazy&#8230;<\/p>\n<pre lang=\"sh\" line=\"9\" escaped=\"true\">su -l testuser<\/pre>\n<p>Now create a password for your VNC<\/p>\n<pre lang=\"sh\" line=\"10\" escaped=\"true\">vncpasswd<\/pre>\n<p>You should now be able to confirm that the vnc password file has been created<\/p>\n<pre lang=\"sh\" line=\"11\" escaped=\"true\">cd .vnc                                              \r\nls<\/pre>\n<p>should have &#8216;passwd&#8217; in there.<\/p>\n<p>Back on root now!! (type &#8220;exit&#8221; if you used su)<\/p>\n<p>You should now edit the VNC server configurations<\/p>\n<pre lang=\"sh\" line=\"13\" escaped=\"true\">nano \/etc\/sysconfig\/vncservers<\/pre>\n<p>If you don&#8217;t have nano, you can use any other editor or install nano as well.<\/p>\n<pre lang=\"sh\" line=\"14\" escaped=\"true\">VNCSERVERS=\"1:testuser\"\r\nVNCSERVERARGS[1]=\"-geometry 1024x786\"<\/pre>\n<p>This will allow the vncserver to start with a resolution of 1024&#215;786 with testuser on :1. The &#8220;1&#8221; not only defines its identification number, it is also the port that it will use (in vncs: 1, in raw: 590<span style=\"text-decoration: underline;\">1<\/span>).<\/p>\n<p>Now start your VNC as root<\/p>\n<pre lang=\"sh\" line=\"16\" escaped=\"true\">service vncserver start<\/pre>\n<p>It will run each vncservers you defined in the above file.<\/p>\n<p>To stop\/restart, you can&#8230;<\/p>\n<pre lang=\"sh\" line=\"17\" escaped=\"true\">service vncserver stop\r\nservice vncserver restart<\/pre>\n<p>If you&#8217;d like your VNC to start at boot:<\/p>\n<pre lang=\"sh\" line=\"19\" escaped=\"true\">\/sbin\/chkconfig vncserver on<\/pre>\n<p>And that&#8217;s it!<\/p>\n<p>Please be warned that this is an unsecured line to your VNC. If you suspect that someone&#8217;s snooping on your traffic, be sure to secure it by having an SSH tunnel or similar methods. But I&#8217;m going to end my tutorial here.<\/p>\n<p>~Grumpy<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>With that done&#8230; You probably want to install some essentials to use the VNC. And bunch of really useful ones are in RPM Forge.<br \/>\nBelow are two links for RPM Forge for 32bit and 64bit relatively.<\/p>\n<pre lang=\"sh\" line=\"1\" escaped=\"true\">i686 http:\/\/packages.sw.be\/rpmforge-release\/rpmforge-release-0.5.2-2.el6.rf.i686.rpm\r\nx86_64 http:\/\/packages.sw.be\/rpmforge-release\/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm<\/pre>\n<p>You&#8217;ll need to download that and install it.<\/p>\n<pre lang=\"sh\" line=\"1\" escaped=\"true\">wget [above link]\r\nrpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm<\/pre>\n<p>You can test that RPM forge is working by installing something like..<\/p>\n<pre lang=\"sh\" line=\"1\" escaped=\"true\">yum install htop<\/pre>\n<p>Firefox<\/p>\n<pre lang=\"sh\" line=\"1\" escaped=\"true\">yum install firefox<\/pre>\n<p>Flash Plugin<\/p>\n<pre lang=\"sh\" line=\"1\" escaped=\"true\">yum install flash-plugin<\/pre>\n<p>etc&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Install VNC on Centos 6 (VPS) Well, I usually don&#8217;t make these tutorials because there are often tons out there already available. However, I found the existing ones incomplete or inadequate to complete the task. So, this is meant to start from the very very fresh starting point. First, let&#8217;s install essentials to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"categories":[15],"tags":[6,8,7],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-tutorial","tag-centos-6","tag-vnc","tag-vps"],"_links":{"self":[{"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":18,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":212,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions\/212"}],"wp:attachment":[{"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.grumpyland.com\/blog\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}