Linux remote desktop with VNC 

Joined:
04/07/2009
Posts:
49

February 08, 2010 04:36:31    Last update: February 08, 2010 05:10:57
If you have X server on the client side, you can run remote desktop with XDMCP. But XDMCP is not secure, and it's somewhat tricky to tunnel XDMCP through ssh. So if you are concerned about security, VNC is a much better choice. Plus vncviewer is a lot easier to set up than X server.

There are two options to set up VNC server:
  1. VNC vino-server
    Many Linux distros come with remote desktop server installed. On Fedora Core, you can simply set the configuration from the Desktop menu (Desktop -> Preferences -> Remote Desktop), and use vncviewer from the client machine to access the desktop remotely.

  2. Install RealVNC or TightVNC and configure it yourself
    You need to change ~/.vnc/xstartup in order to see the desktop instead of a simple gray background and xterm.

    The default xstartup file looks like this:
    #!/bin/sh
    
    # Uncomment the following two lines for normal desktop:
    # unset SESSION_MANAGER
    # exec /etc/X11/xinit/xinitrc
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    twm &
    


    change it to (for gnome):
    #!/bin/sh
    
    unset SESSION_MANAGER
    exec /etc/X11/xinit/xinitrc
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    startx&
    


    or (for KDE):
    #!/bin/sh
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    startkde&
    


If you need tighter security, it's pretty easy to setup an SSH tunnel for VNC.

[ Comment  | Tags ]