michihide's blog

技術メモおよび雑感

VNCServer for CentOS5.3

サーバ側のインストールと起動(システム管理者が一度だけ行う)

root@vnc-server:~# yum install vnc-server twm xterm
root@vnc-server:~# vi /etc/sysconfig/vncservers
(以下のように追加…)
VNCSERVERS="2:user1 3:user2 4:user3"(数字を増やして追加していく)
root@vnc-server:~# service xfs start(動いてなければ)
root@vnc-server:~# service vncserver start
VNC サーバー を起動中: 2:user1 xauth:  creating new authority file /home/user1/.Xauthority

New 'vnc-server.example.com:2 (user1)' desktop is vnc-server.example.com:2

Creating default startup script /home/user1/.vnc/xstartup
Starting applications specified in /home/user1/.vnc/xstartup
Log file is /home/user1/.vnc/vnc-server.example.com:2.log

初回準備(接続したいユーザが個別に行う)

user1:vnc-server~$ vncpasswd
Password: (自分のパスワード)
Verify: (自分のパスワード)

Windows から VncViewer で接続

  • 接続先として【サーバ名:数字】を指定
  • 数字 は VNCSERVERS で指定しているディスプレイ番号

デスクトップの変更(任意)
●変更前(デフォルトの殺風景なTWM

user1@vnc-server:~$ cat .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" &
twm &

●変更後(これでデスクトップが Gnome になる)

user1@vnc-server:~$ cat .vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

デスクトップサイズの変更

  • まだ成功していない><