How to set up VNC Server on an internal network for access from a machine on an external network

Posted on 2012-08-31
Medium Priority
Last Modified: 2012-09-17
Hello all,

I have a computer here at work that I would like to connect to using VNC Server and VNC Viewer. I already have VNC Server installed on the computer I want to access and need to install VNC Viewer on my computer at home. The problem is, people in this office are unfamiliar with the set up process to allow this access. Could someone provide a step by step  list of how to set this up? If there are any initial questions that need answering before a solution can be provided, please let me know. Thanks
Question by:DB-aha

Expert Comment

ID: 38354335
If the computer at office is provided with a public IP you can easily connect it with the vnc viewer at home. If not that means computer at office is with a private IP, then you might have a firewall at office and assign a public IP if available to the office office with the virtual IP mapping , if not then you will probably have to redirect the port.

Expert Comment

ID: 38354339
You need to setup port forwarding on your office router connected to the internet. VNC server works on TCP port 5900. You need to setup port forwarding on the router so that all requests to the router on port 5900 is forwarded to the internal VNC server.

The VNC viewer at your home would connect to the public IP address of the router at office, which would eventually connect to the VNC server.

The following link would help you to understand the concept of port forwarding.


Author Comment

ID: 38354477
Hey Andrew,

I forwarded your message to the networking team. There is a second machine they would also like to set up VNC server on so that it also can be accessed from a home user. Is the setup the same as you mentioned or are there any additional steps that need to be taken to make this happen?
LVL 26

Accepted Solution

Fred Marshall earned 2000 total points
ID: 38354802
The setup would have to be something like this:

There would be a different port forward on the gateway router to each VNC server.
Each VNC server will need a static IP address in order to support the port forward from the gateway.


Gateway public IP address is:
VNC servers with static IP addresses of: and

The port forwarding can be set up to use the same port or a different port as follows:

1-to-1 port forwarding:

Packet is sent to from a viewer machine connected to the internet.
Packet arrives at the gateway.
Gateway sees that the packet is destined for port 5900.
Port forwarding in gateway sends the packet to

Ditto for except the port number will be different; e.g. 5901.
Then the port forwarding rule sees 5901 and sends to


Packet is sent to from a viewer machine connected to the internet.
Packet arrives at the gateway.
Gateway sees that the packet is destined for port 5899.
Port forwarding in gateway sends the packet to (yes, 5900)

Packet is sent to from a viewer machine connected to the internet.
Packet arrives at the gateway.
Gateway sees that the packet is destined for port 5898.
Port forwarding in gateway sends the packet to (yes, 5900)

Maybe one or the other method works better for you.  The latter one means you don't have to change the listening ports on the VNC servers.  
In either case you have to use the proper destination ports on the VNC viewers.  
Since you have to change the destination port as soon as there are more than one server then you may as well do it that way.

Ports are nothing more than an address extension like "apartment 301" added to 33 Main ST.  In the second approach above it's like sending mail to a forwarding service (the gateway)  at 44 Main ST, Box 12.  The forwarding service has instructions to send it on to 33 Main ST, Apt 301 9the VNC server).

Some gateways likely have different capabilities one from the other but I believe they all do (or should) handle the latter case.

Expert Comment

ID: 38354809
Should be possible

Setup another port forwarding rule on the router with port no 5901 ( The router should be capable of this feature). Change the VNC server port setting to another port , say 5901. This can be done using the VNC server console.

The VNC viewer at home should now connect to the public IP of the router with the port 5901 specified.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article is in regards to the Cisco QSFP-4SFP10G-CU1M cables, which are designed to uplink/downlink 40GB ports to 10GB SFP ports. I recently experienced this and found very little configuration documentation on how these are supposed to be confi…
In this article I will be showing you how to subnet the easiest way possible for IPv4 (Internet Protocol version 4). This article does not cover IPv6. Keep in mind that subnetting requires lots of practice and time.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

750 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