CentOS 7.4下VNC Server服务配置
CentOS 7.4下VNC Server服务配置
一、安装VNC相关包
yum -y install tigervnc tigervnc-server tigervnc-server-module
二、复制配置模板文件为vncserver@:1.service
cp /lib/systemd/system/[email protected] /lib/systemd/system/vncserver@:1.service
三、修改/lib/systemd/system/vncserver@:1.service配置文件
[root@kvm01 ~]# cat /lib/systemd/system/vncserver\@\:1.service | grep -v ^# | grep -v ^$ [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target [Service] Type=forking 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=/root/.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' [Install] WantedBy=multi-user.target
四、设置VNC用户密码
vncpasswd
输入两次密码,完成密码设置
五、重新载入system配置
systemctl daemon-reload
六、启动vncserver@:1.service服务,并设置开机自启
systemctl start vncserver@:1.service && systemctl enable vncserver@:1.service
注:若系统无法正常关机,则再次启动,此服务无法启动,解决办法参照步骤七
七、问题解决
1.报错:Job for vncserver@:1.service failed because the control process exited with error code. See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.
处理方法:
相关推荐
MichelinMessi 2020-07-30
luobotoutou 2020-08-17
LandryBean 2020-07-29
hnllei 2020-05-30
suosuo 2020-05-14
zlsh00 2020-04-22
哥哥的CSDN集 2020-01-31
86294251 2020-01-28
jackadmi 2020-01-04
iamplane 2020-01-04
IsanaYashiro 2020-01-04
诸葛飞 2013-04-14
manimnchn 2013-04-06
旭灿 2013-04-02
数据齿轮 2019-12-28
zaqwsx0 2015-02-06