Wednesday, 16 June 2010

How-to: Remote Control Desktop Cients

Gnome-rdp & xtightvncviewer
There are times when you want access to a computer which isn't the one you're sitting at:
  • If you want to run it 'headless' (no monitor, keyboard, mouse)
  • If you want to provide remote technical support to a friend, relative, customer.
  • If you want to access a machine in a different part of the house and can't be fagged to use your legs and walk.
This is where Remote Desktop connection comes in, using either the Remote Desktop Protocol (RDP) or Virtual Network Connection (VNC) protocols. This is one step up (or, if you're a hardcore Linux guru, step down) from command-line only SSH connections as you get the full graphical user interface at your disposal. Assuming the remote machine has a graphical user interface...

To turn on Ubuntu’s version of Remote Desktop is easy, as everything comes installed by default in Lucid 10.04. Go to ‘Settings,’ then ‘Preferences,’ then ‘Remote Desktop.’

The checkboxes:

  • ‘Allow other users to view your desktop’ button turns on remote desktop. By itself this grants view-only access. This is ok for on-line demonstrations or problem diagnosis.
  • ‘Allow other users to control your desktop’ enables other users to control your computer, allowing remote support, installs.
Best practice (and good sense) recommends you implement a security password; at the very least check the option for request permission for each connection.

The VNC server scans the machine and notifies the local machine IP address on the local network. Note this down. Anyone wanting remote access will need to know the address of the remote machine in order to connect.

First Stop Vinagre
Ubuntu 10.04 Lucid comes with vncserver and Vinagre client, a VNC-compatible remote desktop viewer.

Choose ‘Applications,’ then ‘Internet,’ then ‘Remote Desktop Viewer.’  you’ll see all the desktops you can open on your current network. you can always enter the IP you want to connect to directly.

Bitten by the bugs
Before you get very far you may well find you hit a bug which affects VNC in several distributions of Linux, it's been around since at least 2007 on Ubuntu.
Bug:   vinagre (Ubuntu): Status New, Undecided, Unassigned
"I am able to log in to the remote pc and the inittial display state show up, but if i try to click or open anything nothing happens in desktop viewer. if i look at the actual monitor connected to the remote pc i could control everything remotely. Also to add to the oddness on the remote desktop viewer i could see the mouse refresh only but none of the actions or screen gets refreshed. very odd!"
I hit this: The connection is good, you have remote control but the client is unable to refresh (redraw) the screen in the local window. To my mind not much use.

You can use the recommended work-around given:
"until we get a true "Fix" for this, try going to the visual effects tab (right click on desktop, change desktop background, select the Visual Effects tab, and select the radio button for "None" So far, this allows me to access the desktop via Vinagre with no real issues... if ANY of the desktop effects are enabled, connection is no longer workable..."
You would think this is a bug in Compiz, however I hit this bug while Compiz is off on both local and remote machines; Metacity is my window manager under a fresh 10.04 Lucid with Nvidia proprietary drivers. It isn't a Compiz bug per se.

The same in bug exists in Fedora:
Bug 214446  - Remote Desktop (VNC) does not update VNC Client when 'Desktop Effects' enabled 
Vinagre flavoured-chips
(Ok, pointless sub-head) Vinagre gives you a working, full colour, resizable remote desktop window. Very, very slowly. Vinagre's architecture and use of the VNC protocol leaves it workable but painful.

Gnome-rdp and xtightvncviewer
There's another option available from the repositories: Gnome-rdp as a VNC control panel with xtightvncviewer as a client with the vnc4server that you already have. If you're cool with hacking your own config files, you can get by without Gnome-rdp and just use the viewer.

Xtightvncviewer is light, fast, has a simple set of well-documented configuration options. When running the default cursor is an inconvenient dot, but the screen refreshes are instantaneous. Xtightvncviewer clearly makes better use of the VNC protocol.

Passing strangely
If you go with Gnome-rdp, it appears to falter at the session login options. The reason? There is no "default" Keyring assigned automatically in Lucid. I am not sure if this is a bug or a feature. However, GnomeRDP is expecting the default keyring to be set to "login", for which you will need to go to: 'Accessories' then 'Passwords and Encryption Keys' menu.
  • Right click on the "Passwords: login" item.
  • Choose "set as default" from the context menu.
VNC sessions run under Gnome-RDP will then connect without issue.  RC

1 comment:

  1. Here is the answer to the bug guys, on how to do it without changing the effects:

    1) Open a terminal o press ALT+F2, then run/type: gconf-editor
    2) Go to /desktop/gnome/remote_access and enable "disable_xdamage"

    I found it found here:
    http://swiss.ubuntuforums.org/showthread.php?t=1496368

    ReplyDelete

At least try to be nice, it won't kill you...