- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2020-08-08T02:56:59+00:00","","")
#topicpath
////////////////////////////////////////////////////////////////////////////////
* マルチ解像度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 を指定している
//==============================================================================
** 起動 [#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
となる。