fosterb
Posts: 8
Joined: Fri Oct 26, 2012 11:07 am

Setting Up VNC - Connection actively refused

Fri Oct 26, 2012 11:16 am

I've just followed these instructions to get vncserver setup on my raspberry pi:

http://elinux.org/RPi_VNC_Server

I've also installed TightVNC viewer on my window 7 pc in order to connect to the pi, but having entered the ip address of the pi into TightVNC, all I get is the error message "no connection could be made because the target machine actively refused it".

I think it's up and running properly on the raspberry pi as it now asks me on login to enter a password to access my desktops, which I have done and I get "New "X" desktop is raspberrypi:1".

I thought it might be a firewall issue so I turned off Windows firewall and the same issue happens. What else could be wrong?

Thanks.

fosterb
Posts: 8
Joined: Fri Oct 26, 2012 11:07 am

Re: Setting Up VNC - Connection actively refused

Fri Oct 26, 2012 12:00 pm

Sorry, I'm a muppet.

I needed to add the :1 to the end of the IP address, working fine now.

pishark
Posts: 3
Joined: Mon Apr 22, 2013 6:39 pm

Re: Setting Up VNC - Connection actively refused

Wed Jun 12, 2013 4:18 pm

It happened with me too! And I put :1 at the end of the ip and it still doesn't work! :o Please help!

animoose
Posts: 1
Joined: Thu Dec 18, 2014 6:54 pm

Re: Setting Up VNC - Connection actively refused

Thu Dec 18, 2014 7:35 pm

I know this is a very old topic, but I'll add this note in case it helps others in future. I installed VNC on my Pi, checked it worked. Then followed the instruction for having it run at startup (http://www.raspberrypi.org/documentatio ... ccess/vnc/), and got the "actively refused" error.

I think this is because the VNC viewer is trying to connect as root, and there is no password set up for it. The password that is set up during installation is for the user who ran the installation. I have found two ways round this. You can create a vnc password for the root account by running
sudo vncpasswd
The problem is that when you connect with VNC you are then running as root, and this gives great power, with which comes great (and possibly undesirable) responsibility.

A better answer is to follow the instructions at http://elinux.org/RPi_VNC_Server, which tell you how to start VNC at log on, but only for a specific user.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Setting Up VNC - Connection actively refused

Thu Dec 18, 2014 8:41 pm

FWIW, since I didn't want a VNC server running on start-up, I used a modified approach from that in penguintutor's tutorial thus:
http://www.cpmspectrepi.webspace.virgin ... tVNC_Usage
Of course there are other VNC servers than tightvnc and, like many Linux/Unix tasks, several ways of achieving similar goals - use what works best for you.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Return to “General discussion”