VNCでX-Windowを開く方法
Created: 9 July 2007
なぜ、X端末でないVNCでX端末のように使えるのか?
以下に詳しい説明があります。
要は、サーバー側でX端末のウインドウイメージをVNCで送ってきているそうです。
http://www.atmarkit.co.jp/flinux/special/vnc01/vnc01a.html
VNCサーバーを起動する - CentOS5 (9 July 2007)
VNCビューワで接続する - Windows (9 July 2007)
インストールする
yumでインストールできます。
# yum install vnc
設定する
"/etc/sysconfig/vncservers"の設定
ユーザを指定します。
# The VNCSERVERS variable is a list of display:user pairs. # # Uncomment the lines below to start a VNC server on display :2 # as my 'myusername' (adjust this to your own). You will also # need to set a VNC password; run 'man vncpasswd' to see how # to do that. # # DO NOT RUN THIS SERVICE if your local area network is # untrusted! For a secure way of using VNC, see # <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>. # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP. # Use "-nohttpd" to prevent web-based VNC clients connecting. # Use "-localhost" to prevent remote VNC clients connecting except when # doing so through a secure tunnel. See the "-via" option in the # `man vncviewer' manual page. # VNCSERVERS="2:myusername" # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost" VNCSERVERS="2:root"
パスワードの設定
# vncpasswd Password: ******** Verify: ********
"/root/.vnc/xstartup"の設定
指定したユーザのホームディレクトリの".vnc/xstartup"を編集します。
#!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc
起動します
# service vncserver start VNC サーバー を起動中: 2:root New 'bv1.tomo.ac:2 (root)' desktop is bv1.tomo.ac:2 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/bv1.tomo.ac:2.log [ OK ] #
ダウンロード
以下からダウンロードできます。
http://www.realvnc.com/download.html
"VNC Free Edition Viewer for Windows"が、Windowsのクライアントです。
起動します
ダウンロードしたファイルを起動します。
IPアドレスと、サーバーに指定した端末番号(:2)を指定します。
![]()
サーバーに設定したパスワードを入力します。
![]()
うまくいくと以下のように表示されます。
![]()