Troubleshoot Refused VNC Connection in CentOS 7
Troubleshoot Refused VNC Connection in CentOS 7
The other day I connected to my CentOS 7 computer from Windows via RealVNC Viewer. Everything went fine, but after I left the machines unattended for a short time, the connection froze to the point that I had to shut CentOS down and boot it again. When I tried to connect again, I got an error message saying something like “The connection was refused by the host computer” or similar, I can’t remember exactly. I rebooted CentOS several times, but nothing changed. Now I had to connect a monitor and the necessary peripherals to the box and start troubleshooting.
First, I checked the status of the VNC service:
[root@localhost Desktop]# systemctl status vncserver@:2.service -l
vncserver@:2.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:2.service; enabled)
Active: failed (Result: exit-code) since Sat 2015-02-28 14:37:00 CET; 10min ago Feb 28 14:37:00 localhost.localdomain systemd[1]: vncserver@:2.service: control process exited, code=exited status=2
Feb 28 14:37:00 localhost.localdomain systemd[1]: Failed to start Remote desktop service (VNC).
Feb 28 14:37:00 localhost.localdomain systemd[1]: Unit vncserver@:2.service entered failed state.
The VNC service apparently failed to start. If you don’t know why I used vncserver@:2.service, please read my earlier post about configuring VNC. I tried to start the service, but it kept failing:
[root@localhost Desktop]# systemctl start vncserver@:2.service
Job for vncserver@:2.service failed. See 'systemctl status vncserver@:2.service' and 'journalctl -xn' for details.
As I was digging through the internet, I found some clues about corrupted session files that had to be deleted to solve this problem. The files were supposed to be in the /tmp/.X11-unix directory (capital X11, Linux is case-sensitive!). When I checked the contents of /tmp, I found this:

There was no /.X11-unix directory inside. The issue was, that this folder is hidden and such items can only be seen if you put -la after ls, like this:

Now I saw the folder I was looking for at the end of the list. Inside /.X11-unix were the session files:

The corrupted file belonging to “vncuser”, the user I configured for VNC access, was X2. I removed it with the rm /tmp/.X11-unix/X2 command. Then, I started the service, rebooted the computer and I was able to seamlessly connect to my CentOS machine through VNC.
Troubleshoot Refused VNC Connection in CentOS 7的更多相关文章
- []: secureCRT连接ubuntu问题- The remote system refused the connection
secureCRT连接ubuntu问题- The remote system refused the connection http://jxyang.iteye.com/blog/1484915 解 ...
- SecureCRT远程连接The remote system refused the connection问题
今天用SecureCRT远程连接Linux(Centos 7)时,连不上,报错The remote system refused the connection.于是就百度,首先查看sshd服务有没有启 ...
- Listener refused the connection with the following error 错误解决
原文地址 :http://blog.csdn.net/zajin/article/details/17753351 做个备份: 查询数据库当前进程的连接数: select count(*) from ...
- 关于Oracle出现listener refused the connection with the ORA-12505错误,解决方案
出现listener refused the connection with the ORA-12505错误,解决方案: 1.首先重启一下电脑,释放被占用的1521端口 2.重启后打开Oracle D ...
- Connection to Oracle failed. [66000][12505] Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor .
我安装了Oracle数据库,默认的数据库用户名是system,密码口令是安装过程中你自己设置的.可以先使用命令框,输入 sqlplus system; 然后再输入密码即可. 然后我的数据库连接工具使用 ...
- Ubuntu secuerCRT连接失败,The remote system refused the connection.
新安装的ubuntu系统,securtCRT连接失败,出现下面结果,这是因为ubuntu没有安装工具. The remote system refused the connection. 解决办法: ...
- SecureCRT connecting VM Linux show error message: The remote system refused the connection.
SecureCRT connecting VM Linux show error message: The remote system refused the connection.
- SecureCRT连接Ubuntu报The remote system refused the connection.解决方案
使用SecureCRT连接到远程Ubuntu,连接失败报The remote system refused the connection. 进入Ubuntu系统,终端中敲入以下命令: ps -ef|g ...
- Hive中导入Oracle数据错误:Listener refused the connection with the following error: ORA-12505
问题: 今天往Hive中导入Oracle数据的时候碰到了如下错误:Listener refused the connection with the following error: ORA-12505 ...
随机推荐
- 系统中定义VOMapping的时候注意大小写
VOMapping中的第一个参数一定要严格按照大小写(缩写的单词容易错): 例如:VO中的定义: private CntVOEnums.EnumIVRStage ivrStage; 实际反射找这个字段 ...
- SQL常用代码收集
1.存储过程中,使用in查询时的参数处理方式 使用情形描述:传入存储过程的参数为一个字符串@IDs,以固定分隔符连接 新建字符串分割函数,然后将分割结果传入存储过程: CREATE FUNCTION ...
- SQL镜像资料
使用数据库镜像端点证书 (Transact-SQL):https://msdn.microsoft.com/zh-cn/library/ms191477.aspx 允许数据库镜像端点将证书用于入站连接 ...
- VC++中操作XML(MFC、SDK)转
[转]VC++中操作XML(MFC.SDK) XML在Win32程序方面应该没有在Web方面应用得多,很多Win32程序也只是用XML来存存配置信息而已,而且没有足够的好处的话还不如用ini.VC++ ...
- 深入理解js——隐式原型
每个函数都有一个prototye(原型),而每个对象都有一个_proto_,可成为隐式原型. _proto_是一个隐藏的属性,javascript不希望开发者用到这个属性值,有的低版本浏览器甚至不支持 ...
- 《Cracking the Coding Interview 》之 二叉树的创建 与 遍历(非递归+递归version)
#include <iostream> #include <cstdio> #include <vector> #include <stack> #de ...
- Xml文件操作的其中一个使用方法:
XmlNodeList students = doc.DocumentElement.ChildNodes;//Student节点集合 foreach (XmlNode stu in students ...
- 开源PLM软件Aras详解五 如何让ItemType显示在TOC上
通过上一边ItemType我们大概了解,那么如何让ItemType显示在左侧的菜单上呢,又如何设置增删查改的权限呢,接下来将为演示. 在上一篇中,我们知道了ItemType的结构图,如下图 那么如何让 ...
- 关于Beam Search
Wiki定义:In computer science, beam search is a heuristic search algorithm that explores a graph by exp ...
- JQuery Checkbox的change事件
JQuery Checkbox的change事件 参考 http://blog.csdn.net/hbhgjiangkun/article/details/8126981 $(functio ...