xdmx/xephyr
xdmx / xephyr の試行
x11色々用に書いたら、長くなったので、別記事で。
xdmx/xephyr
xdmxはX Distributed Multihead X serverの略で、複数のXサーバを一つの大きなX画面に表示する。
xephyrはいわゆるxproxy、Xserverの表示を別のx serverのウインドウとして表示する。
今回はxdmx試行に当たり、個別にPC上のXサーバでの確認前にxephyrでxdmxを試し、使い方に慣れた後に、個別pcのxサーバに切り替えるステップを踏む。
xephyr経由でxdmxをステップバイステップ試行
全体の流れ
- 単一サーバ上でxdmx/xephyr試行
- 2サーバ上でxephyr/xdmx
- 片側を素のXに置き換え。
- 両側を素のXに置き換え。
firewallとxfs/x font serviveに注意する。xdmxでは全子サーバのフォントが一致する必要がある。また、キーボードやvtにも注意。
構成
- s1 : 親。本サーバ接続のキーボード、マウスを利用する。
- s2 : 子。セカンドモニタ。
- d1, d2 : それぞれs1,s2上のX。s1:0, s2:0とも表記される。
- e1,e2 : xephyr。
- m1 : dmx multihead x server
Step 1. 単一サーバで試行
親サーバ上で実行する。
export DISPLAY=d1 # :0 xephyr e1 -screen 600x400 # :1 xephyr e2 - screen 600x400 # :2 xdmx m1 -display e1 -display e2 -input e1 +xinerama & export DISPLAY=m1 xterm & twm &
Step 2. 2サーバのxephyr
xephyrを異なるサーバに表示し、xephyrをマルチヘッドする。
一つのxephyrの表示画面が異なるだけで、その他は同じ。
違いはe2起動ラインのみ。
export DISPLAY=d1 # :0 xephyr e1 -screen 600x400 # :1 DISPLAY=d2 xephyr e2 -screen 600x400 # ここを変更 xdmx m1 -display e1 -display e2 -input e1 +xinerama & DISPLAY=m1 xterm & 起動したxterm上でtwm &等。
e1のキーボードを使うため、-inputも変更不要。
Step 3. 親を素のサーバに
親のxephyr e1を起動せず、親画面d1をxdmxに指定する。
export DISPLAY=d1 # :0 # xephyr e1 -screen 600x400 # :1 コメントアウト。 DISPLAY=d2 xephyr e2 -screen 600x400 # ここを変更 xdmx m1 -display d1 -display e2 -input d1 +xinerama & # ディスプレイとインプットを親d1に変更。 DISPLAY=m1 xterm & 起動したxterm上でtwm &等。
親Xの機能によっては動作しない場合がある。その場合は、xephyr経由の場合とログを比較しつつ、確認する。
解決が難しい場合は、xephyrのままでの運用も検討する。
Step 4. 親子共に素のX
export DISPLAY=d1 # :0 # xephyr削除 xdmx m1 -display d1 -display d2 -input d1 +xinerama & # ディスプレイを子d2に変更。 DISPLAY=m1 xterm & 起動したxterm上でtwm &等。
注意事項
子を利用する場合、下記のxfs/font serviceのポートを開く。xdmcpを使用する際は、xdmcp portも開く。
ポート177 udp xdmcp ポート7100 tcp xfs
課題
xephyrで試行した限り、-input を指定しない側のウインドウで入力ができない。
複数の-inputを指定すると、キー入力に対してランダムに思える文字が表示される。表示は複数モニタにスパンするが、入力がこれでは難しい。
Window Managerのxinerama対応が関係している?
twmを使ったのが悪い?
セカンド側の入力を何とかする方法があれば、誰か教えて欲しい。
もしかして、個別のノード単位のキー入力を期待している?
起動オプション
#!/bin/bash HOST=banana # wait for 2nd screen LOOP="-1" while [ $LOOP -ne 0 ] do sleep 5 </dev/tcp/$HOST/6000 echo "Waiting for $HOST: $?" LOOP="$?" done sudo chown -R pi:pi /home/pi xauth -b quit #xhost + startx -- /usr/bin/Xdmx :1 -display :0 -display $HOST:0 -norender -noglxproxy -ignorebadfontpaths +xinerama -param XkbModel pc105 -param XkbLayout de
rasphberrypi
https://www.raspberrypi.org/forums/viewtopic.php?t=228426
その他
ショートカットキー
Ctrl-Alt-q will terminate the Xdmxserver in all modes. Ctrl-Alt-g will toggle a server grab in console mode (a special cursor, currently a spider, is used to indicate an active server grab). Ctrl-Alt-f will toggle fine-grain motion in console mode (a special cursor, currently a cross hair, is used to indicate this mode). If this mode is combined with a server grab, then the cursor will have 4 lines instead of only 2. Ctrl-Alt-F1 through Ctrl-Alt-F12will switch to another VC in local (raw) mode.