X11:无效的 MIT-MAGIC-COOKIE-1 密钥

X11:无效的 MIT-MAGIC-COOKIE-1 密钥

我有一个无头(根本没有显示器)的加密挖掘测试台,上面有两张显卡(GTX1060)。在更新到版本 17.10 之前,它运行良好。

ghopper@miner:~$ uname -a
Linux miner 4.13.0-19-generic #22-Ubuntu SMP Mon Dec 4 11:58:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

ghopper@miner:~$ ps -ef|grep X
root      1082  1080  0 13:25 tty1     00:00:00 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/127/gdm/Xauthority -background none -noreset -keeptty -verbose 3
ghopper   1571  1557  0 14:25 pts/0    00:00:00 grep --color=auto X


ghopper@miner:~$ xauth list
miner/unix:0  MIT-MAGIC-COOKIE-1  2386b22487fb3507bdb0a62d36c2da20


ghopper@miner:~$ echo $DISPLAY
:0


ghopper@miner:~$ cat /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 384.90  (buildmeister@swio-display-x86-rhel47-05)  Tue Sep 19 18:13:03 PDT 2017

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
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"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
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     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 3GB"
    BusID          "PCI:2:0:0"
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060 3GB"
    BusID          "PCI:3:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "UseDisplayDevice" "DFP-0"
    Option         "Coolbits" "31"
    Option         "ConnectedMonitor" "DFP-0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "UseDisplayDevice" "DFP-0"
    Option         "Coolbits" "31"
    Option         "ConnectedMonitor" "DFP-0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

该卡工作正常:

ghopper@miner:~$ nvidia-smi
Fri Dec  8 13:50:11 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.90                 Driver Version: 384.90                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 106...  Off  | 00000000:02:00.0  On |                  N/A |
| 46%   75C    P2   102W / 120W |   2454MiB /  3011MiB |     99%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 106...  Off  | 00000000:03:00.0  On |                  N/A |
| 44%   72C    P2    97W / 120W |   2403MiB /  3013MiB |     99%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0       888      C   /home/ghopper/claymore/ethdcrminer64        2385MiB |
|    0      1082      G   /usr/lib/xorg/Xorg                            13MiB |
|    0      1118      G   /usr/bin/gnome-shell                          51MiB |
|    1       888      C   /home/ghopper/claymore/ethdcrminer64        2385MiB |
|    1      1082      G   /usr/lib/xorg/Xorg                             6MiB |
+-----------------------------------------------------------------------------+

这是我的问题:我无法使用 nvidia-settings 工具。

ghopper@miner:~$ nvidia-settings 
Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run `nvidia-settings --help` for usage information.

ghopper@miner:~$ xhost 
Invalid MIT-MAGIC-COOKIE-1 keyxhost:  unable to open display ":0"
ghopper@miner:~$ DISPLAY=:0 nvidia-settings 
Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run `nvidia-settings --help` for usage information.

ghopper@miner:~$ DISPLAY=:1 nvidia-settings 
Unable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run `nvidia-settings --help` for usage information.

我该如何修复它?

答案1

运行之前请先尝试一下

xhost +local:

xhost 程序用于向允许连接到 X 服务器的列表添加或删除主机名或用户名。本地系列指定所有本地连接。

答案2

如果您尝试在 display:0 上运行 x0vncserver,则必须先实际登录,然后才能运行任何命令。如果这是无头服务器上的不可见控制台 - 我发现的一个解决方案是在启动时自动登录。检查此链接:https://techpiezo.com/linux/enable-or-disable-automatic-login-in-ubuntu-20-04/

相关内容