ConcurrentReal-Time-Logo

リアルタイムテクニカルドキュメント X Server編 最終更新 2024.02.15

外部リンクを除く、以下のドキュメントの著作権は、特に記載の無い限りConcurrent Real-Time社に帰属します。
下記ドキュメントの弊社を除く営利目的の利用は禁じますが、ウィキペディアからの参照や社内教育、
大学等の非営利の目的であれば、ご自身の責任において自由に利用して頂いてかまいません。
ドキュメントの内容は予告無く変更する事がありますが、出来る限りリンクが消滅しないように保存しています。
ここに、記載した商品名は、一般に各社の商標または登録商標です。
外部リンク先の著作権は、各サイトの著作権表示をご覧ください。弊社著作権についてのポリシーは、 [hand.right] こちらをご覧ください。



[hand.right] RedHawk8のNvidia Head Less設定について。
[hand.right] RedHawk7,8のトラックボールのホイール・エミュレーション設定について。
[hand.right] RedHawk7,8のXorgの差異について。 [hand.right] RedHawk7,8のXorg及びgnome3の制限について。

RedHawk7,8のXorg及びgnome3では、以下の制限があります。

[hand.right] RedHawk7,8のデュアルヘッド構成例

(1) 2枚のNvdiaグラフィックカードを使って専用キーボード、マウスを構成し、2つのXサーバを独立して構成出来ます。
この構成例では、
PCI:23:0:0のカードと/dev/input/event[35]をNvidia#1専用に、
PCI:6:0:0 のカードと/dev/input/enevt[68]をNvidia#2専用にXorg.confに記述しています。
この構成の重要な点は、下記コマンドでNvidia#2用にXorgを起動する時に、-sharevtsで、vt1を共用している事です。

# /usr/bin/startx -- :1 vt1 -sharevts -config /etc/X11/xorg.conf.2nd &

注: 2つ目のXサーバで、gnome-shellを動作させるとsmart card managerが起動して煩わしいので、以下の作業を行います。
# mv /usr/bin/esc /usr/bin/esc.SAVE

# /usr/bin/xinit /usr/bin/startkde -- :1 -sharevts vt1 -config /etc/X11/xorg.conf.2nd &

# /usr/bin/xinit /usr/bin/mwm -- :1 -sharevts vt1 -config /etc/X11/xorg.conf.2nd &

# /usr/bin/xinit /usr/bin/metacity --composite -- :1 vt1 -sharevts -config xorg.conf.2nd &

mwmやmetacityの場合、gnome-terminalを起動し、ibus-daemonを起動すると、セカンドXorg側でもかな漢字変換が利用できます。

# export DISPLAY=:1
# dbus-launch /usr/bin/gnome-terminal
# /usr/bin/ibus-daemon -r -d --xim

入力モードの切り替えは、[Windows] + [Space] を使います。
[DualHead.2png]

# ls -l /dev/input/by-path/*usb*-event-kbd* /dev/input/by-path/*usb*-event-mouse*
lrwxrwxrwx 1 root root 9  8月 27 13:20 /dev/input/by-path/pci-0000:00:14.0-usb-0:14:1.0-event-mouse -> ../event5
lrwxrwxrwx 1 root root 9  8月 27 13:20 /dev/input/by-path/pci-0000:00:14.0-usb-0:4:1.0-event-kbd -> ../event3
lrwxrwxrwx 1 root root 9  8月 27 13:27 /dev/input/by-path/pci-0000:00:14.0-usb-0:8.1:1.0-event-mouse -> ../event8
lrwxrwxrwx 1 root root 9  8月 27 13:21 /dev/input/by-path/pci-0000:00:14.0-usb-0:8.2:1.0-event-kbd -> ../event6
#
# Xorg#1 側 /etc/X11/xorg.conf
#
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option "IsolateDevice"  "PCI:23:0:0"
    Option "Sharevts"  "True"
EndSection

Section "Files"
    FontPath        "/usr/share/fonts/default/Type1"
EndSection

#
# Xorg#1 側で使用しないデバイスをIgnoreする
# この時、/dev/input/by-path/や/dev/input/by-id/指定は動作しない(注1)

Section "InputClass"
	Identifier	"IgnoreDevice68"
	MatchDevicePath	"/dev/input/event[68]"
	Option	"Ignore"	"True"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "evdev"
    Option         "GrabDevice"     "True"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "evdev"
    Option         "GrabDevice"     "True"
EndSection


Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID       "PCI:23:0:0"
    Option "UseDisplayDevice" "DP-3"
    Option "ProbeAllGpus" "false"
    Option "MultiGPU" "no"
EndSection


Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "SERVERFLAGS"
        Option "MaxClients"     "512"
        Option "BlankTime"      "0"
        Option "StandbyTime"    "0"
        Option "SuspendTime"    "0"
        Option "OffTime"        "0"
        Option "AutoAddGPU" "false"
EndSection


#
# Xorg#2 側 /etc/X11/xorg.conf.2nd
#
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      1  "Screen1"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
Option "IsolateDevice"  "PCI:6:0:0"
EndSection

Section "Files"
    FontPath        "/usr/share/fonts/default/Type1"
EndSection

#
# Xorg#2 側で使用しないデバイスをIgnoreする
# この時、/dev/input/by-path/や/dev/input/by-id/指定は動作しない(注1)
Section "InputClass"
        Identifier      "IgnoreDevice35"
        MatchDevicePath "/dev/input/event[35]"
        Option  "Ignore"        "True"
EndSection

Section "InputDevice"
    Identifier     "Mouse1"
    Driver         "evdev"
    Option         "GrabDevice"     "True"
EndSection

Section "InputDevice"
    Identifier     "Keyboard1"
    Driver         "evdev"
    Option         "GrabDevice"     "True"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BusID          "PCI:6:0:0"
    Option         "ProbeAllGpus" "false"
    Option         "MultiGPU" "no"
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "SERVERFLAGS"
        Option "MaxClients"	"512"
	Option "DontVTSwitch"	"yes"
	Option "BlankTime"	"0"
	Option "StandbyTime"	"0"
	Option "SuspendTime"	"0"
	Option "OffTime"	"0"
	Option "AutoAddGPU" "false"
EndSection

(注1) 上記サンプル構成ファイルでは、usbのベンダーIDとデバイスIDのペアを利用し、デバイスの区別を行うことも出来ます。
この場合キーボードとマウスは個別に記述してください

# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 001 Device 003: ID 413c:2113 Dell Computer Corp.                        Xorg #1用キーボード
Bus 001 Device 022: ID 17ef:602e Lenovo                                     Xorg #1用マウス
Bus 001 Device 012: ID 413c:2107 Dell Computer Corp.                        Xorg #2用キーボード
Bus 001 Device 018: ID 413c:3012 Dell Computer Corp. Optical Wheel Mouse    Xorg #2用マウス
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Section "InputClass"
      Identifier      "IgnoreDevice3"
      #MatchDevicePath "/dev/input/event3"
      MatchUSBID "413c:2113"
      Option  "Ignore"        "True"
EndSection
Section "InputClass"
      Identifier      "IgnoreDevice5"
      #MatchDevicePath "/dev/input/event5"
     MatchUSBID "17ef:602e"
      Option  "Ignore"        "True"
EndSection

Section "InputClass"
      Identifier      "IgnoreDevice6"
      #MatchDevicePath "/dev/input/event6"
      MatchUSBID "413c:2107"   
      Option  "Ignore"        "True"
EndSection
Section "InputClass"
      Identifier      "IgnoreDevice8"
      #MatchDevicePath "/dev/input/event8"
      MatchUSBID "413c:3012"   
      Option  "Ignore"        "True"
EndSection

(2) ログイン時に自動実行するためには、以下のようなファイルを作成してください。
この例では、ログインと同時に2番目のデスクトップを起動します。
  • ~/.config/autostart/2ndgnome.desktop
  • /usr/local/bin/2ndgnome
  • (3) 上記の派生例として、NvdiaグラフィックカードとオンボードVGAなどNvidiaではないグラフィックカードを使って専用キーボード、マウスを構成し、2つのXサーバを独立して構成することも出来ます。
    ただし、すべてを再インストールする必要があります。
    基本的に、NVIDIAドライバをインストールすると、 OSの/usr/lib64/libEGL.so,/usr/lib64/libGL.soライブラリとXorgサーバの/usr/lib64/xorg/modules/extensions/libglx.soモジュール等がすべてNVIDIA専用に上書きされてしまいます。
    このため、CentOSをインストール後で、RedHawkインストール前に、/usr/lib64,/usr/lib以下をバックアップしておいてください。
    この手順を以下に示します。

    [hand.right] RedHawk7,8でマルチディスプレイ構成のBIOS表示ディスプレイをlogin時のプライマリディスプレイにする。

       
    Nvidia Quadro P2000では、以下の様に物理ポートの刻印とDP番号が異なります。
    
    +------------------------------\___
    |   (4)   (3)   (2)   (1)         |
    |  [---] [---] [---] [---]        |
    +------------------------------/~~~
        DP-5  DP-7  DP-1  DP-3
    
    
    /var/log/Xor.0.logでは、下記の様にBIOS表示ディスプレイとして、bootデバイスが表示されています。
    (注:NvidiaドライバのXorgログでは、DFPと表示されますが、xrandrではDPと表示されます。)
    
    # fgrep DFP /var/log/Xor.0.log
    [    32.350] (--) NVIDIA(0):     DFP-0
    [    32.350] (--) NVIDIA(0):     DFP-1
    [    32.350] (--) NVIDIA(0):     DFP-2
    [    32.350] (--) NVIDIA(0):     DFP-3 (boot)
    [    32.350] (--) NVIDIA(0):     DFP-4
    [    32.350] (--) NVIDIA(0):     DFP-5
    [    32.350] (--) NVIDIA(0):     DFP-6
    [    32.350] (--) NVIDIA(0):     DFP-7
    	:
    	:
    
    
    通常、2ディスプレイ構成の場合、1,2番目のディスプレイポートに接続しますが、内部的には、DP-3とDP-1に接続しているので、DP-1がプライマリディスプレイになり、BIOS表示ディスプレイと異なるディスプレイでログインする事になります。
    以下は、その状態を「xrandr」コマンドで、表示したものです。
    
    # xrandr
    Screen 0: minimum 8 x 8, current 3840 x 1100, maximum 32767 x 32767
    DP-0 disconnected (normal left inverted right x axis y axis)
    DP-1 connected 1920x1080+1920+20 (normal left inverted right x axis y axis) 477mm x 268mm
       1920x1080     60.00*+
       1280x1024     75.02    60.02  
       1152x864      75.00  
       1024x768      75.03    60.00  
       800x600       75.00    60.32  
       640x480       75.00    59.94  
    DP-2 disconnected (normal left inverted right x axis y axis)
    DP-3 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
       1920x1080     60.00*+
       1280x1024     75.02    60.02  
       1152x864      75.00  
       1024x768      75.03    60.00  
       800x600       75.00    60.32  
       640x480       75.00    59.94  
    DP-4 disconnected (normal left inverted right x axis y axis)
    DP-5 disconnected (normal left inverted right x axis y axis)
    DP-6 disconnected (normal left inverted right x axis y axis)
    DP-7 disconnected (normal left inverted right x axis y axis)
    
    
    「gnome-control-centor」を起動して、「デバイス」→ 「Displays」 を選択し、以下の様にマウスでディスプレイ1の位置を移動してから、適用してください。
    [DFP.png]
    設定は、「/root/.config/monitors.xml」に保存されますが、これは、「root」ユーザのみの設定ですので、これをシステム設定ディレクトリ 「/var/lib/gdm/.config/」にコピーすると、すべてのユーザーが同じ状態になります。
    # cp /root/.config/monitors.xml /var/lib/gdm/.config/
    元に戻すためには、「/root/.config/monitors.xml」 と 「/var/lib/gdm/.config/monitors.xml」 を消去してください。
    以下に生成された「monitors.xml」を示しますが、 <primary>yes</primary>がプライマリディスプレイを設定している部分で、 <primary>no</primary> の部分はマニュアルで追加されています。
    プライマリディスプレイは、gdmのログインが表示される部分であり、gnome-shellのメニューバーが表示される部分でもあります。
    したがって、システム側(/var/lib/gdm/.config/monitors.xml)と、ローカル設定(~/.config/monitors.xml)側の双方に設定が必要です。
    
    <monitors version="2">
      <configuration>
        <logicalmonitor>
          <x>1920</x>
          <y>20</y>
          <scale>1</scale>
          <primary>no</primary>
          <monitor>
            <monitorspec>
              <connector>DP-1</connector>
              <vendor>DEL</vendor>
              <product>DELL S2240T</product>
              <serial>Y0HPW67A0C8U</serial>
            </monitorspec>
            <mode>
              <width>1920</width>
              <height>1080</height>
              <rate>60</rate>
            </mode>
          </monitor>
        </logicalmonitor>
        <logicalmonitor>
          <x>0</x>
          <y>0</y>
          <scale>1</scale>
          <primary>yes</primary>
          <monitor>
            <monitorspec>
              <connector>DP-3</connector>
              <vendor>DEL</vendor>
              <product>DELL S2240T</product>
              <serial>Y0HPW59G064U</serial>
            </monitorspec>
            <mode>
              <width>1920</width>
              <height>1080</height>
              <rate>60</rate>
            </mode>
          </monitor>
        </logicalmonitor>
      </configuration>
    </monitors>
    
    
    再起動すると、bootデバイスからログインできるようになります。

    [back]Back