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).
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:
- Open up your Add/Remove Software tool (such as Synaptic, Ubuntu Software Center, gnome-packagekit, etc).
- Search for "x11vnc" (no quotes).
- Select the results for installation.
- Click Apply to install.
Now, if you are more comfortable with the command line, you can install the Linux software like so:
- Open up a terminal window.
- 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:
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 sideNow 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.
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.
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.
Select options and make the connection.
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!
Jack Wallen is an award-winning writer for Techrepublic and Linux.com. As an avid promoter/user of the Linux OS, Jack tries to convert as many users to open source as possible. His current favorite flavor of Linux is Bodhi Linux (a melding of Ubuntu and Enlightenment). When Jack isn't writing about Linux he is hard at work on his other writing career -- writing about zombies, various killers, super heroes, and just about everything else he can manipulate between the folds of reality. You can find Jack's books on Amazon, Barnes & Noble, and Smashwords. Outnumbered in his house one male to two females and three humans to six felines, Jack maintains his sanity by riding his mountain bike and working on his next books. For more news about Jack Wallen, visit his website Get Jack'd.