This is just a bug workaround:
If you log in through Xvnc (I use it with xinetd) and see the gdm screen, log in to gnome fine, but then after that your keyboard comes out scrambled, here's a quick and dirty fix (you'll have to do this from a console that is working, maybe SSH?):
sudo mv /usr/share/xmodmap/xmodmap.us /usr/share/xmodmap/xmodmap.us.bkup
Of course, this only works if you were using the US keyboard layout. This is not ideal, but it gets the job done in this particular case.
The fix for this is apparently already in the upstream code and should be available in the next gnome update from Ubuntu.