vncserver无法启动

一、问题现象

运行vncserver的时候提示出错,查看vnc的日志发现如下错误日志

litin@linuxService:~/.vnc$ cat linuxService\:4.log 

Xvnc Free Edition 4.1.1 - built Jul 31 2015 19:10:31
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 40300000, The XFree86 Project, Inc


Sun Feb 11 16:20:23 2018
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on port 5904
 vncext:      created VNC server for screen 0
error opening security policy file /etc/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!
Could not init font path element /usr/share/fonts/X11/75dpi/, removing from list!
Could not init font path element /usr/share/fonts/X11/100dpi/, removing from list!
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
No protocol specified
xsetroot:  unable to open display ':4'
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
No protocol specified
vncconfig: unable to open display ":4"
此版本的 gnome-terminal 已不再支持选项 "--login" ;您可能想要创建一个有期望设定的配置文件,然后使用新的“--profile”选项
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
No protocol specified

** (gnome-terminal:3636): WARNING **: Could not open X display
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
No protocol specified
无法处理参数:无法打开显示:
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
No protocol specified
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
No protocol specified

** (gnome-session:3637): WARNING **: Could not open X display
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
No protocol specified

** (gnome-session:3637): WARNING **: 无法打开显示:
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host
AUDIT: Sun Feb 11 16:20:26 2018: 3629 Xvnc4: client 1 rejected from local host

二、问题分析

  问题的根源是在于SecurityPolicy打开不了(“error opening security policy file /etc/X11/xserver/SecurityPolicy“),猜测这个文件的读写权限有问题。

利用命令xauth -b list可以验证

litin@linuxService:~/.vnc$ xauth -b list
xauth:  /home/litin/.Xauthority not writable, changes will be ignored

三、解决方法

用chown 命令把文件”.Xauthority“改成当前用户名就可以成功启动vncserver了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值