De link por Richard Holloway:
Apparently setting the keyboard layout you wish to use when logging in solves this problem.
When logging in, as you are about to enter your password in GDM, there is a discreet menu option on the toolbar at the bottom.
Changing the setting here will cause Ubuntu to use the correct keyboard setting not just for that session but for subsequent log ins.