VNC连接失败:The connection was refused by the host computer

时间:2024-03-31 18:19:09

当服务器异常退出后,在下一次登陆时会出现如下问题,这种情况应该是服务器IP变了,而vnc还在监听原来的IP上的数据

VNC连接失败:The connection was refused by the host computer

解决方法:

  1. 用Xshell登陆自己的服务器

VNC连接失败:The connection was refused by the host computer

  1. 在命令行中输入vncserver,命令行中出现:

Warning: optimal6:2 is taken because of /tmp/.X2-lock

Remove this file if there is no X server optimal6:2

在命令行中输入:

rm  /tmp/.X2-lock

如下图所示(^H是我输错的可忽略):

VNC连接失败:The connection was refused by the host computer