Keyboard layout in Cloudmin's KVM graphical console


Here's the problem : - Our KVM host, our KVM virtual machines and the laptop (Macbook Pro Osx 10.6) from witch I connect to KVM all have a CH_fr keyboard layout.

When I connect to the Vm's, either from my laptop or from the host : no problem. keyboards OK.

But when I access the Console through Cloudmin's java vnc client : my qwertz becomes qwerty, and It's a pain to find all the necessary characters... :(

So where's the bug ?





That is really odd .. so do you mean that there are certain keys on your keyboard that do not send the expected character through to the console of the KVM virtual machine?

VNC should normally just be passing through whatever characters you type. Unless java is doing something funny and ignoring the local keyboard mapping ..

It's exactly that.

I tried from a Macbook Pro with Firefox, From an iMac with Firefox and from a PC (Win Seven) with Internet Explorer and Firefox. Always the same problem. All are set with "Swiss French" keyboard layout.

And as my root password has special characters, it's really annoying : I simply cannot login from the java console. It network is up, no problem : I ssh from a terminal window and it works. But id network is down, I'm locked out of the VM if I use some special characters in the password....

Besides, when I type somme characters, I have an error message (see attached picture).

And when I type the $, I get a 4, as if "numlock" was on. And if I turn "numlock" on, typing $ does nothing.

Very strange. As if the java vnc client wasn't aware of the computer's locale...

I have a feeling this is a Java issue..

If you go to Webmin -> Others -> SSH Login, can you login OK and do the right characters appear?


I tried, but I cannot succeed to login via this SSH Login menu if the password contains special characters. The applet gets offline as soon as I type the password.

The characters are correct in the login popup, but the java client appears to interpret them wrong.

I tried i another Macbook Pro freshly installed with os 10.6.4, and the symptoms are the same.

This really looks like a Java issue then, as that SSH login applet was written by someone completely different .. I don't think there is anything Virtualmin can do to fix it.

Java applets don't even know about keyboard mappings - all they do is accept characters provided by the Java runtime. This thread has some useful suggestions though :

Ok. I'll have a look a that thread.

But here's something strange that makes me think it's not only related to that java applet :

I just tried on another server, running webmin 1.520 (not virtualmin), connecting from the same Macbook Pro.

I clicked on "Others" / "SSH Login". The java applet seems to be exactly the same than in Virtualmin. And this time it works ! The right characters are passed to the console. This servers runs Debian Lenny.

Could it be an issue with RHEL5/CentOS5 ?

It seems unlikely this would be a server-side issue, as the server has no knowledge of the actual keyboard layout at all ..

Right. So I'm completely confused. Would it be usefull for you to try to connect to this Cloudmin server ? There's nothing on it for the moment.

Did you try changing the keyboard mapping settings in your java preferences?

I doubt if me connecting would help, as I have a US english keyboard..

There's no reference to keyboard mapping in my java preferences.

But I'm not sure it's related to my laptop or browsers, as I tried on several other computers, including some running on Windows XP or Seven.

On all of them, I the webmin java console works just fine, but the one in Cloudmin would mess up the characters...

Hi, after some research, I think I'ts not a java related, nor a console-data related problem , but rather related to the way the VNC server are started in Cloudmin :

Where are the qemu config files stored for KVM VMs created in Cloudmin ?

Interesting, that might actually be the fix.

Try doing this :

  1. Get the KVM instance's ID with the command cloudmin list-systems --host --id-only
  2. On the cloudmin master, edit the file /etc/webmin/servers/ , where XXXX is the ID from step 1.
  3. Add or edit the kvm_args line , and set it to : kvm_args=-k fr-ch
  4. Shut down and then re-start the VM
  5. Try accessing the console again.

Let me know if that helps..

BIngo !

It works.... I've got a good Swiss QWERTZ. Most characters are OK : aA-zA, 0-9, &/()=3"

BUT : some characters are still unrecognized : $£çéàè..

Maybe the vnc keyb-map fr-ch is not complete ? When those are pressed, I get a "atkbd.c : Unknown key released..." error.

Also : if I reboot the server, the keymap is not loaded : I have to stop and restart the VM's for the fix to work.

Still, it's a good improvement.

Thanks you.

Update :

After having de-activated libvirtd, no need to restart the VMs for the right keymap to be loaded anymore.

Still, some special characters are unrecognized (see above).

Cool, thanks for working on this .. it looks like the issue is not actually on the client side at all, but rather in the console emulation done by KVM. I am working on making the keymap more easily settable via the UI.

Not sure about those special characters though.

You're welcome. Glad to know that helps a little bit.

Concerning the problematic special characters, you don't experience the same with the US keyboard ?

Just to be curious. I can live with that little annoyance.

Thanks for the help. Do you sleep sometimes ? ;)

I haven't run into this on my own system, probably because my own keymap is US english and my KVM virtual machines also use that keymap. I'm not even sure how to type characters like : $£çéàè

It's only 6pm here in California, so not time to sleep yet :-)