Difference between revisions of "VNC Access on headnode"

From Define Wiki
Jump to navigation Jump to search
(Created page with "===== Install VNC ===== If you want to use vncviewer on the actual headnode, you need to install the pacakge '''vnc''' <syntaxhighlight> yum install vnc # on > centos 5.6, use vnc-serv...")
(No difference)

Revision as of 11:08, 7 December 2012

Install VNC

If you want to use vncviewer on the actual headnode, you need to install the pacakge vnc

yum install vnc

# on > centos 5.6, use vnc-server
yum install vnc-server
Update Server config

Edit the /etc/sysconfig/vncservers file

<append the following>
VNCSERVERS="1:root 2:viglen"
VNCSERVERARGS[1]="-geometry 1280x1024"
VNCSERVERARGS[2]="-geometry 1280x1024"
Set User Passwords

For each user you've added, run vncserver to set a password:

[pacey@pcmtest ~]$ vncserver 

You will require a password to access your desktops.

Password:
Verify:

New 'pcmtest.viglen.co.uk:3 (pacey)' desktop is pcmtest.viglen.co.uk:3

Creating default startup script /home/pacey/.vnc/xstartup
Starting applications specified in /home/pacey/.vnc/xstartup
Log file is /home/pacey/.vnc/pcmtest.viglen.co.uk:3.log

Or if you need to change the user password

# NOTE vnc password are insecure, only first 8 characters are used
vncpasswd
Modify User XStartup File

Edit the ~/.vnc/xstartup file for earch user

#!/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" &
#twm &
Restart the VNCServer

kill off any vnc servers and restart the daemon

[root@pcmtest ~]# pkill Xvnc
[root@pcmtest ~]# /etc/init.d/vncserver restart 
Shutting down VNC server: 1:root 2:pacey 3:viglen          [  OK  ]
Starting VNC server: 1:root 
Welcome!  The PCM web GUI is installed.  It is available here:
    http://pcmtest.viglen.co.uk:8080/platform

New 'pcmtest.viglen.co.uk:1 (root)' desktop is pcmtest.viglen.co.uk:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/pcmtest.viglen.co.uk:1.log

2:pacey 
New 'pcmtest.viglen.co.uk:2 (pacey)' desktop is pcmtest.viglen.co.uk:2

Starting applications specified in /home/pacey/.vnc/xstartup
Log file is /home/pacey/.vnc/pcmtest.viglen.co.uk:2.log

3:viglen 
New 'pcmtest.viglen.co.uk:3 (viglen)' desktop is pcmtest.viglen.co.uk:3

Starting applications specified in /home/viglen/.vnc/xstartup
Log file is /home/viglen/.vnc/pcmtest.viglen.co.uk:3.log

                                                           [  OK  ]


Access the VNC Server

Use ssh for port forwarding instead of having the VNC port open

ssh -L9000:localhost:5903 viglen@pcmtest.viglen.co.uk

then on another terminal run:
vncviewer localhost:9000

[* note vncviewer is part of the vnc package in centos, may need to be installed]

NOTE
- vnc password is the one that was set using vncpasswd above
- desktop lock password is the users standard password
- once user logs out from ssh session, vnc access will no longer be available