1. 安装桌面环境
# 首先安装桌面环境,这里安装 GNOME。
yum -y groups install "GNOME Desktop"
# 从命令行切换到桌面环境
startx
# 获取当前启动模式
systemctl get-default
# 修改启动模式为图形化
systemctl set-default graphical.target
# 修改启动模式为命令行
systemctl set-default multi-user.target
# 默认启动桌面环境后以 root 用户自动登录。
# 修改配置文件:/etc/gdm/custom.conf
# 增加如下配置:
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=root
2. 远程服务设置
# Windows 远程登录需要安装 Xrdp,需要 epel 源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
或:
yum install epel-release
yum install -y xrdp
# Xrdp 会调用 VNC,安装 tigervnc-server
yum install -y tigervnc-server
# 修改 Xrdp 最大连接数
vim /etc/xrdp/xrdp.ini
max_bpp=32
# 启动 Xrdp 并设置开机