VNC-me…


So I was messing around with VNC this past week since I haven’t posted anything in a while I thought I would share this trivial yet useful process to be up and running in a few minutes… Sorry if my notes are a bit scattered…

Set up  VNC server:

for root:
[root@oracler5u5 ~]# rpm -qa|grep vnc
vnc-4.1.2-14.el5_3.1
vnc-server-4.1.2-14.el5_3.1
from  /root: Or the users home dir:
mkdir .vnc
cd .vnc

vncpasswd
Password:
Verify:

vi xstartup
#!/bin/sh
# Add the following line to ensure you always have an xterm available.
( while true ; do xterm ; done ) &
# 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 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &

cat /etc/sysconfig/vncservers
VNCSERVERS=”1:root 2:gmc 3:emf”
VNCSERVERARGS[1]=”-geometry 1152×864″
VNCSERVERARGS[2]=”-geometry 1152×864″
VNCSERVERARGS[3]=”-geometry 1152×864″

[root@oracler5u5 ~]# service vncserver restart
Shutting down VNC server: 1:root 2:gmc 3:emf               [  OK  ]
Starting VNC server: 1:root
New ‘oracler5u5.proserve.local:1 (root)’ desktop is oracler5u5.proserve.local:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/oracler5u5.proserve.local:1.log

2:gmc
New ‘oracler5u5.proserve.local:2 (gmc)’ desktop is oracler5u5.proserve.local:2

Starting applications specified in /home/gmc/.vnc/xstartup
Log file is /home/gmc/.vnc/oracler5u5.proserve.local:2.log

3:emf
New ‘oracler5u5.proserve.local:3 (emf)’ desktop is oracler5u5.proserve.local:3

Starting applications specified in /home/emf/.vnc/xstartup
Log file is /home/emf/.vnc/oracler5u5.proserve.local:3.log

[  OK  ]

Add approprite ports to iptables:
-A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 5900 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 5902 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state –state NEW -m tcp –dport 5903 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state –state NEW -m udp –dport 5900 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state –state NEW -m udp –dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state –state NEW -m udp –dport 5902 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state –state NEW -m udp –dport 5903 -j ACCEPT

Done

Connect with VNC Viewer:

192.168.11.53:5901        root user as defined in /etc/sysconfig/vncservers
192.168.11.53:5902        gmc user as defined in /etc/sysconfig/vncservers
192.168.11.53:5903        emf user as defined in /etc/sysconfig/vncservers
cat /etc/sysconfig/vncservers
VNCSERVERS=”1:root 2:gmc 3:emf”
VNCSERVERARGS[1]=”-geometry 1152×864″
VNCSERVERARGS[2]=”-geometry 1152×864″
VNCSERVERARGS[3]=”-geometry 1152×864″

Advertisements

, , , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: