How do I run a remote Linux desktop in Windows?

The ability to connect from Windows to Linux is all you need to make administrating from a central location much easier. Jack Wallen explains.

Recently I wrote an article "How Do I Connect to a Remote Windows 7 Desktop from a Linux Machine" and was asked to show how to do the same trick -- the other way around. You might assume this trick to be a challenge. You will be surprised how little of a challenge it really is.

But first off, you might be asking yourself "Why would I need this?" The answer is to use a single point of administration. How many times have you scurried around computers to try to resolve a problem only to have to waste time going back and forth. With the previous article, you were given the means to connect from Linux to Windows. Now, with the ability to connect from Windows to Linux, you have all you need to make administrating from a central location much easier. And with that said, let's get on with the setup.

This blog post is also available in PDF format in a free TechRepublic download.


First and foremost I am going to assume both Windows and Linux desktops are operating correctly and are on your local LAN. To make things simple, I will use the 192.168.1.x IP addressing. And, as you could assume, it's always easier (in this case) when the IP addresses are static (otherwise you will find yourself tracking down IP addresses of your desktop machines).

Software used

There are only two pieces of software necessary:

  • x11vnc: Installed on the Linux machine to use as the VNC server
  • TightVNC: Installed on the Windows machine to use as the VNC client

Installing the Windows software is straightforward for most users. Just download the installer and double-click. For many Windows users, the installation of the Linux software might not be as straightforward.

Of course, the Linux installation will depend on your distribution. But basically all you have to do is follow these steps:

  1. Open up your Add/Remove Software tool (such as Synaptic, Ubuntu Software Center, gnome-packagekit, etc).
  2. Search for "x11vnc" (no quotes).
  3. Select the results for installation.
  4. Click Apply to install.

Now, if you are more comfortable with the command line, you can install the Linux software like so:

  1. Open up a terminal window.
  2. Issue a command like sudo apt-get install x11vnc (this will depend on the distribution you use).

Once all the software is installed, you are ready to go.

The Linux side

This is really quite easy. All you have to do is start the x11vnc server. If you look at the manual page for x11vnc (issue the command man x11vnc), you will see numerous options available for the server. One of those options you might want to consider is the -forever option. If you don't add this option to the command, your x11vnc server will die as soon as the client quits the session.

So the command you will want to run, from the terminal, is:

x11vnc -forever

You will notice you do not get your prompt back. Even if you add the & character, x11vnc will not return you to your prompt. Because of this, you might want to consider adding a line like x11vnc -forever to the end of your /etc/rc.local file. This will ensure your x11vnc server is started at boot.

The Windows side

Now it's time to connect. You've already installed TightVNC on the Windows machine, so go to the Start menu and fire up TightVNC. When you open the tool, a small window will appear (Figure A) that allows you to enter an address for the connection as well as open the Options window.

Figure A

Make sure you select the Connection Profile that best matches your connection type.
In the Options window (Figure B), there are a number of items to configure. Unless you need a specific configuration, the default generally works pretty well.

Figure B

You will notice that you can set TightVNC in View mode, which effectively connects the client to a noninteractive session. This is always good for training purposes.
After you make all your configurations, click the Connect button, and the connection will be made (Figure C). The speed at which TightVNC runs will vary depending on the speed of your network. But you should find it to be a very workable solution.

Figure C

Select options and make the connection.

Final thoughts

And there you have it -- a simple way to make the connection between the Windows and the Linux desktops. Your administration world just got a bit easier.

Stay on top of the latest XP tips and tricks with TechRepublic's Windows XP newsletter, delivered every Thursday. Automatically sign up today!

By Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic, The New Stack, and Linux New Media. He's covered a variety of topics for over twenty years and is an avid promoter of open source. For more news about Jack Wallen, visit his website jackwallen....