Before we go through the steps for connect to or hosting remote connections, you need to configure your firewall software. On the computers (hosts) that you're going to remotely connect to, you need to allow the VNC or RDP traffic through the firewall.
In Windows, when starting the server, you should be prompted to Block or Unblock the remote desktop server application. If you hit Unblock, all the work should be done. If you didn't receive the prompt, you can bring up Windows Firewall and add the Exception manually, using the port numbers listed in a moment.
In Linux, you'll probably have to manually add an incoming rule to the firewall utility, on the host computer. If needed, you can browse through the menus and do some Googling to figure out how to configure the firewall. Your Linux distro may include a GUI for the firewall or you may have to use the command-line. Either way, add an exception or rule to allow traffic on the appropriate ports, given below.
Now you'll be able to remotely connect among the computers on your local network. To remotely connect over the Internet, you must configure your router. We'll discuss this in the next part.
Using Ubuntu's VNC client and server
If you are using Ubuntu, you already have a VNC client/server installed and ready to use. (This how-to is based on Ubuntu Desktop 8.10 Intrepid Ibex.) To host a remote connection, simply select System > Preferences > Remote Desktop. On the dialog box, configure the desired sharing and security settings. A command/address is listed for you to use if connecting from other computers, on the local network, loaded with Ubuntu or another Linux distro.
To use the VNC viewer on Ubuntu, click Applications > Accessories > Terminal. If connecting to another Ubuntu computer, type the command given by Ubuntu. If connecting to a different Linux distro, the same format applies: vncviewer ComputerNameOrIP:#, such as Figure 1 shows. This consists of the command, vncviewer, followed by the name or IP address of the computer (or the Internet IP when connecting through the web), ending with a colon and the tunnel ID. If connecting to a Windows PC, omit the colon and display number; just type vncviewer ComputerNameOrIP.