suosuo 2020-05-14
[ /]# yum install -y tigervnc-server
[ /]# cp /lib/systemd/system/ /etc/systemd/system/:1.service 注:拷贝一个新的配置文件,以开启1号窗口为例(想要同时开启多个窗口,修改其中数字即可) [ /]# vi /etc/systemd/system/:1.service [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target [Service] Type=simple # Clean any existing files in /tmp/.X11-unix environment ExecStartPre=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :‘ ExecStart=/usr/bin/vncserver_wrapper <USER> %i #将文中的“<USER>”替换为你系统的用户名root ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :‘ [Install] WantedBy=multi-user.target
[ /]# systemctl daemon-reload
[ /]# vncpasswd Password: #新密码:123456 Verify: #再次输入:123456 Would you like to enter a view-only password (y/n)? n A view-only password is not used [ /]#
[ /]# systemctl start :1.service [ /]# systemtcl enable :1.service6.查看linuk的ip地址
下载地址:https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.20.113-Windows.exe
打开VNC Viewer之后,输入服务器ip及端口即可连接,如下图: