Centos – problems setting up vnc on centos

centosvnc

I am new to using linux and would like to setup vnc – it used to work but I don't know what has happened and now it doesn't seem to be working. Any suggestions would be greatly appreciated. thanks.

EDIT

I have added this to the '/etc/sysconfig/vncservers'

VNCSERVERS="1:admin"
VNCSERVERARGS[1]="-geometry 800x600"

and my /home/admin/.vnc/xstartup file looks like

 #!/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" & 
gnome-session &

/usr/sbin/ss5 -m -t &

env LC_CTYPE=zh_TW.utf8 WINEPREFIX="/home/admin/.wine" wine "C:\ \Program Files\\uTorrent\\uTorrent.exe" &

However when I try and connect I get

alt text

And the /home/admin/.vnc/inverses:1.log file looks like

Sat Sep 26 17:44:15 2009
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on port 5901
 vncext:      Listening for HTTP connections on port 5801
 vncext:      created VNC server for screen 0
error opening security policy file /usr/lib/xserver/SecurityPolicy
Could not init font path element /usr/share/X11/fonts/TTF/, removing from list!
Could not init font path element /usr/share/X11/fonts/OTF, removing from list!
Could not init font path element /usr/share/X11/fonts/CID/, removing from list!
Could not init font path element /usr/share/X11/fonts/100dpi/, removing from list!
Could not init font path element /usr/share/X11/fonts/75dpi/, removing from list!
sh: /home/admin/.vnc/xstartup: Permission denied

Best Answer

You could alternatively setup VNC to run as part of the XVNC startup by enabling the vnc.so module in the X config as follows:

Edit your XF86conig file located here:

/etc/X11/xorg.conf

Modify the Module section to enable VNC as follows:

Section "Module"
...
...
Load "vnc"
End Section

You can then enable security by adding the following to the Screen Section

Section "Screen"
...
...
Option "SecurityTypes" "VncAuth"
Option "UserPasswdVerifier" "VncAuth"
Option "PasswordFile" "/root/.vnc/passwd"
EndSection

Lastly log in as root using su and create your VNC passwords using the following command:

vncpasswd

Restart X or the machine and this should give you VNC access to X-Windows.

Source

Related Topic