Ubuntu 10.04 に xinetd + vncserverを入れる
修正 7/25
- 以下の誤りを修正しました。
修正 5/26
- 以下のファイル内容の間違いを修正しました
- /etc/xinetd.d/vnc
- /etc/gdm/custom.conf
Ubuntu10.04にvncserverを導入した。
環境
サーバ:Ubuntu10.04-x86 vnc4server
クライアント:Windows7 UltraVNC
サーバ側導入手順
必要なパッケージをインストールする。
fix:2010/07/25 : java-vnc -> vnc-java
# apt-get install vnc4server vnc-java xinetd
※ vnc-javaは、Webブラウザからvncにアクセスする場合のみ必要。
vnc用のxinetd環境ファイルの作成
# vi /etc/xinetd.d/vnc service vnc { type = UNLISTED disable = no socket_type = stream protocol = tcp wait = no user = nobody server = /usr/bin/Xvnc server_args = -inetd -query localhost -geometry 1680x1050 -depth 24 -once -DisconnectClients=0 -NeverShared -passwordFile=/etc/vncpasswd -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType port = 5902 # portの行は適宜変更する } ※ server_args行に ディスプレイ番号は指定できない。 ※ server_args行に、-extension XFIXES の記述をしてはいけない。 ※ server_args行の-geometry、-depth、port 行は適宜変更する
# vi /etc/services # 以下を追加 portの値 は /etc/xinetd.d/vnc の記述と合わせる vnc 5902/tcp
gdm の設定を変更する
# vi /etc/gdm/gdm.schema .... <schema> <key>security/DisallowTCP</key> <signature>b</signature> - <default>true</default> + <default>false</default> </schema> .... <schema> <key>xdmcp/Enable</key> <signature>b</signature> - <default>false</default> + <default>true</default> </schema> ....
# vi /etc/gdm/custom.conf ; 各セクションに以下を追加 [daemon] RemoteGreeter=/usr/lib/gdm/gdm-simple-greeter DefaultSession=gnome [xdmcp] Enable=true DisplaysPerHost=2 [security] DisallowTCP=false
※[xdmcp] - DisplaysPerHost=2 の設定を行わないと、vnc接続を一度切ると再接続できない。
vnc接続時に指定する vncpasswordの設定を行う
fix:2010/07/25 : # vncpasswd -> # vncpasswd /etc/vncpasswd / 所有者・アクセス権の設定を追加
# vncpasswd /etc/vncpasswd Password: < password入力> Verify: <もう一度入力> # chown nobody:root /etc/vncpasswd # chmod 0600 /etc/vncpasswd # ls -l /etc/vncpasswd -rw------- 1 nobody root ..... /etc/vncpasswd
xinetd, gdmの再起動
# /etc/init.d/xinetd restart # /etc/init.d/gdm restart
※ gdmはPCごと再起動しないとうまく再起動できないかもしれない。
ここまでの操作を行うことで、vncクライアントからUbuntuに接続できるようになる。
vncから接続すると、日本語入力切り替えが <半角/全角>キーでできなくなっている。
vncで接続後、タスクバーの通知領域からIBUSの設定画面を開き、
キーボードショートカット:切り替えに、Hankaku, Zenkaku の2つのキーを追加してやる。