Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Raspberry Pi VNC fail connection

I face a problem that I can ping to correct IP address, it have no loss. And also I use nmap ping the pi address, and I get it correctly. Then I using VNC viewer to try access to pi, but it always show up "The connection was refused by the host computer"

Did u all have any idea ?

like image 356
Jackdon Chew Avatar asked Mar 02 '17 07:03

Jackdon Chew


People also ask

Why is VNC not accepting connections?

The remote computer's antivirus software or firewall is blocking your connection attempt. On the remote computer, ensure antivirus software lists VNC Server as an exception, and the firewall is configured to allow access on VNC Server's listening port (5900 by default).

How do I connect Raspberry Pi to VNC Viewer?

Open a terminal window and run the command sudo apt-get update, then sudo apt-get install realvnc-vnc-server. This will make sure you're running the latest version. Then, in the graphical desktop, go to Menu > Preferences > Raspberry Pi Configuration > Interfaces. You will come across VNC in there.


1 Answers

Your problem indicates that your Raspberry Pi was reached by the connection attempt, but that no service was running on the relevant port and hence the connection was refused. I think, this is because the VNC service is not running on your Raspberry Pi.

Update 1
Raspbian now comes with the server by default thanks to a partnership with RealVNC, it just needs to be enabled.

Original
You must enable VNC Server on your Raspberry Pi using terminal

sudo apt-get update
sudo apt-get install realvnc-vnc-server

or you can also enable VNC Server on the command line using the sudo raspi-config command.

Advanced Options->VNC:Yes

Now you can connect to the VNC Server using a application such as VNC Viewer.

like image 89
avatli Avatar answered Sep 18 '22 04:09

avatli