Centos 7上安装VNC server
时间:2015-09-18 07:30 来源:linux.it.net.cn 作者:IT
[root@localhost ~]# yum check-update
[root@localhost ~]# yum groupinstall "X Windows System"
[root@localhost ~]# yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
[root@localhost ~]# unlink /etc/systemd/system/default.target
[root@localhost ~]# ln
-sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
[root@localhost ~]# reboot
[root@localhost ~]# yum install tigervnc-server -y
[root@localhost ~]# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
[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=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid
[root@localhost system]# systemctl daemon-reload
[root@localhost system]# vncpasswd
[root@localhost system]# systemctl enable vncserver@:1.service
ln -s '/etc/systemd/system/vncserver@:1.service' '/etc/systemd/system/multi-user.target.wants/vncserver@:1.service'
[root@localhost system]# systemctl start vncserver@:1.service
[root@localhost ~]# firewall-cmd --permanent --add-service vnc-server
[root@localhost ~]# systemctl restart firewalld.service
[root@localhost ~]# systemctl stop vncserver@:1.service
[root@localhost ~]# systemctl disable vncserver@:1.service
[root@localhost ~]# systemctl stop firewall.service
(责任编辑:IT)
|

