Linux optimize

How to connect to and from Windows 7 and Linux using TightVNC

For cross-platform remote administration between Windows and Linux, Jack Wallen shows you how to set up TightVNC for connecting both ways.

One of the single most important aspects of a computer, from an administrative standpoint, is the ability to handle administration remotely. Nearly every operating system offers tools for such a task, but what do you do when you want to go cross-platform? The best bet is VNC (Virtual Network Computing). If you are connecting to a Windows Terminal Server the task is simple...but if you want to connect to a Windows desktop from a Linux client, you might find yourself having trouble connecting to RDP. Instead you want VNC and the best way to get VNC is by using TightVNC.

TightVNC is a free VNC tool that offers both a viewer and a server for Windows clients and a server for Linux clients. Let's take a look at how to set up the necessary servers on both operating systems so you can log in remotely.

Linux to Windows

As you would expect, the installation of TightVNC is simple on a Windows client. All you need to do is download the correct installation file from the TightVNC download page, double click, and walk through the installation. It's very straight-forward.

Once you get TightVNC installed, however, the straight-fowardness flies out the window. In order to make a connection to that machine the TightVNC server must be configured and started. In order to do this you first must click Start | All Programs | TightVNC | TightVNC Server (Application Mode) | TightVNC Server - Offline Configuration. From this window, click on the Server tab (see Figure A) and configure TightVNC server to fit your needs.

Figure A

You are required to set a password for incoming connections and this password can not be blank.

The minimum you need to set is a password. Once that is set you are ready to start the server. In order to start the server click Start | All Programs | TightVNC | TightVNC Server (Application Mode) | Run TightVNC Server. You will not see any applications launching since this is just a daemon running in the background.

Now from your Linux box, open up your default remote desktop viewer, enter the IP address of your Windows VNC server and connect. You will be prompted for a password before the connection will be completed.

If you are not sure what VNC viewer to use, my personal favorite is Vinagre, an easy-to-use VNC viewer for the GNOME desktop.

Windows to Linux

This one is a bit easier. I will show you how to set up this connection on an Ubuntu 10.10 machine. The first step is to install tightvncserver. To do this, follow these steps:

  1. Open up the Ubuntu Software Center.
  2. Search for tightvncserver (No quotes).
  3. Click the Install button for tightvncserver.
  4. Enter your sudo password.

Once this is complete you are ready to connect. Follow these steps to get the server running.

  1. Open up a terminal window.
  2. Issue the command tightvncserver.
  3. You will be prompted to enter a password.
  4. Enter a view-only password if needed.

You are now ready to connect to your Linux box with the TightVNC Viewer. To open up this tool, click on Start | All Programs | TightVNC | TightVNC Viewer. When this new window opens you will need to enter the IP address with the port 5901 included. So the location will be 192.168.100.21:5901. If you do not enter the port, the Windows version of TightVNC Viewer will assume the port to be 5900 and will not be able to connect.

Upon successful connection you will prompted for the password set when you initiated the server on the Linux machine. With successful authentication you will be connected (see Figure B).

Figure B

TightVNC Viewer to tightvncserver means easy remote administration of a Linux machine from a Windows host.

Final thoughts

There are plenty of ways to connect to a remote machine. Having a uniform method (such as using TightVNC both ways) simplifies the task on numerous levels. How do you make your remote connections? Do you use VNC, RDP, or another third-party software (such as Logmein)? Share your remote experiences with your fellow TechRepublic viewers.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

12 comments
mirekturon
mirekturon

Isn't easier to use other software, like Team Viewer, it's free and you don't have to be worry about routers and firewalls and port forwarding.

james.dioudis
james.dioudis

For Linux to windows you can also use the the remote desktop software (or command line ) from ubuntu to login to a windows machine. It works really well with XP and i haven't tried it with windows7.

mloucel
mloucel

Sorry Newbie here but in the router/firewall which ports should I open I assume they are udp's but I have no idea which one, and from a remote session if I have let's say 3 computers (for ex.) so I guess I need to specify different ports for the 3, 4, 5 or 6 of them? I have used teamviewer and 0 config but I'm open to this..

Raymond Sirois
Raymond Sirois

Before bothing with downloading and installing tightvncserver, see if a remote desktop piece is already installed. Using the Ubuntu 10.xx example (also valid back to 8.04, maybe further), click on System on the menu bar, then Preferences. There should be a menu item called Remote Desktop. Open that, enable the option "Allow other users to control your desktop" and the option "Allow other users to view your desktop". Make the appropriate Security changes, and you're ready to go. The Remote Desktop piece is VNC compatable and part of the default Ubuntu software load

shabana
shabana

I have all windows machine in our network. VNC is the best anywhere in the world.

rpr.nospam
rpr.nospam

For effective remote administration over the Internet you'll also need some software that is able to establish peer to peer VPN connections through firewalls and NATs. Does anyone have experience with some free and open cross-platform software for that purpose? -- rpr.

chrisbedford
chrisbedford

Having deployed it far and wide, I'd be reluctant to change to anything different in a hurry, UltraVNC is reliable, simple, and /fast/. Earlier versions were unstable on Win2K3 but they seem to have that sorted out now (RDP is not always the best way to do things - for instance you may need the remote user to see what you are doing, and certain downloads when initiated from the Terminal Server session, pop up in the console session where you have no way to accept or specify the save path). So while on the topic of cross-platform, according to the documentation for Apple, MacOS supports VNC natively. Has anyone had any success with this? I tried going through all the procedures they specified but it *just didn't work* (no response when trying to connect to the Mac, as I recall)

Neon Samurai
Neon Samurai

Doesn't Team Viewer provide a central server so you and the other end are actually connecting into a third party? If security is a concern, remote desktop apps that don't involve a third party in what is a two party connection may be preferred.

DimHelmet
DimHelmet

The remote desktop viewer in Ubuntu 10.10 is Vinagre, which is mentioned in the article.

Neon Samurai
Neon Samurai

You can get an AES plugin for UltraVNC which saves you having to fire it through a VPN connection. You'll also be encrypted when inside your own network. Not sure if tightvnc can use the plugin on the *nix side though. Great for Windows to Windows.

douglas.fulcher
douglas.fulcher

I used tightvnc to connect from Windows to Mac, krdc from Linux to Mac and usd the "connect to..." dialog for Mac to Mac. Make sure your preferences are set to allow remote control of the system on the Mac side. Allow remote administration to ssh to the system if you want a secure tunnel. Mac to Mac is easy enough: open the connect to dialog and use vnc://servernameoripaddress and click connect. Enter your user I'd and password. Once Mac to Mac works, you should be able to use any vnc client from windows or nix to connect. Good luck.

Chipv
Chipv

I have 15 MACS in my office that i use UltraVNC for connecting with. Setup Ultravnc viewer on your PC. Load a VNC client like chicken of the vnc on the mac and set the appropriate permissions.