Logging in to the GUI from the shell

I have an Ubuntu 12.04 LTS server running GNOME shell,that I occassionly have to remotely access to perform some maintenance. I usually vpnc into the network and then simply use vncviewer to access the Gnome GUI desktop for testing,given that the account is logged in. The other day I had to reboot the server remotely and had forgotten that the system was not set to automatically login. Having issues trying to get the automatic login to work correctly, I had to call someone at the site to log me into the desktop. Is there a way that I can login in the GUI account from the cli remotely so I can continue with testing using the gui for that account? My display Manager is GDM not LightDM.

Does your VNC not let you see the login screen itself? Perhaps it can be configured to do so. Other than that I don't think it can be forced from the outside, as it were -- it's a local login screen, if it accepts input from non-local sources that's a severe bug.

thanks for the response.

No it will not allow me to view anything until the user is logged in. I enabled remote desktop sharing from with preferences of GNOME. I beleive it uses Vino under the hood:

ps -ef|grep -i vino 
testuser   2357  2227  0 Oct04 ?        00:00:01 /usr/lib/vino/vino-server --sm-disable

You have a good point in seeing if maybe vino can be configured to allow the user to see the login in screen at the GDM manager login. I will look into it a give some feedback soon. I do rememeber me using X2VNC before.

If you can log into the cli remotely you should be able to run the following from the command-line to start the Gnome desktop:

gnome-session

Unless this changed in Gnome 3 that should start the desktop.

If i use tightvncserver, ssh to the server then start it:

tightvncserver

and then connect with a client, i get the default gui (xfce in my case. I don't use a display manager, so i can't say anything about it).

I just ran into xvfb. It works if there is no remote gui running too. But as far i can see yet i can only connect as root (ssh to server, run "Xvfb" as root, that takes a while, and then exit ssh and connect from client).