Why is my keyboard mapping wrong with Xming, Lubuntu in VirtualBox and Putty?

I am running Lubuntu in a VirtualBox guest on a Windows 7 host.

I have started the X server XMing on the host.

I use Putty with X-forwarding to ssh into the guest and use it to start lxterminal.

This works pretty well except that my Swedish keyboard presses are not coming across correctly. The effect is that I seem to be using a US keyboard although I am not. E.g. when I press 'ö', ';' appears in the terminal. The same happens in xterm too.

Running this in the lxterminal:

$ setxkbmap -v 10 -query

Produces:

Setting verbose level to 10
locale is C
Applied rules from xorg:
rules:      xorg
model:      pc105
layout:     se
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+se+inet(pc105)
geometry:   pc(pc105)
rules:      xorg
model:      pc105
layout:     se

So it seems that the layout is set correctly. Right?

Is there anything I can do?


Solution 1:

There is an option called "Additional parameters for Xming" in configuration of Xming/XLaunch. If you pass something like

-xkbmodel pc105 -xkblayout us,se -xkboptions grp:ctrl_shift_toggle

You will have the same effect as in solution from Peter but without using any other programs. Found solution here: http://my.opera.com/paintenzero/blog/xmi

Solution 2:

I solved it myself. By chance I discovered the command lxkeymap. It seems to be the same dialog that is used to select keymap when installing Lubuntu. In it, Sweden was selected, but Swedish was not, so I selected that and pressed Apply. Now it works as it should!