1. Tech

Your suggestion is on its way!

An email with a link to:


was emailed to:

Thanks for sharing About.com with others!

Linux Newbie Administrator FAQ: X-Windows

Part 4 of the Linux Newbie Administrator Guide

4.3.11 How do I Display and Control a Remote Desktop using VNC
(continued after the ads...)

Related Resources
Linux Newbie Administrator Guide
0. Linux Benefit
1. Before Installation
2. Linux Resources/Help
3. Basic Operations FAQ
4. Newbie Admin FAQ
~ 4.1 Lilo
~ 4.2 Drives
~ 4.3 X-Windows
~ 4.4 Configurations
~ 4.5 Networking
5. Shortcuts / Commands
6. Linux Applications
7. Learn Linux Commands
A. How to Upgrade Kernel?

(VNC = Virtual Network Computing). A very useful application--don't miss it.

VNC is a cross-platform utility that allows me to display a remote graphical desktop over a standard network connection. For example, I can use VNC on an MS Windows PC to display an X-window environment of my mighty Linux server downstairs, or the other way around. VNC will even run over a 56k modem networking, but probably only for fun or in emergency (too slow a connection for normal work).

Recent Mandrake or RH will have vnc on their distributions CD. The MS Windows version you have to download yourself. See http://www.uk.research.att.com/vnc/ for download information and more details.

On Linux, VNC consists of four commands: vncserver, vncviewer, vncpasswd, and vncconnect. I typically need just two of them: vncserver and vncviewer. A brief description of the commands follows.

The server that has to be running on the host (remote) computer. You start the server as the user whose desktop will be displayed (don't run the server as root or somebody else somebody may kidnap your computer!).

The local application wich connects to the vncserver and displays the remote environment. You need to know the password and ip address of the server to connect.

Password selection utility for vncserver. The server won't run without password (good behaviour). Therefore, if you don't select one, it will prompt you. Hence, I don't need to explicitly run vncpasswd.

Tells vncserver to connect to a listening VNC viewer on the given computer and port. This way I can avoid giving anybody a password.

A "master" program that I don't really need to run directly (vncserver and vncviewer are scripts which call Xvnc).

For a list of all available options I run:
Xvnc -help

It is not recommenced to run the VNC server as root due to potential security issues. If you need root privileges, login as a user and then execute su

Two examples of "typical" sessions follow.

Example 1. Sitting at an MS Window computer, I can display an X environment from my Linux server, using the following sequence:

[start a DOS terminal and type in the following command]
telnet my_linux_server_name
[log in to your user account on Linux and type in it the following command]
[provide a really good password of your choice when prompted; mine was "357+Simon&Garfunkel"]
[re-enter the same password for confirmation]
[watch the messages and note the screen number on which the server is started; mine was ":4"]
[From the "Start" menu on the MS Windows computer, select "Programs" - "Vnc" - "Run VncViewer"
[in the input box that appears, type the server ip address and screen number as shown on the next line]
[in the input box that appears type the password as follows]
[an X-windows desktop should now appear on top of your MS Windows desktop]
[do your work as you normally would in Xwindows]
[when done, switch to the telnet session window and type in it the following two commands]
vncserver - kill :4

Example 2. Sitting at my Linux X desktop, I can display and remotely control an MS Windows computer screen. Hopefully, nobody else is using this MS Windows computer at the same time, because I move its mouse pointer.

[Walk to the MS Windows computer because you probably cannot telnet it]
[From the "Start" menu, select "Programs" - "Vnc" - "Run WinVnc (app mode)"
[From the "System Tray", click the mouse right button on the "Vnc" icon, and select "Properties"]
[In the dialog box that appears, fill in the password. Leave the screen number on "auto".]
[Walk back to your Linux desktop]
[Start an X terminal and type in it]
vncviewer ms_windows_server_name_or_ip
[When prompted, type in the password]
[a MS Windows desktop should now appear on top of your X]
[do your work as you normally would on MS Windows]
[When done, right click on the Vnc icon in the system tray and select "Close VNC".]

Next > Part 4.4: Basic Configurations (Printer, soundcard...)

Can't find what you are looking for?
Search the

Stay up-to-date!
Subscribe to the Linux free newsletter.

  1. About.com
  2. Tech
  3. Linux
  4. Linux 101
  5. Linux FAQ - X Windows

©2016 About.com. All rights reserved.