想实现WINDOWS系统远程连接Centos7
根据网上http://www.linuxidc.com/Linux/2015-04/116725.htm
文章复制vncserver@.service文件为vncserver@:1.service
修改了vncserver@:1.service文件root用户登录
[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=/root/.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'但是启动一直报错
[root@localhost Desktop]# systemctl daemon-reload [root@localhost Desktop]# systemctl start vncserver@:1.service 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. [root@localhost Desktop]# sudo systemctl status vncserver@:1.service ● vncserver@:1.service - Remote desktop service (VNC) Loaded: loaded (/usr/lib/systemd/system/vncserver@:1.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2016-09-19 10:56:05 CST; 4s ago Process: 8861 ExecStart=/usr/sbin/runuser -l root -c /usr/bin/vncserver %i (code=exited, status=2) Process: 8858 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS) Sep 19 10:56:04 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)... Sep 19 10:56:05 localhost.localdomain systemd[1]: vncserver@:1.service: control process exited, code=exited status=2 Sep 19 10:56:05 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC). Sep 19 10:56:05 localhost.localdomain systemd[1]: Unit vncserver@:1.service entered failed state. Sep 19 10:56:05 localhost.localdomain systemd[1]: vncserver@:1.service failed.
问题已解决
rm-rf/tmp/.X11-unix/*可以看一下我原来装的vnc记录
https://my.oschina.net/u/2561483/blog/676894
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。