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. oracle分配权限:一个用户访问另一个用户的表

    相当于alias(别名),比如把user1.table1在user2中建一个同义词table1 create synonym table1 for user1.table1; 这样当你在user2中查 ...

  2. Servlet Cookie处理

    Servlet Cookie 处理 Cookie 是存储在客户端计算机上的文本文件,并保留了各种跟踪信息.Java Servlet 显然支持 HTTP Cookie. 识别返回用户包括三个步骤: 服务 ...

  3. UITaleView的基础使用及数据展示操作

    UITableView表视图,是实用的数据展示的基础控件,是继承于UIScrollView,所以也可以滚动.但不同于UIScrollView,UITableView只可以上下滚动,而不能左右滚动. 因 ...

  4. Mac系统默认MAWP配置

    MAC系统是自带apache的,配置起来也很容易,但是本身是不支持php的需要手动开启一下,这里记录一下配置过程 1.apache配置文件在/etc/apache2/httpd.conf,把Docum ...

  5. Java串口通信详解

    http://blog.csdn.net/kabini/article/details/1601324 ———————————————————————————————————————————————— ...

  6. COleChangeSourceDialog不能Change Source的解决方法

      在微软给的例子OClient中,有选中一个OLE对象然后Change Source的功能,但是会报错.分析了一下是这样的: void CMainView::OnOleChangeSource() ...

  7. Mycat配置文件schema.xml参数配置

    Mycat原理: Mycat的原理中最重要的一个动词是"拦截",它拦截了用户发送过来的SQL语句,首先对SQL语句做了一些特定的分析:如分片分析.路由分析.读写分离分析.缓存分析等 ...

  8. 实现textarea限制输入字数(包含中文只能输入10个,全ASCII码能够输入20个)

    document.getElementById("<%=textBox1.ClientID %>").value 实现textarea限制输入字数(包含中文只能输入10 ...

  9. nginx环境下配置nagios-关于nagios配置文件nginx.conf

    接上文:nginx环境下配置nagios-关于nginx.conf 配置如下: ;          location ~ .*\.(php|php5)?$          {            ...

  10. nullcon HackIM2016 -- Programming Question 3

    Still Hungry and unsutisfied, you are looking for more. Some more, unique un heard dishes. Then you ...