User avatar
drxenocide
Posts: 10
Joined: Mon May 19, 2014 11:52 am
Location: College Park, MD, USA

TightVNC Problems #5905943

Mon May 19, 2014 12:32 pm

First post on the forums, hopefully this will not be a chore to read or respond to.

Problem: TightVNC View running on Windows 7 says: "Error in TightVNC Viewer: No connection could be made because the target machine actively refused it."

Things I have done:
1) Installed Rasbian from noobs on my RPi
2) Set my pi to a static IP address (192.168.1.222) by modifying the /etc/network/interfaces file according to: https://www.andrewmunsell.com/blog/sett ... ess-device
3) Installed TightVNC on my RPi trying to follow http://elinux.org/RPi_VNC_Server as closely as possible.
4) I BELIEVE I have correctly created the vncboot exectuable file correctly because when i type

[email protected] $ ps aux | grep vnc

I get:

root 2090 0.0 0.1 1756 524 ? S 10:03 0:00 /bin/sh /etc/init.d/vncboot start
root 2091 0.0 0.5 4744 2672 ? S 10:03 0:00 /usr/bin/perl /usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565
root 2101 0.0 0.0 1680 440 ? S 10:03 0:00 vncpasswd /root/.vnc/passwd
pi 2349 0.0 0.1 3548 808 pts/1 S+ 11:45 0:00 grep --color=auto vnc

5) I insalled TightVNC Viewer on Windows 7.
6) I installed Putty on Windows 7, and can SSH into my RPi without problems (192.168.1.222 port 22).
7) I open up TightVNC Viewer and put in: 192.168.1.222::5900 for the connection host. (it also happens for 192.168.1.222::5900, 192.168.1.222::5901, 192.168.1.222::5902, and 192.168.1.222:5900)
8) On all connection attempts I get the same message

I assume that something is wrong on the windows end since vnc server shows up as a process on the RPi. From my reading of the same problems, the user error was usually the server not running on the Pi, or the user forgetting to put ::5900 at the end of the IP address.
"I don't mean to discourage people from trying Linux, but telling you that your experience with Linux will be frustration-free and rosy would be like selling you Mario Brothers with Dark Souls: Prepare to Die Edition actually in the case."

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4056
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: TightVNC Problems #5905943

Mon May 19, 2014 12:57 pm

A couple of things.

1. i've found that sometimes especially if i've only just started tightvnc server on the raspi that i need to try a couple of times to connect from win7 viewer as the 1st time it refuses also sometimes I need to kill tightvnc server on the raspi then restart it if it's been running for a long time before I am trying to use it

2. you need to connect to port 5901 as tightvnc server puts the display on port 5900+display number
e.g. New 'X' desktop is glooston:1

means glooston (my raspi):5900 (vnc port)+1

User avatar
DougieLawson
Posts: 35155
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: TightVNC Problems #5905943

Mon May 19, 2014 1:10 pm

Try
192.168.1.222:1 or 192.168.1.222:5901
on your vnc client.

Just one colon.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

User avatar
drxenocide
Posts: 10
Joined: Mon May 19, 2014 11:52 am
Location: College Park, MD, USA

Re: TightVNC Problems #5905943

Mon May 19, 2014 3:54 pm

Thanks guys, but the 192.168.1.222:5901 (or 192.168.1.222::5901 or 192.168.1.222::1 or 192.168.1.222:1) isn't working either.
"I don't mean to discourage people from trying Linux, but telling you that your experience with Linux will be frustration-free and rosy would be like selling you Mario Brothers with Dark Souls: Prepare to Die Edition actually in the case."

User avatar
DougieLawson
Posts: 35155
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: TightVNC Problems #5905943

Mon May 19, 2014 4:58 pm

Then look at what firewall you've got on Windows that may be blocking that.

You may need to convince Windows that machines in your 192.168.1.0/24 subnet are all kosher and can be trusted.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

User avatar
drxenocide
Posts: 10
Joined: Mon May 19, 2014 11:52 am
Location: College Park, MD, USA

Re: TightVNC Problems #5905943

Tue May 20, 2014 11:34 am

So I got it working.

After uninstalling (using sudo apt-get purge) Tight VNC, deleting my boot script, reinstalling TightVNC, installing x11vnc, and then uninstalling x11vnc, and then rebooting (in that order) - I then tried using 192.168.1.122::5900 and I got a login and a screen. The screen was j ust grey but I was almost there.

Then after sleeping on it, I realized that the command I had been running was:
vncserver :0 -geometry 1920x1080 -depth 24
so that was opening a port on ::5900. I tried opening on ::5901 (on the viewer) after using the command (on the server):
vncserver :1 -geometry 1920x1080 -depth 24
but when I tried to connect it said the port was open but there was no data. So I opened up another server on :2 using:
vncserver :2 -geometry 1920x1080 -depth 24
Then when I connected to 192.168.1.222::5902 it showed me a login screen where I typed in my screen password (not pi password). I typed it in and finally saw my desktop.

BTW if you forget your TightVNC screen password, just delete the password file at /home/pi/.vnc/passwd which you can find as a running process by typing "ps aux | grep vnc" - which will show you active vnc processes that have the word "vnc" in them (I used it a lot).

Another thing I did between reinstallations (although I dont know if it did anything) was I got prompts that certain files were preventing the starting of a TightVNC process, so as prompted I removed them via:
"sudo rm /tmp/.X11-unix/X0"
"sudo rm /tmp/.X0-lock"

Now I can realize my dream - using mathematica at home while paying less than hundreds of dollars on their exorbitant licensing fees.
"I don't mean to discourage people from trying Linux, but telling you that your experience with Linux will be frustration-free and rosy would be like selling you Mario Brothers with Dark Souls: Prepare to Die Edition actually in the case."

Return to “Troubleshooting”