Friday, July 18, 2008

Taking control on a PC stuck at GDM

Have you ever been in the situation where you PC at work have rebooted and is now sitting at the GDM display waiting for you to enter a username and password ? Well this happened few times to me. The solution is rather simple. You only need to have an ssh access to your PC.

1 ) Logon to your PC using your ssh access.
2 ) install (if not already there) x11vnc : sudo apt-get install x11vnc
3 ) The tricky part is that gdm using a different xauth file than X11 server. So you need to find out which and where this file is. A simple ps -ef | grep gdm will give you the answer :

jboismar-desktop ~ # ps -ef | grep gdm
root 5683 1 0 11:12 ? 00:00:00 gdm
root 5684 5683 0 11:12 ? 00:00:00 gdm
root 6300 5684 0 11:31 tty7 00:00:00 /usr/bin/X :0 -br -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
gdm 6313 5684 0 11:31 ? 00:00:01 /usr/lib/gdm/gdmgreeter
root 6320 5726 0 11:33 pts/0 00:00:00 grep --colour=auto gdm

The part you need is : -auth /var/lib/gdm/:0.Xauth

4 ) then you launch x11vnc with this argument. I usually use root :
jboismar-desktop ~ # x11vnc -auth /var/lib/gdm/:0.Xauth

The last lines should look like this :
18/07/2008 11:35:18 WARNING: the warning message printed above for more info.
18/07/2008 11:35:18

The VNC desktop is: jboismar-desktop:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval. It should work with any VNC viewer. Try it by running:

x11vnc -ncache 10 ...

more info: http://www.karlrunge.com/x11vnc/#faq-client-caching


5 ) You can then run a vnc client to access your remote screen. Once you login, GDM will terminate to start the X server. Your x11vnc program will also terminate at this point.

Tuesday, July 15, 2008

Compiling Synergy on Ubuntu 8.04

I'm using a lot synergy at work to use one keyboard/mouse to control my laptop and my desktop. It's a wonderfull software. Unfortunately, it is buggy in Ubuntu 8.04. So I decided to re-compile and see if it is any better.

First, you need to get the latest cvs tree :
cvs -z3 -d:pserver:anonymous@synergy2.cvs.sourceforge.net:/cvsroot/synergy2 co -P synergy

now, go to synergy/src directory and try a ./configure. In my case it ended up like this :
checking for X... no
checking for XTestQueryExtension in -lXtst... no
configure: error: You must have the XTest library to build synergy

After googling everywhere, I finally found this page. So, to get the XTest library, we do :
sudo apt-get install libxtst-dev

Then we need to specify where synergy can get the X include and library files :
./configure -x-includes /usr/include -x-libraries /usr/lib --prefix=/usr

and voila ! The configure process should now be happy. You can then make and make install.