• 怀疑是显示器出现异常所导致

登入命令行窗口

Ctrl+Alt+F1~F6分别对应tty1~tty6,但要注意其中有一个不是tty而是此时的图形化界面,建议每一个都试一下。

登入图形化界面

  • 关于为什么会紫屏而不显示登录界面,怀疑是此时显示器被当做“副屏”拓展,所以登录界面其实在显示器显示区域的左侧,没有显示出来,所以修改自动登录配置文件是没有效果的,本来就没登录进去。

可以尝试关闭xorg进程。

pkill xorg

这会让xorg重启
这样执行有可能有效有可能无效,也许查看进程列表已经没有xorg进程,但是还是不显示登录界面。
这个时候执行xorg相关命令让xorg出错退出也是可以的。
比如

xhost +
#这条命令原本的含义是关闭X服务器的访问控制,容许任何主机访问本地的X服务器

之后应该可以显示登录界面,选择Ubuntu on Wayland进行登录是可以进入Ubuntu桌面的,不过不能使用远控。

开启远控(恢复Xorg登录)

  1. 删掉home/下的.xprofile文件,每次使用gdm、lightdm等图形登录管理器时会读取这个文件并执行其中的脚本,故障的时候文件的内容是
xrandr --output DP-1-3 --primary --mode 1920x1080
#这个脚本的含义是将DP-1-3设置为主要的输出,并设置分辨率为1920x1080
  1. 如果仍然登陆循环,证明/etc/X11/xorg.conf有问题,执行命令
sudo nvidia-xconfig

这时候有可能报错

WARNING: Unable to locate/open X configuration file.
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
New X configuration file written to '/etc/X11/xorg.conf'

这时候需要安装该包

 sudo apt-get install xorg-server-source

然后再次执行

sudo nvidia-xconfig

对生成的xorg.conf进行修改

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 470.161.03
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "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"
    Option         "DPMS"
EndSection
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
#显卡型号
    BoardName      "Tesla T4"
EndSection
#添加intel集显信息
Section "Device"
   Identifier      "intel"
   Driver          "modesetting"
#总线ID
   BusID           "PCI:0:2:0"
EndSection
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

另附查询总线ID命令

lspci -k | grep -EA3 'VGA|3D|Display'
  • 第1步和第2步的顺序是不必要的
  1. 查看向日葵访问识别码和验证码(非必要),重启工控机
  2. 重启后可通过Xorg正常登录,远控可正常连接。但是显示器会显示空桌面,这是因为显示器被当做了副屏,设置成了“拓展”,可以在向日葵或通过终端将副屏设置为“镜像”即可

参考了一系列网络上的资料,在此表达感谢

Ubuntu紫屏/循环登录/远控异常的问题解决
分类: 计算机

Reason

在漫漫梦路上踽踽独行的人……

0 条评论

发表回复

Avatar placeholder