Troubleshoot Refused VNC Connection in CentOS 7

Troubleshoot Refused VNC Connection in CentOS 7

Posted on March 15, 2015 by Istvan Szarka — 2 Comments

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:

[[email protected] Desktop]# systemctl status [email protected]:2.service -l
[email protected]:2.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/[email protected]: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]: [email protected]: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 [email protected]:2.service entered failed state.

The VNC service apparently failed to start. If you don’t know why I used [email protected]:2.service, please read my earlier post about configuring VNC. I tried to start the service, but it kept failing:

[[email protected] Desktop]# systemctl start [email protected]:2.service
Job for [email protected]:2.service failed. See ‘systemctl status [email protected]: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.

时间: 2024-08-11 13:29:32

Troubleshoot Refused VNC Connection in CentOS 7的相关文章

CentOS之SSH拒绝连接一记(The remote system refused the connection)

国外的某些站点被墙,弄了一个VPS搭建pptpd的VPN服务.最近愈来愈吊老.开始大面积封杀IP.我的也没有逃过此劫.后面找VPS提供商更换了个ip,嘿嘿. 然后SSH上不去了.提示 The remote system refused the connection 经过一番排查,原来是因为 我之前修改了 ssh的监听端口.但更换ip后,ssh又变回原来的22端口了. 我用的是以前修改过后的端口.于是,我用22端口登上去,然后修改了ssh端口.问题就搞定了.

ssh连接The remote system refused the connection故障处理

安装在VMware workstation上的centos6.8有3个月没启动过了,国庆前决定用一下,却发现连不上网. 研究了一下,发现eth0变成了eth3,虽然觉得这个变化无伤大雅,但还是按照上一篇文章的办法修改网卡设备文件名,还是不行.重启网络服务,重启系统,问题还是没有解决.开始怀疑vmware workstation,升级到12.5,问题依旧.检查vmware网络配置,没看出所以然,于是冒着影响其它虚拟机网络配置的风险,用vmware虚拟网络编辑器还原vmware网络缺省配置,才发现负

Configure VNC Server on CentOS 7 / RHEL 7

The following simple guide help you to setup the VNC server on RHEL 7/CentOS 7 machines, VNC help to share the desktop with the other machines which has a client installed. VNC server and client are not installed by default, you need to setup the vnc

How to install VNC server on CentOS 6

参考: https://rbgeek.wordpress.com/2012/06/26/how-to-install-vnc-server-on-centos-6/ VNC is a protocol that is used to share the desktop with other users/computers over the network/Internet.In order to share a desktop, VNC server must be install and co

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

出现listener refused the connection with the ORA-12505错误,解决方案: 1.首先重启一下电脑,释放被占用的1521端口 2.重启后打开Oracle Develpoer 3.然后运行cmd,打开命令提示符,输入命令lsnrctl先运行stop,然后再start 4.打开资源管理器,运行C:\oraclexe\app\oracle\product\10.2.0\server\BIN\tnslsnr.exe HKEY_LOCAL_MACHINE\SYS

服务器拒绝连接(The remote system refused the connection.)

在使用CRT连接服务器的时候,出现了的 The remote system refused the connection. 一般客户端都是通过 SSH 协议连接服务器的.ping了一下,网络是通的,依靠经验判断,估计是某项服务没有启动.首先想到的是 SSH服务了. 1,切换到 /etc/ssh ,查看ssh_config文件中是否包含本机的IP地址.如果没有,请追加 本机的IP地址. 2,重启SSH服务     /etc/init.d/sshd restart 到此,问题顺利解决. 有同事说自己

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

原文地址 :http://blog.csdn.net/zajin/article/details/17753351 做个备份: 查询数据库当前进程的连接数: select count(*) from v$process; 查看数据库当前会话的连接数: elect count(*) from v$session; 查看数据库的并发连接数: select count(*) from v$session where status='ACTIVE'; 查看当前数据库建立的会话情况: select sid

将VNC 安装在Centos 7步骤

( Virtual Network Computing)VNC允许Linux系统可以类似实现像Windows中的远程桌面访问那样访问Linux桌面.本文配置机器是兴宁市网络信息中心的一台Centos 7 HP服务器环境下运行. 首先试试服务器装了VNC没 [[email protected] ~]# rpm -q tigervnc tigervnc-server 没安装的话会直接出现 package tigervnc is not installed package tigervnc-serve

The remote system refused the connection.

使用SecureCRT连接Ubuntu时,报错: The remote system refused the connection. 说明Ubuntu上没有安装openssh-server,使用命令: sudo apt-get install openssh-server 进行安装,安装完成之后执行以下命令查看: ps -e | grep ssh 结果: 5625 ? 00:00:00 sshd 再次尝试使用SecureCRT连接就成功了.