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的更多相关文章

  1. []: secureCRT连接ubuntu问题- The remote system refused the connection

    secureCRT连接ubuntu问题- The remote system refused the connection http://jxyang.iteye.com/blog/1484915 解 ...

  2. SecureCRT远程连接The remote system refused the connection问题

    今天用SecureCRT远程连接Linux(Centos 7)时,连不上,报错The remote system refused the connection.于是就百度,首先查看sshd服务有没有启 ...

  3. Listener refused the connection with the following error 错误解决

    原文地址 :http://blog.csdn.net/zajin/article/details/17753351 做个备份: 查询数据库当前进程的连接数: select count(*) from ...

  4. 关于Oracle出现listener refused the connection with the ORA-12505错误,解决方案

    出现listener refused the connection with the ORA-12505错误,解决方案: 1.首先重启一下电脑,释放被占用的1521端口 2.重启后打开Oracle D ...

  5. 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; 然后再输入密码即可. 然后我的数据库连接工具使用 ...

  6. Ubuntu secuerCRT连接失败,The remote system refused the connection.

    新安装的ubuntu系统,securtCRT连接失败,出现下面结果,这是因为ubuntu没有安装工具. The remote system refused the connection. 解决办法: ...

  7. 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.

  8. SecureCRT连接Ubuntu报The remote system refused the connection.解决方案

    使用SecureCRT连接到远程Ubuntu,连接失败报The remote system refused the connection. 进入Ubuntu系统,终端中敲入以下命令: ps -ef|g ...

  9. Hive中导入Oracle数据错误:Listener refused the connection with the following error: ORA-12505

    问题: 今天往Hive中导入Oracle数据的时候碰到了如下错误:Listener refused the connection with the following error: ORA-12505 ...

随机推荐

  1. Spark Streaming源码解读之Receiver生成全生命周期彻底研究和思考

    本期内容 : Receiver启动的方式设想 Receiver启动源码彻底分析 多个输入源输入启动,Receiver启动失败,只要我们的集群存在就希望Receiver启动成功,运行过程中基于每个Tea ...

  2. knockoutJS+knockout.multimodels使用记录

    可以多次绑定,但不能嵌套绑定 错误示例: <div class="con_c" data-model="viewModel"> <div da ...

  3. 【227】◀▶ IDL 其他常用函数

    参考:Programming and Control Routines —— 编程和控制函数 01   N_ELEMENTS 表达式或者变量的元素个数. 02   DEFSYSV 定义系统变量. 03 ...

  4. Web前端之html_day1

    1.html结构 1 2 3 4 5 6 7 8 9 10 <!DOCTYPE html>   <html lang="en"> <head> ...

  5. Spring 4集成 Quartz2(转)

    本文将演示如何通过 Spring 使用 Quartz Scheduler 进行任务调度.Spring 为简化 Quartz 的操作提供了相关支持类.本文示例使用的相关工具如下: Spring 4.2. ...

  6. iOS学习笔记(5)— UITextField

    UITextField详解 一.基本属性 1.创建文本输入框 UITextField*textField=[[UITextField alloc]initWithFrame:CGRectMake(10 ...

  7. 想要隐藏navigationBar,同时又想支持右滑返回功能

    如果直接设置 self.navigationBarHidden = YES; 那同时也会屏蔽右滑返回功能. 解决办法1: self.navigationBarHidden = NO; self.nav ...

  8. 如何使用本地yum源?

    首先为大家介绍在Centos系统上如何利用系统光盘/镜像作为yum源,实现程序包的安装等操作 1.首先在VM虚拟机上确保已载入光盘镜像,载入成功后显示如下效果. 2.挂载光盘镜像文件,使用命令: mo ...

  9. ActiveMQ安装与使用

    一 .安装运行ActiveMQ: 1.下载activemq wget http://archive.apache.org/dist/activemq/apache-activemq/5.9.0/apa ...

  10. Android-Junit-Report测试报告生成——Android自动化测试学习历程

    视频地址: http://www.chuanke.com/v1983382-135467-384869.html 这个内容其实已经在用了,我在上一篇文章robotium—只有apk文件的测试中已经讲过 ...