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

Let's say I went to:

 System > Preferences > Remote Desktop

And enable Remote Desktop. Now let's say I have another machine on the network that is also running a VNC server. I want to VNC into my network from the outside, but I need each VNC server to be running on different ports.

How can I change Ubuntu's default port for Remote Desktop/VNC?

share|improve this question
you seem to have some confusion about networking here. why do two different VNC services on different computers need to be running on different ports? – Sparr Jun 19 '13 at 1:10
@Sparr Because my router port forwards by port number to a specific local IP address. e.g. 5600 could be, 5601 could be to So coming in, it could be -> or -> – Bryan Denny Jun 19 '13 at 15:11
what model router? you should be able to tell it what the local port for each outside port is. so -> and -> – Sparr Jun 19 '13 at 16:21
@Sparr Buffalo WZR-HP-g300nh running ddwrt, I just use Port Range Forwarding, so it directly forwards the external IP port to the internal IP address, which is fine by me – Bryan Denny Jun 19 '13 at 17:32
up vote 5 down vote accepted

Using a little information from the dated Dave's Tech Blog, you can adjust the port setting by going into gconf-editor.

Under desktop > gnome > remote access there is a key that says alternative_port and is set to 5900. Just change the value to what you need. Then enable the key use_alternative_port.

The other option is if your router/firewall support uPnp you can adjust Vino to make the adjustment in the same section of gconf-editor.

share|improve this answer
Exactly what I needed, thanks! – Bryan Denny Oct 20 '10 at 12:54

You can also do this from the command line.
For example, to use port 5555, you would use these two commands:

gconftool-2 --set --type=bool /desktop/gnome/remote_access/use_alternative_port true
gconftool-2 --set --type=int /desktop/gnome/remote_access/alternative_port 5555

Note, if you follow the schema docs, the port should be in the 5000 - 50000 range:

[the alternative_port key is set to] the port which the server will listen to if the 'use_alternative_port' key is set to true. Valid values are in the range from 5000 to 50000.

share|improve this answer

Under desktop > gnome > remote access there is a key that says alternative_port and is set to 5900. ...of course to do this you need that key to actually exist

share|improve this answer

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.