使opensuse12.1實現一拖二(拖機)的雙人使用系統(下)

繼續上篇的介紹。本章貼配置代碼。session

對於KDE環境來講主要配置如下兩個文件:app

/etc/x11/xorg.conf
/usr/share/kde4/config/kdm/kdmrcless

先說xorg.conf,這個文件在新安裝好系統後並不存在,我是在安裝好nvidia驅動後,配置好顯卡後保存的這個文件。這是一個最開始配置好的文件內容:
這個是已經配置好雙頭顯示的文件。tcp

 

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 295.49  (buildmeister@swio-display-x86-rhel47-03.nvidia.com)  Tue May  1 00:35:28 PDT 2012

#這是一個由nvidia X window settings配置好的xorg.conf文件

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"

     # HorizSync source: builtin, VertRefresh source: builtin
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "CRT-0"
    HorizSync       30.0 - 75.0
    VertRefresh     45.0 - 100.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "AOC 2217"
    HorizSync       31.0 - 80.0
    VertRefresh     56.0 - 75.0
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8200"
    BusID          "PCI:2:0:0"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 9500 GT"
    BusID          "PCI:3:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "CRT: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

繼續----→:flex

下面是一個完整的配置好的拖機的配置:
注意代碼中有我添加的說明註釋!ui

 

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 295.49  (buildmeister@swio-display-x86-rhel47-03.nvidia.com)  Tue May  1 00:35:28 PDT 2012

#/etc/X11/xorg.conf file
# PLEASE DO NOT EDIT THIS FILE!

Section "Files"
FontPath "/usr/share/fonts/misc:unscaled"
FontPath "/usr/share/fonts/local"
FontPath "/usr/share/fonts/75dpi:unscaled"
FontPath "/usr/share/fonts/100dpi:unscaled"
FontPath "/usr/share/fonts/Type1"
FontPath "/usr/share/fonts/URW"
FontPath "/usr/share/fonts/Speedo"
FontPath "/usr/share/fonts/PEX"
FontPath "/usr/share/fonts/cyrillic"
FontPath "/usr/share/fonts/latin2/misc:unscaled"
FontPath "/usr/share/fonts/latin2/75dpi:unscaled"
FontPath "/usr/share/fonts/latin2/100dpi:unscaled"
FontPath "/usr/share/fonts/latin2/Type1"
FontPath "/usr/share/fonts/latin7/75dpi:unscaled"
FontPath "/usr/share/fonts/baekmuk:unscaled"
FontPath "/usr/share/fonts/japanese:unscaled"
FontPath "/usr/share/fonts/kwintv"
FontPath "/usr/share/fonts/truetype"
FontPath "/usr/share/fonts/uni:unscaled"
FontPath "/usr/share/fonts/CID"
FontPath "/usr/share/fonts/ucs/misc:unscaled"
FontPath "/usr/share/fonts/ucs/75dpi:unscaled"
FontPath "/usr/share/fonts/ucs/100dpi:unscaled"
FontPath "/usr/share/fonts/hellas/misc:unscaled"
FontPath "/usr/share/fonts/hellas/75dpi:unscaled"
FontPath "/usr/share/fonts/hellas/100dpi:unscaled"
FontPath "/usr/share/fonts/hellas/Type1"
FontPath "/usr/share/fonts/misc/sgi:unscaled"
FontPath "/usr/share/fonts/xtest"
FontPath "/opt/kde3/share/fonts"
InputDevices "/dev/gpmdata"
InputDevices "/dev/input/mice"
EndSection

Section "ServerFlags"
Option "AllowMouseOpenFail" "on"
Option "AutoAddDevices" "off"
Option "ZapWarning" "on"
Option "Xinerama" "0"
EndSection

Section "Module"
Load "dbe"

SubSection "extmod"
Option "omit xfree86-dga"
EndSubSection

Load "type1"
Load "speedo"
Load "freetype"
Load "glx"
EndSection

Section "Extensions"
Option "Composite" "off"
EndSection

#以上部分代碼並不存在於默認的xorg.conf文件中,原封不動添加便可

Section "InputDevice"
# Driver "evdev" will be disabled unless 'Option "AutoAddDevices" "off"'
# is set in "ServerFlags" section.
Driver "evdev"
Identifier "Keyboard0"
Option "Device" "/dev/input/event0"
Option "Protocol" "Standard"
Option "XkbLayout" "us"
Option "XkbModel" "microsoftpro"
Option "XkbRules" "xfree86"
EndSection
Section "InputDevice"
# Driver "evdev" will be disabled unless 'Option "AutoAddDevices" "off"'
# is set in "ServerFlags" section.
Driver "mouse"
Identifier "Mouse0"
Option "Buttons" "5"
Option "Protocol" "auto"
Option "Device" "/dev/input/mouse0"
Option "Name" "USB Optical Mouse"
Option "Vendor" "Sysp"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# Driver "evdev" will be disabled unless 'Option "AutoAddDevices" "off"'
# is set in "ServerFlags" section.
Driver "evdev"
Identifier "Keyboard1"
Option "Device" "/dev/input/event3"
Option "Protocol" "Standard"
Option "XkbLayout" "us"
Option "XkbModel" "microsoftpro"
Option "XkbRules" "xfree86"
EndSection

Section "InputDevice"
# Driver "evdev" will be disabled unless 'Option "AutoAddDevices" "off"'
# is set in "ServerFlags" section.
Driver "mouse"
Identifier "Mouse1"
#Option "Buttons" "5"
Option "Device" "/dev/input/mouse1"
Option "Name" "ImPS/2 Generic Wheel Mouse"
Option "Protocol" "auto"
#Option "Vendor" "Sysp"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

#以上代碼配置鼠標和鍵盤
#Keyboard0和mouse0是一對配套使用的鍵盤和鼠標
#注意鼠標的driver有「mouse」和「evdev」兩種,個人用「mouse」能夠正常工做
#注意鼠標中Option "Protocol" "auto"
#的「auto」改成 "ExplorerPS/2",鼠標滾輪纔可正常工做
#能夠用命令:ls /dev/input/mouse*列出全部鼠標 #命令:more /proc/bus/input/devices 列出全部鍵盤鼠標及 鍵盤的event 的ID號。 #****************************顯示器*******************Section "Monitor"
    # HorizSync source: xconfig, VertRefresh source: xconfig
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "CRT-0"
    HorizSync       30.0 - 75.0
    VertRefresh     45.0 - 100.0
    Option         "DPMS"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "AOC 2217"
    HorizSync       31.0 - 80.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

#************
#上面是顯示器的配置,對於crt顯示器來講能夠在上面的配置中更改刷新率。

#**下面是顯卡的配置,默認便可

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8200"
    BusID          "PCI:2:0:0"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 9500 GT"
    BusID          "PCI:3:0:0"
EndSection

#下面是屏幕的設置,有兩個顯示

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "CRT: 1024x768_85 +0+0; CRT: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "1680x1050_60 +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

#下面的配置是最終的終端與屏幕,鍵盤鼠標的搭配

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
    Option "Clone" "off"
    Option "AutoAddDevices" "off"
EndSection

Section "ServerLayout"
    Identifier     "Layout1"
    Screen      1  "Screen1" 0 0
    InputDevice    "Keyboard1" "CoreKeyboard"
    InputDevice    "Mouse1" "CorePointer"
    Option         "Xinerama" "0"
    Option "Clone" "off"
    Option "AutoAddDevices" "off"
EndSection

其次是kdmrc文件,配置以下:
spa

#/usr/share/kde4/config/kdm/kdmrc

[General]
ConfigVersion=2.4
SUSEConfigVersion=2
StaticServers=:0,:1
ReserveServers=:2,:3
ServerVTs=-7
ConsoleTTYs=tty1,tty2,tty3,tty4,tty5,tty6

[Xdmcp]

[Shutdown]


[X-*-Core]
ClientLogFile=.xsession-errors-%d

[X-*-Greeter]
LogoPixmap=/usr/share/kde4/apps/kdm/pics/kdelogo.png
MinShowUID=500
MaxShowUID=65000
ForgingSeed=1268675635
UseTheme=true

[X-:*-Core]

[X-:*-Greeter]
PreselectUser=Previous
FocusPasswd=true
LoginMode=DefaultLocal
AllowClose=false

#主要是下面兩個設置,有仔細解說了
[X-:0-Core]
TerminateServer=true
ClientLogFile=.xsession-errors
ServerArgsLocal=-nolisten tcp -layout Layout0 -sharevts -novtswitch

[X-:1-Core]
TerminateServer=true
ClientLogFile=.xsession-errors
ServerArgsLocal=-nolisten tcp -layout Layout1 -sharevts -novtswitch

[X-:93-Core]
TerminateServer=true

[X-:0-Greeter]

若是想要GNOME也能成功拖機還要修改下面這個文件:debug

 /etc/gdm/custom.conf
反正我是兩下環境下拖機都成功了。稍微注意看下就懂了。code

# GDM configuration storage
#
# Note: settings from /etc/sysconfig/displaymanager have a higher priority
#

[servers]
0=Standard0
1=Standard1
[server-Standard0]
name=Standard server
command=/usr/X11R6/bin/X -nolisten tcp -novtswitch -sharevts -layout Layout0
flexible=true
[server-Standard1]
name=Standard server
command=/usr/X11R6/bin/X -nolisten tcp -novtswitch -sharevts -layout Layout1
flexible=true

[xdmcp]

[greeter]

[chooser]

[debug]

好了,完 了,有想拖機的朋友能夠作個參考。server

相關文章
相關標籤/搜索