ぶろぐ

日記です

VNCセットアップ(CentOS5.5)



VNCインストールしたのでメモ。
何気にググるのめんどくさい。検証用サーバーになんとなくインストールすることが多く、そのセットアップに時間を割きたくない…
なので、まとめて置いておく。

vnc-server インストール

yum install vnc-server

VNCの基本コマンド(起動と停止)

#vncサーバー起動(引数は、ポート番号)
vncserver :1
#vncサーバー停止
vncserver -kill :1

パスワードの設定

$ vncserver :2

You will require a password to access your desktops.

Password: (パスワード入力
Verify: (パスワード入力)
xauth:  creating new authority file /home/test1/.Xauthority

New 'localhost:2 (test1)' desktop is loclahost:2

Creating default startup script /home/test1/.vnc/xstartup
Starting applications specified in /home/test1/.vnc/xstartup
Log file is /home/test1/.vnc/localhost:2.log

設定ファイルの変更(x-windowをgnomeに)

vi /root/.vnc/xstartup
コメントアウト
#twm &
最終行に追加
exec gnome-session

VNC自動起動

chkconfig vnc-server on
vi /etc/sysconfig/vncservers

#設定例
VNCSERVERS="1:root 2:takuan"
VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[2]="-geometry 800x600"

電源を立ち上げると、自動でvncが立ち上がり、ポート1番でroot、ポート2番でtakuanの接続を待つ。

日本語入力について

参考サイト

Fedora7 VNC4.1で日本語入力 - まったらいふ
http://kopanda.selfip.com/blog/crosss/2007/12/fedora7vnc41.html