猫型エンジニアのブログ

プログラム/ネットワーク系の技術関連をまとめたページです 

CentOS6.3にVNCサーバをインストール

VNCサーバのインストール

# yum install -y vnc-server

VNCサーバの起動

接続時のパスワードが要求されるので設定します。

# vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /root/.Xauthority
xauth: (stdin):1:  bad display name "R320-1:1" in "add" command

起動時のエラー

以下のようなエラー画面がでました。

WARNING: The first attempt to start Xvnc failed, possibly because the font
catalog is not properly configured.  Attempting to determine an appropriate
font path for this system and restart Xvnc using that font path ...
Could not start Xvnc.

/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
[dix] Could not init font path element catalogue:/etc/X11/fontpath.d, removing from list!
[dix] Could not init font path element built-ins, removing from list!

Fatal server error:
could not open default font 'fixed'

追加でインストールするパッケージ

以下の2つのパッケージをインストールすれば無事に起動できました。

yum install -y pixman libXfont

後はiptablesを適切に設定すれば、VNCクライアントから接続ができます。

おまけ

 ローカルから、VNCで接続しているリモートのマシン上の仮想マシンを制御する際に、キーボード配列が変わってしまう場合があります。このとき、あらかじめ仮想マシンのキーボード配列をUS配列にしておくと、ローカルのキーボード配列のまま入力できることがあります。