Virtual Network Computing

Troubleshoot: VNC connection refused, VNC Black Screen Issue and many others

Updated on:  

Virtual Network Computing (VNC) is a screen sharing mechanism that makes it possible to remotely control another computer. Making use of the RFB (Remote Frame Buffer) protocol – VNC allows for the transporting of data between the server and client machines.

This includes peripheral inputs and outputs from your keyboard and mouse, making the VNC experience behave as if you’re physically connected to the server. The server is the remote device that you want to connect to. Client refers to your local machine from which you are accessing the server. Check other best secure remote access software.

The most common problems experienced by VNC users involve connectivity errors and display issues. This article will guide you through these common problems and provide you with recommended steps to resolve these issues.

VNC Server is Not Currently Listening for Cloud Connections

Step through the following checklist to resolve the problem:
  1. The remote computer or server must be connected to the Internet in order for you to connect to it.
  2. Make sure that the server is not in sleep mode. It is recommended that you configure the power options to ensure it never goes to sleep.
  3. Is “Allow cloud connections” checked in your VNC Server settings?
  4. Have you selected the correct team for the remote computer?

    vnc viewer
  5. For subscription users, verify that you are attempting to join your computer with the correct paid-for team.
  6. If you’re using Linux, establish that the Linux display server protocol Wayland is disabled.
  7. Сheck the RealVNC status page for service issues
  8. If none of the previous steps helped, restart the VNC Server itself and the computer, which is running it.

If you have gone through all the above steps but you are still experiencing a problem, then log a support ticket with RealVNC here.

VNC Viewer the Connection was Refused by the Computer

Reasons why you may get a “connection was refused” error:

VNC Viewer connection was refused
  1. The VNC server is not running

    Make sure you log in with the correct user/password combination. When running the vncserver command, set the password as the correct user. Also make sure the server is started by using service vncserver start.

  2. VNC not running on the specified port range

    The default VNC port is 5900. Make sure the VNC Server is configured to use that port. If you are using multiple displays you can use any port from 5901. Use /usr/bin/vncserver to edit the port.

VNC Connection Refused 10061

Possible reasons why you’re experiencing this problem:

  1. VNC server is not running
    Simply restart the service using the “service vncserver start” command.

  2. Firewall denying access
    Make sure that ports 5800 and 5900 are open on your firewall. If you use additional displays, make sure to open those ports too, for example 5801 and 5901 ports for the first display, 5802 and 5902 for the second one.

  3. VNC user’s IP is denied
    If the IP of the user is listed in /etc/hosts.deny you will not be able to connect. To rectify this, simply remove the blocked IP from the list and add it to /etc/hosts.allow instead.

Unable to Connect to VNC Server Using Your Chosen Security Setting

Common reasons for this error include:

  1. The encryption settings for a direct connection between the Server and the Viewer are not compatible.

  2. The version of VNC server may not support encryption

    Unable to connect to VNC server using your chosen security setting

Sometimes you can see the “No Matching Security Types” error message because of these reasons.

To try to resolve this, check for the latest versions of the VNC Connect and VNC Server applications and make sure to upgrade accordingly.

If that doesn’t resolve the problem, change your VNC Server encryption parameter to one of the other settings other than AlwaysOff. Also change the VNC Viewer Encryption to Server, PreferOn or PreferOff.

VNC authentication failure

If VNC Viewer error ”The too many authentication failures” is experienced, this could indicate that someone is using brute force attacks to try and gain access to your server.

If you need to regain access to your VNC, follow these steps:

  1. Login using SSH.

  2. Use #pgrep vnc to retrieve the current VNC session ID.

  3. Kill the session using #kill XXXX where XXXX is the ID revealed in step 2.

  4. Use #vncserver to restart the VNC Session.

To prevent this from happening again, block all public IPs on your firewall with exception to those known / required IPs. This however will only work with static IPs.

  1. To list your current active firewall rules, use #iptables -L.

  2. To allow a specific port, i.e 5901, use # iptables -I INPUT -p tcp -s your-ip --dport 5901 -j ACCEPT.

  3. Now block all other IPs using # iptables -A INPUT -p tcp -s --dport 5901 -j DROP.

VNC connection closed unexpectedly

If you get a “Connection closed unexpectedly” error, check the following:

  1. Make sure the VNC server and clients are allowed by the firewall.

  2. Is the VNC port correct?

  3. Confirm you are using the right password.

If previous steps didn’t work, you need to check the logs. An “Error during RFB initialization” means that you need to uninstall all display drivers incompatible with the VNC Server.

To check logs do next:

  1. Open Event Viewer.

  2. Select Windows Logs > Application.

  3. Select Filter Current Log.

  4. Choose VNC Server as the Event sources.

Another reason for this error may be because your version of Windows and VNC are incompatible. If you’re on Windows 7 or above, your version of RealVNC must be v5 or greater.