User login

Current jobs

No job postings to display

Site Counter

  • Site Counter: 52812
  • Unique Visitor: 7525
  • Registered Users: 17
  • Unregistered Users: 0
  • Your IP: 38.107.191.106
  • Since: 2008-09-18

 

Setup vnc-server on Redhat or CentOS

1. Install vnc-server package

    yum install vnc-server

2. edit /etc/sysconfig/vncservers

VNCSERVERS="1:user1 2:user2"
VNCSERVERARGS[1]="-geometry 1280x800"
VNCSERVERARGS[2]="-geometry 1280x800"

3. Setting a password

To add some security we need to add a password that must be given before a connection can be established, open a terminal and type:
$ su - user1
$ vncpasswd
Password:
Verify:

4. Starting the server and startup options
/etc/init.d/vncserver start

Now the server is started and a user could connect, however they will get a plain grey desktop by default as the connection will not cause a new
session of X to start by default, to fix this we need to edit the startup script in the .vnc folder in your home directory.

$ vi ~/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &
 

 

Your rating: None