Cannot connect with VNC.  Likewise, other machines cannot conect to my machine via VNC

Posted on 2006-07-13
Last Modified: 2008-01-09
Hello Experts.  Here is my issue.  (I'll get this out of the way - windows firewall is not on)  When trying to connect to a machine via VNC I am receiving this error:  unable to connect to host: An invalid argument was supplied. (10022)  Can anyone help?  It's driving me nuts!  Thanks!
Question by:ibiquity
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +3
LVL 43

Expert Comment

by:zephyr_hex (Megan)
ID: 17103155
10022 "invalid argument" is a standard TCP/IP error code.
are you trying to connect to a machine inside your network?  i would start there so as to rule out firewall issues on the router, or port forwarding issues on the router.
also, are all computers involved fully patched?

Expert Comment

ID: 17103679
Try running VNC in service mode
then restart the VNC service and try and connect

also, make sure both ends are using the same version of VNC

Expert Comment

ID: 17103962
I've had alot of problems with this type of connection. Some more information is needed to accurately answer this question.  First, are the machines connected on a local network?  If not, what types of connections do they use.  Second, How is VNC setup on each machine?  To clarify that, which one runs the server, and which the client, and how are they configured.
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

LVL 44

Expert Comment

ID: 17105045
is this connect across the internet or just the local lan?  That is crucial info before we can give a solution.

Expert Comment

ID: 17106345
for example, specifying an invalid level to the setsockopt function). In some instances, it also refers to the current state of the socket - for instance, calling accept on a socket that is not listening.
install any other version of VNC
check if all connection are open
firewall is also a probability but u have mentioned it's off
hope it might help you

Author Comment

ID: 17107742
The machine(s) are inside a local LAN.  VNC is set up with both server and client on everymachine.  My counter part in Maryland (I am in NJ - but on the same network) can connect to many machines but not mine.  I cannot connect to any machines.
I just tried to run VNC - Run Listening VNC Server and got this error:  unable to set socket to listening mode.  An invalid argument was supplied (10022)
All your help is, as usual, much apprciated!

Expert Comment

ID: 17107774
I'm fond of a version of VNC called UltraVNC which has a repeater function ( )  Have you tried that type of connection?
LVL 44

Accepted Solution

scrathcyboy earned 500 total points
ID: 17109904
It is possible that you are confusing the VNC terms -- they are exactly backward to what a "normal" person would expect.  The server is actually the listener for an incoming connection, and the "listener" is actually the "server" that does the active connecting.  So without arguing terms, if you are trying to connect to anyone, you need to run what they call the "listener" and they run the "server".  Make sure their server is set to accept a connection by default, and they have the ports at 5900 5800 and auto.

Now when you connect to them you type in "computer1" if you are on the lan (use their computer name).  If someone is connecting to you over the net, they need " " i.e. your WAN IP and :0 for the first person on the network running the port settings on "0" -- not auto.  If calling in, the "server" needs to have a fixed IP -- and here is the problem, the router needs to forward ports 5900 and 5800 to a fixed IP number, but if more than 1 person is running VNC, then you need to forward ports 5901 and 5801 to the NEXT person with a fixed IP, and set their server port setting to "1", not "0".

Author Comment

ID: 17141214
After a fix here and there it all boiled down to McAfee.  McAfee Total Protection for small businesses was blocking not only VNC and Remote Desktop but a whol array of connections.  It kept on blocking even after 1) Turned the McAfee firewall off and 2) Completely unistalling McAfee.  Had to format and rebuild machine.  No McAfee now and everything is running smoothly!

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RHEL6 + dockers - No route to host 7 104
Powerline Adapter - Unidentified network 9 104
IE Protected Mode Notification Bar Message 5 19
PCAP file format 4 36
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question