Troubleshoot: VNC connection refused, VNC Black Screen Issue and many others
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
- The remote computer or server must be connected to the Internet in order for you to connect to it.
- 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.
- Is “Allow cloud connections” checked in your VNC Server settings?
- Have you selected the correct team for the remote computer?
- For subscription users, verify that you are attempting to join your computer with the correct paid-for team.
- If you’re using Linux, establish that the Linux display server protocol Wayland is disabled.
- Сheck the RealVNC status page for service issues
- 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:
- The VNC server is not running
Make sure you log in with the correct user/password combination. When running the
vncservercommand, set the password as the correct user. Also make sure the server is started by using
service vncserver start.
- 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:
- VNC server is not running
Simply restart the service using the “
service vncserver start” command.
- 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.
- VNC user’s IP is denied
If the IP of the user is listed in
/etc/hosts.denyyou will not be able to connect. To rectify this, simply remove the blocked IP from the list and add it to
Unable to Connect to VNC Server Using Your Chosen Security Setting
Common reasons for this error include:
- The encryption settings for a direct connection between the Server and the Viewer are not compatible.
- The version of VNC server may not support encryption
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:
- Login using SSH.
#pgrep vncto retrieve the current VNC session ID.
- Kill the session using #kill XXXX where
XXXXis the ID revealed in step 2.
#vncserverto 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.
- To list your current active firewall rules, use
- To allow a specific port, i.e 5901, use
# iptables -I INPUT -p tcp -s your-ip --dport 5901 -j ACCEPT.
- Now block all other IPs using
# iptables -A INPUT -p tcp -s 0.0.0.0/0 --dport 5901 -j DROP.
VNC connection closed unexpectedly
If you get a “Connection closed unexpectedly” error, check the following:
- Make sure the VNC server and clients are allowed by the firewall.
- Is the VNC port correct?
- 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:
- Open Event Viewer.
- Select Windows Logs > Application.
- Select Filter Current Log.
- 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.
To allow screen recording, go to System Preferences > Security & Privacy > Privacy > Screen Recording.
Accessibility options can be amended here: System Preferences > Security & Privacy > Privacy > Accessibility.
Some steps to resolve this problem:
- Version 6.5.0 of VNC Server includes an upgrade to recover from a blank screen, upgrade to at least this version.
- Adjust your power settings on the server to never turn off the display.
- Disable any Battery Saver modes on the server.
- Use an EDID emulator.
- Make the following changes on the VNC Server
- ◦ Open the VNC Server on the server machine.
- ◦ Click on the menu and select Options.
- ◦ Locate CaptureMethod in the Expert tab and change the value to 1.
- ◦ Restart the VNC Server.
Copy and Paste only works with text. You cannot copy images, drag-and-drop files or other non-text items.
Should you experience any problems consider the following:
- If you have copied a large amount of data that exceeds 256kb, you will not be able to paste it. Instead the most recent item in the Clipboard will be pasted.
- It is possible that the copy/paste feature has been disabled on your VNC Server. You can check by accessing the global permissions from the VNC Server Options > Users & Permissions menu.
- The ability to copy and paste may be user specific. Check if you have permissions in the VNC Server Options > Users & Permissions settings screen.
Windows 10 Users:
Enable the “Use numeric keypad to move mouse around the screen” option from Start > Settings > Ease of Access > Mouse.
Windows 7 Users:
Open the Control Panel and select Mouse. From the “Pointer Options” tab, toggle the “Display pointer trails” option on or off. Click Apply to save your changes.