由于RHEL7不支持gdm于是改用lightdm
首先保证yum源配置成功
本地源没有lightdm包,需用网络源,我配的是centos网络源,但是很奇怪也没有lightdm包,于是安装扩展包,命令:
yum install -y epel-release
安装lightdm和Xfce
[root@gf03 ~]# yum install -y lightdm && yum groupinstall -y xfce
修改lightdm.conf文件(配置文件中有详细的参数说明)
[root@gf03 ~]# vim /etc/lightdm/lightdm.conf
...
[XDMCPServer]
enabled=true
port=177
...
将Display Manager切换为lightdm
[root@gf03 ~]# systemctl disable gdm && systemctl enable lightdm
启动lightdm
[root@gf03 ~]# systemctl start lightdm
关闭或者取消防火墙(若已关闭则忽略)
[root@gf03 ~]# systemctl stop firewalld.service
只保留/usr/share/xsessions/下xfce.desktop文件
[root@gf03 ~]# cd /usr/share/xsessions/ && ls
gnome-classic.desktop gnome-custom-session.desktop gnome.desktop xfce.desktop
[root@gf03 xsessions]# mkdir bak && mv gnome* ./bak && ls
back xfce.desktop
[root@gf03 ~]# systemctl restart lightdm