麒麟v10上安装麒麟桌面和VNC
yum -y groupinstall "Server with UKUI GUI"
vncserver 设置访问密码
#关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
#临时关闭sellinux
setenforce 0
#永久关闭sellinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
yum -y install tigervnc-server.x86_64
systemctl get-default
systemctl set-default graphical.target
vncpasswd
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
#修改/etc/systemd/system/vncserver@:1.service,换成root
------
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
WorkingDirectory=/root
User=root
Group=root
PIDFile=/root/.vnc/%H%i.pid
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver -autokill %i
ExecStop=/usr/bin/vncserver -kill %i
Restart=on-success
RestartSec=15
[Install]
WantedBy=multi-user.target
------
systemctl daemon-reload
systemctl enable vncserver@:1.service
systemctl start vncserver@:1.service
默认端口5901
可以reboot下服务器再测试下连接