Linux Remote Desktop – Part 2: Connect to GDM or KDM login screen using VNC
Welcome to Part 2 of Linux Remote Desktop Series. I highly recommend that you see the basic assumptions and background before you read this any further.
What we will learn: In Part 1 we learned how to do Remote Desktop with “Desktop Sharing” method. However in that method it is not possible to do remote desktop unless we physically log in to the machine first. This is really not convenient for system administrators who are trying to manage a Linux serve. Every time a server has to be restarted you will need to physically go to the machine and log in first and then only you can remotely access the machine. The trick is to start the VNC server when the GDM or KDM script is called. I will show you how to do with GDM.
Step 1: Edit the GDM initialization file
# nano /etc/gdm/Init/Default
go at the very end of the file and add the following line just before “exit 0″ line:
/usr/lib/vino/vino-server
Save and quite the file.
This basically tells GDM initialization script to start the VNC server before the script exits.
Let’s suppose you now try to connect to your Linux box after you restart the machine without physically login. What you will see is that you are able to see the GDM login screen remotely. However as soon as you enter your username and password the connection will break. This happens because GDM kills all the clients before it exits. So we need to do the following step in resolve the final issue.
Step 2: Edit GDM configuration file
# nano /etc/gdm/gdm.conf
and find the daemon section which will be something like [daemon]. Now add the following line in this section:
KillInitClients=false
Save and quit the file.
That’s it! Now go to your Machine 2 which either can be Windows or Linux machine and try to connect to your Linux server remotely after a fresh restart and you should be able to see the GDM login screen and once you enter your username and password you should be able to log into your GNOME desktop./session.
Remember that whatever we have seen so far in these 2 parts is “Desktop Sharing” method i.e. you will share the screen with another user who is also connected remotely to Linux server (Machine 1) or with the person who is physically present on the Linux server.
In next part we will see how to connect with individual user login in which the remote user does not have to share the desktop.
Part 3: Connect to remote Linux server with XDMCP protocol


Email Subscription









April 17th, 2009 at 12:00 am
[...] this post? You may like these too:Linux Remote Desktop – Part 2: Connect to GDM or KDM login screen using VNCAnnouncement: Linux Remote Desktop SeriesHOWTO: Autologin into your Linux system without XDM, GDM, [...]
April 17th, 2009 at 12:01 am
[...] Part 2: Connect to GDM or KDM login screen using VNC> [...]
November 22nd, 2009 at 2:12 pm
vino-server MUST be launched in background or gdm will hang!
/usr/lib/vino/vino-server &
Reply to this comment
June 1st, 2010 at 10:18 pm
Has anyone gotten this to work in Squeeze? My remote client just hangs indefinitely trying to login, vino-server is running on the server and once I log in locally manually to the server then I can get remote VNC access.
Reply to this comment
fahadysf Reply:
November 9th, 2010 at 9:45 am
I am having the exact same problem as unclecameron. For now I am going to enable autologin. But I sure would like to know what causes to hang up the VNC client at negotiating protocol version.
Reply to this comment
lukestuts Reply:
January 24th, 2011 at 4:29 am
Same problem here, these instructions don’t work in Ubuntu 10.04.1 (Lucid)! My vnc client gets stuck on ‘Protocol version negotiated’. Perhaps the vino client needs to run as a different user?
Reply to this comment
February 19th, 2011 at 12:28 pm
I have tried to apply this tutorial to my recently install Debian 6.0.0-i386 server, in order to remotely access to the desktop even before the first login, however, after the restarting, it remains in a black screen and I never get the login screen neither from the physical keyboard nor from the remote one.
Would you be so polite to help me on this?
Kind regards
Juan C. Farina
Madrid-Spain
Reply to this comment
May 12th, 2011 at 11:35 pm
Hi jaun,
Do this
Administration -> Login screen
Go to “Remote” tab, Use “Same as local” option in “style” field.
RESTART the machine.
Reply to this comment
August 1st, 2011 at 1:34 am
[...] session. You can however boot the machine in init 4, so you can connect to the login manager http://linux.koolsolutions.com/2009/…een-using-vnc/ Kind [...]
October 18th, 2011 at 7:24 pm
Im also having problem.i wish someone could give me an easy tutorial on how to complete the steps.please.
Reply to this comment
November 17th, 2011 at 1:01 pm
[...] the official vino webpage. Seems rather lack lustre somehow.) You could try using vino with GDM http://linux.koolsolutions.com/2009/…een-using-vnc/ http://jakeyoon.com/2008/11/19/enabl…gdm-in-ubuntu/ (Put 'gdm vino' in to Google for more like [...]