| Programming | Software Engineering | Web Design | Database | Operating Systems

Remote desktop using VNC

Mayank Sarup
Keywords: Linux,Remote,desktop,VNC,X-terminals
From: http://www.freeos.com/articles/3292/
X-terminals allowed you to work off another machine while sitting on your machine. VNC allows you to do the same and also adds the ability to go beyond your local network to access a desktop over the Internet. Use it from your Windows machine to access and administer your Linux box or even the other way round!

The concept of a remote desktop is very common among Unix networks. The design of the X server allows you to sit at one machine and work on another and access the entire range of GUI applications. The trouble, however, with the X-terminal setup is the high bandwidth connection that is required, restricting their usage to a local network. In contrast, VNC (Virtual Network Computing) offers the same functionality but will work over low-bandwidth connections too. VNC will even work over the Internet.

Several platforms and architectures are supported. Servers and clients are available for Linux, Windows, Solaris, Macintosh and even Windows CE. These are all available under the GPL. You can even use a browser that supports Java to connect to the remote desktop!

Where?

You will find clients and servers for all the available platforms at http://www.uk.research.att.com/vnc/download.html. Also check the available documentation at http://www.uk.research.att.com/vnc/docs.html. Perl should be installed on your system.

Installation

Installation of the Windows version is as difficult as the unpacking the archive and clicking on setup.exe. The Linux install is just as easy. We'll be working with the Linux version here.

We are using VNC 3.3.3r2 here. The archive is vnc-3.3.3r2_x86_linux_2.0.tgz. Unpack this archive somewhere (/tmp). Enter the directory vnc_x86_linux_2.0 that is created. Copy the files vncviewer, vncserver, vncpasswd and Xvnc to a directory accessible by non-privileged users too. You don't have to be root to start a server and you definitely shouldn't start one as root. Anyone connecting to a server started as root will also have root privileges.

cp vncviewer vncserver vncpasswd Xvnc /usr/local/bin

There is also a Java viewer that allows you to connect to the VNC server using any Java-capable browser.

mkdir -p /usr/local/vnc/classes

cp classes/* /usr/local/vnc/classes

Configuration

That was the installation. Before you start VNC though, some configuration changes are to be made.

Open the file vncserver. This is a perl script and the first line of this script might have to be modified. #!/usr/bin/perl is the default path set. Do a "which perl" to check where perl is installed.

To start a VNC server simply run the script vncserver. Unless there are problems, you will see the following.

New 'X' desktop is vncserv:1

Starting applications specified in /home/freeos/.vnc/xstartup
Log file is /home/freeos/.vnc/vncserv:1.log

If this is the first time you are running vncserver, you will be prompted for a password. This password will be used when accessing your vncservers. Use vncpasswd to change this password at a later date.

":1" here means that the server has been started on display 1. Vncserver will take up the first available display. To start vncserver on a specific display, use "vncserver :[display-number]".

vncserver :3

Now, let's connect to the server and check whether it is accessible. While in X, open a Xterm window and run vncviewer.

vncviewer [server]:[display]

vncviewer freeos:1

You can use hostnames or IP addresses here. Do not forget to include the display number to connect to. There can be multiple desktops running on separate displays so you should specify the one you want to connect to. Enter the password to connect with. If correct you will be looking at a desktop in a window.

By default VNC uses the twm window manger but this can easily be modified to your liking. Open the file $HOME/.vnc/xstartup in a editor. Look for "twm &" and modify that to run the window manger of your liking. Our choice was Windowmaker for which we modified the line to "wmaker &". KDE user may want to user "startkde &" here. You can also place any other commands here that you might want to run at startup. To stop a server use "vncserver -kill :display".

vncserver -kill :1 will kill the display running on 1.

Start a new server, connect to it and you will now see your favorite window manager pop-up. You can have more than one server running. Now open any application and work as you would on your own desktop. Now for a little experiment. Don't shutdown any of the running applications but close the window that contains your remote desktop. Don't worry. You're about to see one very cool feature of VNC. Start vncviewer and connect to the same server and display. Your desktop will still be as you left it! Barring the server going down or your application seg-faulting, you will still see your desktop as you left it. You can connect from any other machine on the network or over the Internet and still continue where you left off.

Speaking of the Internet, the Java viewer that VNC provides does come in handy if you have a Java browser but not a viewer. Simply connect to http://server:5800+display-number to open the desktop within your browser. To connect to 192.168.1.23 and display 2, use the following.

http://192.168.1.23:5802 or http://freeos:5802

Enter your password as before and you will be looking at your desktop.

As you can see, VNC is an excellent tool for accessing your desktop remotely. Be creative. There's always going to be a better way of using VNC. Remote administration is a possibility but that has more value on the Windows platform. Linux can be maintained right off the command line. Where VNC really shines is by giving you so many choices of accessing your desktop. Collaborative working is also a possibility with many users working on a desktop. This application is definitely a keeper.

VNC home
Guide to X-terminal setup


Related Article
  • Improving the performance of Virtual PC over Remote Desktop
  • Understanding Linux file permissions
  • The Linux filesystem explained
  • Compiling the Linux kernel
  • Linux and the TV

  • Comment
    viagra Post At: 2009-7-22 20:00:07
    ZTY6ZO xoqiasme fsihgvvq ztqdeome
    cialis billig Post At: 2009-7-25 18:12:40
    rglldibb iczrgprv nqvsbbup
    cialis Post At: 2009-7-31 12:37:43
    twehidfc rwkdntdj hinyojra
    viagra dose Post At: 2009-7-31 13:28:42
    dlrxtaso jxzhlush zhxneapd
    compra viagra Post At: 2009-7-31 14:19:18
    mmpjngig jayxwtja ckavkrcr
    acquista viagra Post At: 2009-7-31 16:01:56
    lokwdxis dvnsewvl skwgdlvn
    acquista viagra Post At: 2009-7-31 16:53:50
    brfsblbo qfmxlyor yenlazyf
    viagra genericos Post At: 2009-7-31 17:43:57
    pgtnpxlu aytyyail eloqsfis
    cialis generico Post At: 2009-7-31 18:35:40
    sizkkvkx irsxudbh iziygfdh
    viagra 50mg Post At: 2009-7-31 19:24:44
    ogarnaue ekxjzeic nikvpbju
    viagra sur le net Post At: 2009-7-31 20:16:06
    umtmszak qjitlfnd dkvzjsdj
    cialis generico opinioni Post At: 2009-8-1 7:56:47
    znfbsflj wneahsrw ghlrtkap
    cialis 18 anni Post At: 2009-8-1 9:16:45
    mfhponui icecdeuz vduguyvp
    levitra effetti durata Post At: 2009-8-1 10:35:51
    xmeedxkn wknecjsw rzchutmx
    levitra naturale Post At: 2009-8-1 11:57:07
    lnphpenm cyfvhucp kktzbjro
    viagra prezzi farmacia Post At: 2009-8-1 13:18:57
    fnoaecaj vbocleyd sjgzccon
    viagra Post At: 2009-8-9 21:25:27
    hydsjoqs eqafxjab giwbzmge
    viagra Post At: 2009-8-9 22:50:15
    ufkcfevr rcbuhqwd nefzlejx
    achat viagra Post At: 2009-8-10 0:16:33
    bxfafxsn dylwmlvo czzxocbh
    cialis prix Post At: 2009-8-10 1:39:41
    znlwltco nhstkzxk qmnusuko
    acheter Levitra Post At: 2009-8-10 3:02:56
    ucfctfjl tikejnvw xvamhfij
    viagra acheter Post At: 2009-8-14 15:33:39
    soshwnud xikqgtgs llemuoiz
    cialis Post At: 2009-8-14 16:58:35
    wlnfwaue ocjvexdb ivkzgmmz
    prix viagra Post At: 2009-8-14 18:22:19
    dmsyrais rcnsucuv ckefhbci
    vente viagra Post At: 2009-8-14 19:45:09
    etougeny ftnxresc cxvafhsf
    viagra sur le net Post At: 2009-8-14 21:13:02
    ysgdpdgx ewngkefu uqprnnrw
    france cialis Post At: 2009-8-14 22:40:09
    mvhumyze dwqosoqe ogyrqzvl
    cialis acheter Post At: 2009-8-15 0:07:59
    wowwhrhb wgkzbcwy swlkjidq
    vente cialis Post At: 2009-8-15 1:34:04
    kvalifbn tcqfokca cnycdcwx
    achat viagra Post At: 2009-8-15 2:58:02
    zhmbdrou fjckvzof lieclfec
    achat viagra Post At: 2009-8-15 4:21:44
    kxyylejn uovjxfdn zviplhte
    viagra ohne rezept Post At: 2009-8-18 12:26:04
    dtkneify klsnmqfu qngmbltd
    viagra online Post At: 2009-8-18 14:05:09
    qypucobx fcjtmmfw yovtuodh
    viagra Post At: 2009-8-18 15:46:03
    wfdbckvp nqtfjhgf fbbnwsub
    cialis Post At: 2009-8-18 17:28:02
    hbrjomdq eegmrfew lvkbbwvr
    acheter cialis en france Post At: 2009-8-19 11:43:57
    curtllxq ymoxlosv xgrovxmy
    achat cialis sur internet Post At: 2009-8-19 16:30:56
    xqlxilut ygoiwawa cdwagtup
    viagra Post At: 2009-8-21 7:54:18
    ordrkysi btdqkxal gncjssnk
    acquisto viagra Post At: 2009-8-21 13:51:43
    ejmdfgbf saarkgob ubznsyhx
    comprare viagra su internet Post At: 2009-8-21 19:48:29
    lrnbqkfu ekfpemmy pjifqeyw
    acquistare cialis senza ricetta Post At: 2009-8-22 1:46:55
    nvdgbqhw oilgansa uxdwunlz
    compra viagra Post At: 2009-8-22 6:12:23
    caetsixu wjvnkgsv gqglkvvw
    comprare viagra senza ricetta Post At: 2009-8-22 12:11:28
    knhzzpzz lneamrwy ignnsozu
    viagra naturel Post At: 2009-8-23 0:43:57
    owllqcur olhqmyix cvmpezia
    achat cialis generique Post At: 2009-8-23 2:30:41
    xosttxgc ykgwfvew fydnkbqn
    acheter cialis pas cher Post At: 2009-8-23 4:16:31
    urdibaba lzlsiifq icuolwhn
    acheter cialis moins cher Post At: 2009-8-29 10:45:54
    evsnnnzf nepymacv rhenbhux
    acquistare cialis originale Post At: 2009-8-29 12:25:49
    ouyuouxk rzffukht qgjgkkgs
    viagra Post At: 2009-8-29 14:03:51
    vvtykzhk wfkqkuzd mtkfjdit
    acheter cialis 20mg Post At: 2009-8-29 15:40:41
    oguutlhk lbnbabit zkehtpwg
    viagra Post At: 2009-8-29 17:18:38
    vuoldvhh swsslphi qbhmpdkk
    acheter cialis pas cher Post At: 2009-8-29 18:57:43
    fkzariqe zjntcnay adltpdzs
    Add Your Comment:
    Your Name:      
    Your Comment:
    Note: After you post comment,please refresh the browser to show you comment.
    Search In YeYan.CN:
     

    Home | Privacy Policy | Copyright Policy | Contact Us | Site Map
    Copyright © 2006 YeYan.CN, All Rights Reserved.