os | rhel 7.2 |
# yum groupinstall -y "Server with GUI"
# systemctl set-default graphical.target
# reboot
# yum -y install vnc*
# cd /lib/systemd/system
# cp -a vncserver@.service vncserver@:1.service
# vi vncserver@\:1.service
[Unit] Description=Remote desktop service (VNC) After=syslog.target network.target
[Service] Type=forking # Clean any existing files in /tmp/.X11-unix environment ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i" PIDFile=/home/<USER>/.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
[Install] WantedBy=multi-user.target |
# systemctl daemon-reload
# vncpasswd root
# vncserver :1
# systemctl enable vncserver@:1.service
win 端连接
VNC-Viewer-5.0.3-Windows-32bit.exe