VNCServerの構築

# まずvncにログインする一般ユーザにsuします。
su - vncでログインするユーザ名

# ログインするユーザでパスワードを設定
vncpasswd

# /etc/sysconfig/vncserversを編集
VNCSERVERS="1:ログインするユーザ名"
VNCSERVERARGS[1]="-geometry 800x600"

# vncserverを起動
/etc/rc.d/init.d/vncserver start


これでvncviewerにて接続できるようになります。一旦接続してみるとわかりますが、立ち上がるのはtwmなので、かなり質素なGUIです。 Gnomeを立ち上げるには、初回VNC起動時に作成されるxstartupのtwm行をコメントアウトし、exec gnome-session &という一行を入れればよい。

# ~/.vnc/xtartupの編集

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