Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with OpenID
Advertise on LowEndTalk.com

In this Discussion

How to Install VNC on CentOS?

How to Install VNC on CentOS?

DewlanceVPSDewlanceVPS Member
edited October 2012 in Tutorials

Hello,

Most of peoples want to use Desktop Instead of SSH because of many problems(If they can't configure something from SSH or they don't know how to manage VPS through command line)

How to Install VNC on CentoS VPS? Login to your SSH Client and run this command.

yum install vnc-server (If asking for permission then send "y" command)

yum install vnc (Send "y" command if ask for permission)

yum groupinstall "GNOME Desktop Environment" (This can take long time but depend on your vps hardware performance and internet speed)

yum install nano (Ignore this command if already installed)


Modify vncservers file

nano /etc/sysconfig/vncservers Replace this with this line VNCSERVERS="2:root" VNCSERVERARGS[1]="-geometry 640x480"


Now we need to start vncserver

vncserver (Note: If ask for password then enter your VPS Root password)
If successfully started then you will get a output result like New 'hostname.example.com:1 (root)' desktop is hostname.yourdomain.com:1 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/hostname.example.com:1.log


Currently vnc is running but we need to start VNC in gnome session :)

nano /root/.vnc/xstartup Uncomment 2 lines in xstartup file(Remove "#" from starting lines) '#unset SESSION_MANAGER' '#exec /etc/X11/xinit/xinitrc`

And Change last line to:

exec gnome-session &


Kill VNC Process

vncserver -kill :1


Now Again you need to Start VNC

vncserver


Finally you will see a success output like: New 'hostname.example.com:1 (root)' desktop is hostname.yourdomain.com:1 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/hostname.example.com:1.log


Congarulations Now you can access your VNC Account using your main IP of VNC

Example: xx.x.x.x:1


How to Access VNC? You can access your VNC from any VNC Viewer or VNC Client. (Search in google: "VNC Viewer")

If show blank screen or "X" mouse cursor? - If your server is protected by Firewall(iptables,etc) then try to disable your firewall and If start working then restart your firewall and open VNC Ports.

How to open VNC Port in iptables?

'iptables -I INPUT -m state –state NEW -p tcp –dport 5800 -j ACCEPT' 'iptables -I INPUT -m state –state NEW -p tcp –dport 5801 -j ACCEPT' 'iptables -I INPUT -m state –state NEW -p tcp –dport 5900 -j ACCEPT' 'iptables -I INPUT -m state –state NEW -p tcp –dport 5901 -j ACCEPT'

Cheap $9/Year Hosting - Cheap Windows VPS & Linux Xen VPS at affordable price. FlameTix.com - cPanel/SolusVM/CloudLinux License - BTC/PM
Tagged:
Thanked by 1ErawanArifNugroho

Comments

  • Nice tutorial, however you've made the title seem like a question.

    SimpleNode | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

  • @SimpleNode said: Nice tutorial, however you've made the title seem like a question.

    Thanks, Its so easy to Install and configure VNC..

    Its a easiest method to Install VNC server but you will face a problem If you try to install VNC on normal user(no root access)

    Cheap $9/Year Hosting - Cheap Windows VPS & Linux Xen VPS at affordable price. FlameTix.com - cPanel/SolusVM/CloudLinux License - BTC/PM
  • Also, this may not be the best place for it. Most (if not all) people on LET probably have a basic idea as to how to do this already.

    SimpleNode | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

  • Thank you for this tutorial anyway :)

    My blog | Server Uptime | I'm not working for any providers in here, all my comments just my own opinion.image
  • Thanks.

  • RandyRandy Disabled

    See.. you are doing the right thing now

  • Just an FYI: VNC passwords are limited to 8 characters, which can be viewed as insecure nowadays. A consideration is to use SSH tunneling, or NX.

    I am no longer affiliated with IPXcore.
  • @Damian said: Just an FYI: VNC passwords are limited to 8 characters, which can be viewed as insecure nowadays. A consideration is to use SSH tunneling, or NX.

    Yes, Secure VNC via SSH Tunnel or use VNC only when you need and If you exit from VNC then login to ssh client area and stop your vnc server

    vncserver -kill :PORT service vncserver stop

    Cheap $9/Year Hosting - Cheap Windows VPS & Linux Xen VPS at affordable price. FlameTix.com - cPanel/SolusVM/CloudLinux License - BTC/PM
  • DewlanceVPSDewlanceVPS Member
    edited October 2012

    @Randy said: See.. you are doing the right thing now

    Now I want to go to.. image

    Cheap $9/Year Hosting - Cheap Windows VPS & Linux Xen VPS at affordable price. FlameTix.com - cPanel/SolusVM/CloudLinux License - BTC/PM
  • Good tutorial, keep doing good stuff for the community and I am sure people will love you more :)

    http://BornIn.Asia - FREE shared hosting and subdomain service for LET members! Click here to see how to get one yourself! 96Forum: Low End VPS Discussions. Selling domains with GApp with various user counts (10 year reg incl. for some), PM for details.

  • Personally I prefer LXDE over Gnome. It eats far less ram and just has a cleaner overall appearance. We have a tutorial which covers Centos, Ubuntu and Debian. It also covers the install of several applications users might want...

    http://wiki.bluevm.com/index.php?title=VNC_on_OpenVZ

    BlueVM | Best VPS Deals [~] 1GBPS, RAID-10, OpenVZ/KVM, 8 amazing locations. [~]
  • InfinityInfinity Retired Staff

    Nice to see you trying @DewlanceVPS :)

    It will be helpful for some people, although I prefer NX over VNC although it's a little more complicated..

    我是一个巨魔 (;

  • @Damian said: A consideration is to use SSH tunneling, or NX. agreed - I use server and client binaries from nomachine's NX and it's fantastic, and very fast.

  • @DewlanceVPS said: Now I want to go to..

    Is that a bridge in Ashura story?

    My blog | Server Uptime | I'm not working for any providers in here, all my comments just my own opinion.image
  • What is this "NX" you speak about?

    Is it http://www.nomachine.com/ ??

    SimpleNode | Minecraft and VPS Hosting | KVM and OpenVZ | Dallas, TX and Phoenix, AZ | PayPal and BitCoins accepted

  • You can change to Fluxbox if VPS is 128MB to 256MB

    yum -y groupinstall "X Window System" yum -y install fluxbox

  • Thanks everyone :)

    Cheap $9/Year Hosting - Cheap Windows VPS & Linux Xen VPS at affordable price. FlameTix.com - cPanel/SolusVM/CloudLinux License - BTC/PM
Sign In or Register to comment.