Skip to main content

Remote Control - VNC Style!

posted onOctober 16, 2001
by hitbsecnews

By: L33tdawg

Why go into the office when you could 'be there' from home? Sitting in the comfort of your favorite pair of shorts, hair in a bedraggled state, teeth un-brushed and face unwashed. It’s not like anyone can see you right? Telecommuting has become more and more popular in the past couple of years, what with broadband proliferation and what not, more workers are choosing to stay home as opposed to battling the rush hour traffic just to get to their 4 x 6’ cubicle.

For a Windows user, you really have no lack of options when it comes to picking a remote control application in order to aid you in your telecommunication task, but Linux users might find themselves in a bit of bind.

What if you’re at home and want to use a dial up PPP connection or a VPN to access your desktop PC or server at work? Or perhaps you’ve got a secondary machine In another part of your house (tucked away in a closet perhaps), and its got an application on it you need to run, but the thought of dragging that box out of the closet and locating a monitor just seems like ‘too much work’. What tools do you use?

On the Windows platform, there are a multitude of choices – Norton’s PC Anywhere for instance and CA’s ControlIT. There are also several thin client remote application server platforms available as well, like Citrix Metaframe and Terminal Server for Win2K, both of which are specifically designed for multi user application hosting. On Linux, we now have both SCO’s Tarantella and GraphOn’s Bridges, which allow you to run X and Microsoft Windows applications remotely and display them in your web browser. However, these specialized application servers can be expensive and are probably overkill for the standard remote console activities. Certainly you can also remotely execute X applications using Xfree86 itself, but the X protocol requires a significant amount of network bandwidth to work well, and X doesn’t help very much if you want to control a Windows machine or a Mac remotely from a Linux box.

Enter VNC

If you don’t have a truckload of cash to throw for a sophisticated remote access and application server setup, there’s VNC (Virtual Network Computing). Developed at the AT&T research lab in Europe, VNC is an open source, free software product that delivers high performance remote control console capabilities for Unix and Linux, as well as Microsoft Windows and the Macintosh. Sounds pretty cool doesn’t it?

VNC basically has two parts – a client application and a server application. The server is available for practically every variant of Unix as well as for Microsoft Windows and MacOS. Basically, you can connect from a Linux machine to a computer running a VNC server by using the native compiled vncviewer for Linux. The VNC server also offers a built in Java web interface that you can use to run applications remotely and to display their output in Netscape.

VNC is available directly from the VNC site at http://www.uk.resarch.att.com/vnc/download.html. The binaries contain both the server and the VNC viewer for Linux. In addition to the Linux version, you’ll want to download versions of VNC for all the platforms that you are going to control remotely such as Windows or another flavor of *NIX.

I won’t go through the installation instructions for the Windows server or client, as it’s almost as simple as double clicking the installer and following through with the basic setup. Once you’ve downloaded the Linux version of VNC, you’ll want to untar the files into a directory such as /home/vnc and then copy the files vncserver, vncpasswd, vncviewer and the Xvnc to your /usr/bin/ directory. If you want to be able to remotely control your Linux computer via the VNC server’s integrated Java interface, you’ll also need to create the subdirectory /usr/local/vnc/classes. After creating this directory, copy the VNC Java .class files to it.

Next you’ll want to make sure the PERL scripting language is installed on your machine and that the Perl interpreter is located in /usr/bin/perl. Chances are that is it, but if it isn’t you’ll need to modify the first line of the vncserver script to reflect the actual location. Once you’re done with all this you can start you VNC server by issuing the command for the terminal window.

You’ll be asked to set a password for the server, and the script will display a message indicating it has started on display:1. By default, VNC is configured to use the twm window manager, which is extremely minimalist. The settings for the default window manager are stored in a file called xstartup that is located in a hidden subdirectory named .vnc located in your home directory. Twm may be minimalist but generally speaking, you probably don't want to run KDE or GNOME over a remote connection. They take up a considerable amount of system resources and it wouldn’t be too light on the network either. If however you’re planning on running this off your home 10/100Mbps network – you might be able to get away with it.

To test out your server, you can run vncviewer xxx.xxx.xxx.xxx:1 where xxx.xxx.xxx.xxx is your computers IP addy or hostname, and the :1 refers to the display session. If you installed the Java classes, you can also connect to the vncserver by launching Netscape or IE and entering the URL http://xxx.xxx.xxx.xx:5801. Again, xxx.xxx.xxx.xxx is your IP address.

The vncviewer Java applet should load in your browser and you’ll be prompted to enter the server password that you set earlier. If you want to control a Mac or a Windows machine, keep in mind that those systems only have one default display, Therefore you will want to connect to them using port 5800. When using the various GUI viewers for different platform, keep in mind that by default, the viewer initiates its session using a 16-bit color depth. If you’re on an internal 10/100 Mbps LAN, you shouldn’t run into any problems, but I certainly wouldn’t recommend trying this across the Internet on a 56K modem.

Once you’re happy with the way your VNC configured system is running, I’d recommend port scanning your machine and locking down port 5880 and port 1 to only allow connections from trusted machines. Even though there is a password query-challenge for the server, I wouldn’t be able to sleep at night knowing that anyone could connect to the machine. Thus based on how you’ve got your network setup, limiting access to only machines that need to be served connections is a good idea. But apart from all that – experiment, and have fun.

Peace.
L33tdawg.

1.) Understanding IP Fragmentation - spoonfork
2.) A Comprehensive Intro to MySQL - madirish
3.) Remote Control - VNC Style! - L33tdawg
4.) A Comprehensive Intro to PHP - madirish
5.) Layoffs : How to conduct one, and how to recover from one - Diet Coke
6.) Welcome to Hell... Ehr Australia - Archfiend

Source

Tags

Intel

You May Also Like

Recent News

Friday, November 29th

Tuesday, November 19th

Friday, November 8th

Friday, November 1st

Tuesday, July 9th

Wednesday, July 3rd

Friday, June 28th

Thursday, June 27th

Thursday, June 13th

Wednesday, June 12th

Tuesday, June 11th