Remotely Manage Machines Using VNC

VNC stands for Virtual Network Computing. It is, in essence, a remote display system which allows you to view a computing `desktop’ environment not only on the machine where it is running, but from anywhere on the Internet and from a wide variety of machine architectures.

Install vncserver (as root) in Debian

This package provides a vncserver to which X clients can connect and the server generates a display that can be viewed with a vncviewer.

It contains an X server connector so clients can connect to your local X desktop directly.

Note: This server does not need a display. You need a vncviewer to see something. This viewer may also be on a computer running other operating systems.

#apt-get install vnc4server

Choose your desired window size and color depth, then, as an ordinary user, open a terminal and type:

#vnc4server -geometry 1024×768 -depth 24

This will prompt you to create a password:

You will require a password to access your desktops.

Password:
Verify:

This will save a scrambled password in the file ~/.vnc/passwd.

Example

This is what i got from my debian machine

# vnc4server -geometry 1024×768 -depth 24

You will require a password to access your desktops.

Password:
Verify:
xauth: creating new authority file /root/.Xauthority

New ‘debiantest:1 (root)’ desktop is debiantest:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/debiantest:1.log

Once that’s been done you can create a new server by invoking

#vnc4server

This will start a new server and show you the “desktop” it is running upon. This is something that you’ll need to know when connecting to the server.

The server will start and tell you where to access it

Example

This is from my debian desktop

#vnc4server

New ‘debiantest:2 (root)’ desktop is debiantest:2

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/debiantest:2.log

Connecting to VNC Server

I am using windows xp client to connect to debian server (where vnc server is running) for this you need to download vnc viewer.There are many VNC viewers i am using tight vnc viewer downloaded and install from here

Open the VNC viewer on your remote machine, enter the hostname:screen (use a hostname or IP that your client machine understands).

Enter your password here

your Linux desktop will open in a window with grey background with console you can see the screen as follows

[thumb:473:c:l=p]

from here if you want to open gnome or kde you need to enter the following

For KDE

#startkde

For GNOME

#gnome-session

I am trying to strat GNOME session and you can see in the below screen

[thumb:472:c:l=p]

I have started my GNOME session and you can see this in action in the following screen

[thumb:474:c:l=p]

Network speed and processor power will affect performance, but it’s amazing how many apps will run fine under VNC.you can use productivity applications without any trouble.

To kill the server enter a command similar to this, using the appropriate settings

#vnc4server -kill :2

If you wish to change the way your VNC server runs you’ve got a couple of choices.

You can modify the global configuration by editing the file /etc/vnc.conf copy this file to your home directory and naming it .vncrc will affect just servers you start.

Another option is to adjust the window manager that remote users will recieve.

if you have the GNOME desktop installed for your use you might wish incoming connections to use a more light-weight window manager such as IceWM. To do that you need modify the file ~/.vnc/xstartup.

Installing VNC Client in Debian

#apt-get install xvnc4viewer

Once it’s installed you can connect to a running server by using:

#Xvnc4viewer hostname

If invoked with no arguments you’ll be prompted for the host you wish to connect to, and if necessary a password.

If you are looking alternative to vnc server package you can check x11vnc check here for more information.

Sponsored Link

17 thoughts on “Remotely Manage Machines Using VNC

  1. This works the other way around too. We use VNC on our windows servers – the enterprise version with AD authentication functionality.

    I use the windows VNC enterprise viewer on my linux workstation with wine and it works a treat! 🙂

  2. >This works the other way around…
    Much better performance by enabling RDP on the MS machine and connect with rdesktop (krdc is a gui frontend). Use VNC for desktop sharing in helpdesk situations.

  3. You may want to have a look at ultravnc (www.ultravnc.com), especially if you also work with windows workstations. It supports AD authentication and costs 0. You can also use their single-click feature (SC) that allows you to configure a packaged .exe that will allow you to take control of a remote computer, even if it hasn’t VNC installed. See the recent entry here

  4. if you like vnc, then you’ll even better using vnc over ssh.
    besides the added compression, ssh encrypts as vnc sends your password in ‘clear text’. 🙁

    if you like vnc over ssh, then you’ll like even better nx (www.nomachine.com)–nothing better. period.

    But don’t take my word for it–you can get your own free personal server edition of nx.

    OK, that should do it.
    (static line noise !@#$%^&* crackle) blip.

    Good article.

  5. I’ve been using TightVNC to connect to FreeBSD on a home net. Now I’d like to logon, from work using Putty/TightVNC, to the FreeBSD box, via
    XP Pro box/Ananlogx portmapper.

    I believe I’ve VNC’d into the XP Pro box:22 and got Analogx’d to the FreeBSD box.

    How do I verify TightVNC’s route?

  6. In case any one else is struggling to get XFCE desktop working with VNC I offer the following suggestions.

    Make sure that your xstartup file has “& xfwm4 & xfce4-panel &” in it.

    Without the xfce4-panel included I just get a terminal window. Which was fine for a while, but I certainly prefer to have the whole panel.

  7. I followed the above instructions with debian etch install and my initial (and future) VNC screen doesn’t have a temrinal window, its just all grey !! Help !!

    I can logon locally, just not using VNC.

    Anyone know how to fix?

  8. thanks for the howto

    i tried to get this running before on a earlier ubuntu (edgy, when this was first posted) but had issue’s when upgrading to feisty so i have used the built in libvino to view my home ubuntu gateway/firewall just enable remote desktop sharing on the server(system->preferences->remote desktop) & feed it the password instead of having YOU allow the connection. I also DO NOT have gdm running at startup & prefer to login via ssh & ONLY if needed i then start gui land (/etc/init.d/gdm restart) as this forces me to learn more cli & is more secure

    however since upgrading to intrepid ibex as my main home desktop i find it easier to use the ‘secure remote login’ (vnc over ssh) from within the login screen (power on & from login screen click: options->sessions->secure remote login) i have also used this from a friends house and it works a treat & its fast too but the log out can be a bit slow but the 3 finger linux salute (ctrl+alt+backspace) seems to sort it.

  9. Hi, Thanks for this tutorial, however vnc4server is not running at boot.
    The only time i’m able to connect using vncviewer is after i have logged into my linux server and start vnc4server. I would like vnc4server to run on boot and not have to manually start it.
    I have the same issue with ssh also.

    Any help would be appreciated.
    Mumrah,

  10. Hey. Very informative article regarding managing machines remotely using VNC. In addition to it, one can even consider deploying on premise remote support appliance such as Bomgar or RHUB appliances OR can even use various remote support tools such as logmeinrescue, gosupportnow, GoToMyPC etc. in order to remotely access computers.

Leave a comment

Your email address will not be published. Required fields are marked *