Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an ubuntu computer that I want to remotely log into using a vnc connection. So far, this is what I have done:

sudo apt-get install tightvncserver

After downloading the software, I typed on the terminal:

vncserver :78

I assume the :78 refers to some sort of port that I open for VNC connection (i'm new at this, so feel free to correct me). After entering in a password, this appears:

New 'X' desktop is FiniteElementMethodFiniteDifferenceMethod:78

Creating default startup script /home/pmdelgado2/.vnc/xstartup
Starting applications specified in /home/pmdelgado2/.vnc/xstartup
Log file is /home/pmdelgado2/.vnc/FiniteElementMethodFiniteDifferenceMethod:78.log

I proceeded to look up my ip address on the internet. Then, from a windows computer on the same network, used ultravnc and entered in :78 and tried to connect. Of course, this failed to produce the connection.

I have two primary questions about doing this:

  1. How do I verify (on ubuntu, not on the internet) the correct IP address for my computer?
  2. If my ubuntu computer is on a private wireless network at home, and I try to connect remotely from another location (different network), is there anything special I need to do to connect through the network (firewalls, network passwords, etc.)? Especially in the special case of loging in from a windows computer to my ubuntu?
share|improve this question

For local access you have to find out your local IP:


should help.

For remote access, you should port-forwarding your router IP on your machine local IP. You'll find many tutorials googling...

share|improve this answer
Do you recommend a particular tutorial? – Paul May 23 '12 at 16:34

Ubuntu also comes with it's own VNC server (called vino), which is easier to use (at the cost of being less configurable). Simply open up "Desktop Sharing" from your dash.

The :78 is referring to your display number, not the port. So, unless you have 79+ screens, you probably don't want to do that. :-) The numbering starts at 0, but 0 is the default anyway, so you don't have to define this when using vncserver.

  1. as jasmines has said, just use ifconfig to show your local IP.

  2. You will need to configure your router to forward a port to your Ubuntu PC. The way you do this is slightly different on all routers. It does not matter that you are using a Windows PC to connect to an Ubuntu PC, it will not change the router configuration. That's all networking. Usually if you have a home router, it should be fairly easy to figure out by poking around in there, otherwise Google for your model. is also a good site with tutorials on many different router models.

To help you on your way, VNC by default uses port 5900. So you should have port 5900 forwarded on your router to your laptop (or some other random port forwarded to port 5900 on your Ubuntu PC) to allow access to your machine over the internet. You may also want to look at using a dynamic DNS provider, such as, so you can use a DNS name, such as instead of your public IP address (which will change from time to time).

share|improve this answer
Thanks, reverendj1. Is there a standard way to forward a port, or does it depend on the router? – Paul May 23 '12 at 16:35
No problem. It really depends on the router HOW you do it. As in how you actually configure it. The actual process of it forwarding is the same though. Typically you will either forward it 1:1, meaning port 5900 on your router forwards to port 5900 on your PC, or you would forward some other port to 5900 on your PC. I think it is slightly safer to use some other port and forward it to 5900 on your PC, because 5900 is well known as the port VNC uses. is a good resource on different routers, just ignore all their advertising for their program. It is usually pretty simple – reverendj1 May 23 '12 at 16:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.