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

Free 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