#author("2022-01-04T09:54:37+00:00","","")
#author("2022-01-08T04:22:14+00:00","","")
#topicpath

////////////////////////////////////////////////////////////////////////////////
* 目次 [#f6103858]
#contents();
#ls2(X/vnc/);

////////////////////////////////////////////////////////////////////////////////
* vnc [#e75b98cb]
- vnc とは、 ''V''irtual ''N''etwork ''C''omputing の略。
- 同一ホスト内/リモートホスト間でコンピュータを操作するリモートデスクトップソフトウェア。
- クロスプラットフォーム対応ソフトとして開発されている。
- 開発停止したオリジナル VNC (AT&T) に始まり、派生版が多数出ている。

////////////////////////////////////////////////////////////////////////////////
* マルチ解像度VNCサーバ設定 [#a99f4886]
- server側ではport毎に別々の画面の解像度を設定しておき、clientは使いたい解像度に合わせて接続portを選択することが出来る。
+ /etc/services
 #VNC settings
 vnc-1024x768    5950/tcp
 vnc-1272x960    5951/tcp
 vnc-1280x1024   5952/tcp
 vnc-1592x1136   5953/tcp
 vnc-1600x1200   5954/tcp
 vnc-1800x1100   5955/tcp
 vnc-1912x1136   5956/tcp
 vnc-1920x1200   5957/tcp
+ /etc/xinetd.d/vnc-1024x768
 # default: off
 # description: VNC server
 # securlevel: 30
 service vnc-1024x768
 {
         disable = no
         socket_type     = stream
 #        protocol        = tcp
         wait            = no
         user            = nobody         server          = /usr/bin/Xvnc
         server_args     = -inetd -query localhost -once -geometry 1024x768 -secu ritytypes none -fp tcp/localhost:7100
 }

////////////////////////////////////////////////////////////////////////////////
* server の設定・起動・停止 [#o59be736]
//==============================================================================
** 設定 [#x40e93d2]
- vnc で使いたい window manager などは、server 側で設定する。
- server の設定は、 server (client ではない!)を起動するユーザの
 ${HOME}/.vnc/xstartup
を編集する:
 #!/bin/sh
 
 xrdb $HOME/.Xresources
 xsetroot -solid grey
 #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 #x-window-manager &
 # Fix to make GNOME work
 export XKL_XMODMAP_DISABLE=1
 # /etc/X11/Xsession
 exec /usr/bin/jwm     # 接続時に起動したいプログラムを指定する。ここでは jwm を指定している

- ${HOME}/.vnc/xstartup には実行権限が必要。ないまま実行すると、window manager が起動しないなどの問題が起こる。
 $ chmod 751 ${HOME}/.vnc/xstartup

//==============================================================================
** 起動 [#x2f403f1]
- 一般ユーザーで起動する。
 $ vncserver
 
 Warning: martinu:1 is taken because of /tmp/.X1-lock
 Remove this file if there is no X server <ホスト名>:1
 
 New 'X' desktop is martinu:2
 
 Starting applications specified in /home/kazu/.vnc/xstartup
 Log file is /home/kazu/.vnc/martinu:2.log
-- この例では、DISPLAY番号が :1 となっている
~
- 画面サイズをデフォルトから変更する場合は、server の起動引数で指定する
 $ vncserver -geometry <width>x<height>
-- 例:
 $ vncserver -geometry 1272x960

//==============================================================================
** 停止 [#wcc02395]
- 停止する際は、起動した時に表示された DISPLAY 番号を指定する
 $ vncserver -kill :<DISPLAY番号>
-- 上記を使わず kill コマンドで終了させた場合、DISPLAY が開放されず使用中のままと認識されてしまうので注意。


////////////////////////////////////////////////////////////////////////////////
* client からの接続 [#t90cd157]
- クライアントには、 vncviewer を使う。
- 接続先は、 <接続先ホスト>:<port> で指定する。
-- port は、以下で決まる:
 5900 + <vncserver を起動した時に決まる DISPLAY番号>
よって、DISPLAY番号が 1 の場合 port は
 5900 + 1 = 5901
となる。

////////////////////////////////////////////////////////////////////////////////
* トラブルシューティング [#c48f594d]
- 問題が起きて、状況や原因がよく分からない時は、下記のログを確認する:
 ${HOME}/.vnc/${HOSTNAME}${DISPLAY}.log

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS