■ Linuxを知りたいなら↓のページをご覧ください!

Linuxの基礎はこちらで理解できます
↑無料登録すると400語以上のIT用語解説が読み放題です!
いますぐ登録しましょう!(pakira)







  『VNCサーバー構築をつくろう!3』

■VNCサーバー設定

$ su -   ←「su -」コマンドでroot権限になります。
Password:  ←rootパスワードを入力します。

# vi /etc/sysconfig/vncservers  ←「viエディッタ」で「vncservers」ファイル
                   を編集します


viエディットモードになったら

「 /VNCSERVERS 」

と入力して、VNCSERVERSを検索します。


〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜
※viエディッタの使い方については、30日無料メールセミナーで
 詳しく説明していますので、そちらで練習してください。

 http://linux-topics.com/mail/index.html
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜


▼変更前
------------------------------------------------------------

# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# 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
# .

VNCSERVERS="1:myusername"

------------------------------------------------------------

            ↓↓↓
▼変更後
------------------------------------------------------------

# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# 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
# .

# VNCSERVERS="1:myusername"
VNCSERVERS="1:root 2:pakira"  ←「 VNCSERVERS="1:root 2:pakira" 」
を入力します


------------------------------------------------------------


「VNCSERVERS="1:root 2:pakira"」の「 2:pakira 」の箇所は
あなたが使用している一般ユーザを指定してください。


vncserversの設定が終わったら、一般ユーザに戻ります。


# exit ←「exit」で一般ユーザに戻れます。


------------------------------------------------------------

$ vncserver ←「vncserver」と入力して、実行してください。
Password:  ←パスワードを求められますので、そのユーザのパスワードを
        入力します。
Verify:   ←もう一度、同じパスワードを入力します。

xauth: creating new authority file /home/pakira/.Xauthority

New 'kitty:1 (pakira)' desktop is kitty:1

Creating default startup script /home/pakira/.vnc/xstartup
Starting applications specified in /home/pakira/.vnc/xstartup
Log file is /home/pakira/.vnc/kitty:1.log

$ vncserver -kill :1  ←「vncserver -kill :1」で一旦プロセスを停止します。
Killing Xvnc process ID 30128

$ ls -la  ←「ls -la」で隠しファイルを表示させます。
        ※lsコマンドのオプション「-a」で「.ドット」から始まる隠し
         ファイルを表示できます。

合計 48
drwx------ 4 pakira pakira 4096 6月 12 13:55 .
drwxr-xr-x 3 root root 4096 6月 5 17:59 ..
-rw------- 1 pakira pakira 99 6月 12 13:55 .Xauthority
-rw------- 1 pakira pakira 219 6月 11 01:10 .bash_history
-rw-r--r-- 1 pakira pakira 24 10月 28 2003 .bash_logout
-rw-r--r-- 1 pakira pakira 191 10月 28 2003 .bash_profile
-rw-r--r-- 1 pakira pakira 124 10月 28 2003 .bashrc
-rw-r--r-- 1 pakira pakira 5543 10月 10 2003 .canna
-rw-r--r-- 1 pakira pakira 120 10月 31 2003 .gtkrc
drwxr-xr-x 3 pakira pakira 4096 6月 5 17:21 .kde
drwxr-xr-x 2 pakira pakira 4096 6月 12 13:56 .vnc

$ cd .vnc  ←「 cd 」コマンドでディレクトリを「.vnc」へ移動します。
$ ls     ←「ls」コマンドでファイルを表示します。
kitty:1.log passwd xstartup

$ vi xstartup ←viコマンドで「 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 &

------------------------------------------------------------

            ↓↓↓
▼変更後
------------------------------------------------------------

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
exec /etc/X11/xinit/xinitrc  ←「 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 /etc/X11/xinit/xinitrc 」を追加して、[ -x /etc/vnc/xstartup ]

から下の行の先頭に「#」をつけてコメントアウト(無効化)して、保存します。



# service vncserver start  ←「vncserver」を起動します。
VNCサーバを起動中: 1:root 2:pakira [ OK ]

 ↑[ OK ]と表示されれば、正常に起動しました。



━━━━━━━━━━━━━━━━━━━



今回はココまでです。

どうですか? うまくいきましたか?

もし、うまく行かなかったら、どこかに設定ミスがあります。
その場合には、もう一度設定を見直してみてください。



次回は実際に、Windowsから接続して、動作の確認をしてみます。
↓のサイトからソフトをダウンロードしておいてくださいね。


▼Windows 9x/2000/NT (Intel Win32)
ダウンロード



前へ ・  次へ
ホームへ戻る  - サーバー設定ガイド一覧へ戻る