0. 前言
基本概念
简略概述
Display Manager 提供登录需求
在文字界面下可以通过 startx 来启动 Xwindows
在 runlevel 5 下, 在 tty7 处有可以使用的图形登录界面 (方便输入账号密码), 这个就是 Display Manager-> 最大的任务就是登录
在 CentOS http://www.linuxidc.com/topicnews.aspx?tid=14 上, 利用 GDM (GNOME Display Manager) 程序来提供 tty7 的图形接口登录 ->但作用不仅仅如此
gdm 配置文件 ->/etc/gdm/custom.conf
XDMCP (X Display Manager Contorl Protocol)
1. 问题描述
CentOS7 中的 GNOME 启用了本地硬件加速功能, 所以通过 XDMCP 协议远程连接 CentOS 时会有问题. 这个在 X Manager 官网博客中已提及, 并建议使用其他的 display manager(如 lightdm 等)和 desktop environment(Xfce 或 KDE 等)来规避该问题
在 CentOS7 中安装好 lightdm 和 Xfce 后, 由于系统前期已安装了 GNOME desktop, 在 Windows 下通过 xmanager 在输入用户名和密码后, 仍会报
an error:oh no! something has gone wrong, A problem has occurred and the system can't recover
之类的错误, 如图
2. 安装使用步骤(以 lightdm 和 xfce 为例)
2.1 安装 & 启动
- # 安装 epel 源
- [[email protected] ~]# yum install -y epel-release
- # 安装 lightdm 和 Xfce
- [[email protected] ~]# yum install -y lightdm && yum groupinstall -y xfce
- # 修改 lightdm.conf 文件(配置文件中有详细的参数说明)
- [[email protected] ~]# VIM /etc/lightdm/lightdm.conf
- ...
- [XDMCPServer]
- enabled=true
- port=177
- ...
- # 将 Display Manager 切换为 lightdm
- [[email protected] ~]# systemctl disable gdm && systemctl enable lightdm
- # 启动 lightdm
- [[email protected] ~]# systemctl start lightdm
- # 关闭或者取消防火墙(若已关闭则忽略)
- [[email protected] ~]# systemctl stop firewalld.service
2.3 使用 & 问题排除
Windows 下通过 xmanager 连接 CentOS 7 后, 若出现问题可参考如下进行排除
systemctl status lightdm
查看 lightdm 的启动状态, 若有状态问题, 请先重启图形界面 init3 && init5 再查看
通过'pstree'命令查看 lightdm 的详细调用情况(如下图, lightdm 后面还是调用 gnome-session 而不是 xfce),1 节中的 2 问题就是通过如下方式排除并解决的
...
├─lightdm─┬─X───32*[{X}]
│ ├─lightdm─┬─lightdm-gtk-gre───2*[{lightdm-gtk-gre}]
│ │ └─{lightdm}
│ ├─lightdm
│ ├─2*[lightdm─┬─gnome-session───SSH-agent]
│ │ └─{lightdm}]
│ └─2*[{lightdm}]
...
出现上述问题 2 是因为系统默认的将最先安装的 Environment Desktop 作为启动桌面, 而最开始安装的是 GNOME, 故 lightdm 也调用 gnome-seesion 了, 进而出现错误, 所以最根本的解决方法是告诉系统默认启动 xfce.desktop!
最简单的解决方法如下:
- # 只保留 / usr/share/xsessions / 下 xfce.desktop 文件
- [[email protected] ~]# cd /usr/share/xsessions/ && ls
- gnome-classic.desktop gnome-custom-session.desktop gnome.desktop xfce.desktop
- [[email protected] xsessions]# mkdir back && mv gnome* back && ls
- back xfce.desktop
- # 重新启动图形桌面(也可通过 systemctl 重新启动)
- [[email protected] xsessions]# init 3 && init 5
启动成功的界面如下
3. 若还出现其他问题, 可查看 Xmanager 日志进行分析, 不过最保险的办法是 -- 先更新 Xmanager, 本人的版本是
Xbrowser for Xmanager Enterprise 4 (Build 0243)
4. 出现权限类的问题, 可先关闭 SELinux
查看 selinux 状态 sestatus
临时关闭 setenforce 0
永久关闭 -> 修改配置文件 / etc/selinux/config, 将 SELINU 置为 disabled
3. 其他
CentOS6 下可直接使用 gdm 通过 XDMCP 来远程连接, 一般步骤如下
通过 yum groupinstall 安装系列软件, 如
yum groupinstall "Desktop" "X Window System"
修改 gdm 配置文件,/etc/gdm/custom.conf, 在这个文件中, 以节的形式组织各类配置参数, 节名用中括号 [] 包围起来, 如 [security],[xdmcp] 等, 要支持远程连接, 需要在配置文件中增加以下内容:
- [security]
- # 允许用 root 用户进行远程连接
- AllowRemoteRoot=true
- [xdmcp]
- # 启动远程连接服务支持
- Enable=true
- # 服务端口
- Port=177
启动服务(init 3 && init 5)
官方网站参考
xmanager forum
来源: http://www.bubuko.com/infodetail-3155705.html