Remote desktop with dual monitors, Ubuntu (and ATI)

I have a Linux machine with only two cables connected: a power supply and a network cable. As I’m lacking a KVM switch that supports two DVI monitors, I need remote access. And the story would already be over here, if there wasn’t two monitors in the introduction.

To configure desktop forwarding from Linux to either Windows or another Linux can’t be too hard – at least I thought so, as there are x2go, NoMachine NX, Xming and some other tools around. If nothing works, there should still be the possibility to use an X11 terminal on another tty as last resort (story still not over, as there is ATI in the title).

Tools and dual monitors

To make it short: I couldn’t make any tool I tried – x2go (sad thing, I liked that one), NX, Xming, remmina, cygwin – to display a (usable) dual monitor desktop. However, they are all well suited for a single monitor or single applications (I would recommend Xming as ’ssh -X‘ for Windows).

The key aspects of my Linux desktop: Ubuntu 11.10, Gnome 3 (classic) with Compiz on a ATI HD 4850 graphics card.

So, remote X on tty8 then (XDMCP)

Although I first didn’t like the idea of having the remote desktop on another tty (in the end, pressing Strg+Alt+<Nr> is not that different from Alt+Tab), I started looking around for a tutorial that explains how to configure an X server as terminal server.

I’ve taken the basic steps from here, for Kubuntu 11.10 with KDE4 which is running on the remote machine, they are slightly different.

Adapt kdm settings

There are some changes that have to be done to the default kdm and X config. First remote xdmcp requests must be permitted:

  1. [Xdmcp]
  2. # is explicitly set to false by default
  3. Enable=true
  4. ...
  5. ...
  7. [X-*-Core]
  8. # if you want to shutdown the machine without entering the root pass, set to 'All'
  9. AllowShutdown=All

Next, the machines that should be served must be specified by their IPs, host or domain names, wildcards are available:

  1. # remove the # before the asterisk and every machine can login
  2. #*     #any host can get a login window
  3.  # only allow this IP to connect
  4. ...
  5. # the same holds for the chooser setting
  6. #*     CHOOSER BROADCAST       #any indirect host can get a chooser

Before restarting the remote machine, you should check whether listening for incoming  TCP requests is disabled by executing  ‚grep -r nolisten /etc/kde4/kdm/‚ – if you get something like

/etc/kde4/kdm/kdmrc:#-nolisten tcp

everything is fine (Maybe I’m getting old, I remember disabling this option but couldn’t find the lines I remembered).

Establish the remote connection

After rebooting the machine you can now connect to its X server by invoking X :1 -query <target ip address> as root. I use another tty for that so I don’t have a busy terminal on my desktop.

fglrx errors

The first attempt to connect to the remote machine resulted in two errros:

(EE) fglrx(0): incompatible kernel module detected - HW accelerated OpenGL will not work
(EE) fglrx(0): Not enough video memory to allocate CMM buffer (width = 64, height = 64, 
                                                                          alignment = 4096)

The first might have been due to the fact that the Plasma desktop was configured to use OpenGL. I changed that to xrender. This assigns graphical effects to the CPU, not perfect but works. In the same step I updated fglrx on my desktop with the most recent version from the AMD/ATI website. Finally I configured Gnome on my desktop to use Metacity as window manager instead of Compiz.

The last step probably didn’t contribute to the solution, but as I did all changes at once, I can’t tell for sure.

Security note

XDMCP exchanges unencrypted messages between X server and terminal. Hence it is no good idea to use it over networks with untrusted peers, e.g. the Internet, as this also implies that keyboard inputs (passwords, …) are transferred in clear-text.

Leave a comment

Your comment