centos安装桌面环境和vnc

安装依赖

1
2
3
4
5
6
7
curl "http://mirrors.aliyun.com/repo/epel-7.repo" -o /etc/yum.repos.d/epel.repo;
yum clean all
yum makecache fast;
yum update -y;
yum upgrade -y;
yum groupinstall "Server with GUI" "GNOME Desktop" "Graphical Administration Tools" -y
yum install tigervnc-server tigervnc -y

启动服务

1
2
3
systemctl start xrdp.service
systemctl status xrdp.service
systemctl enable xrdp.service

设置密码:

1
vncpasswd

启动一个服务,1对应端口5901

1
vncserver :1