the capslock functionaliy is reversed in Ubuntu

Ubuntu 20.04.3 LTS is running in virtualbox. The CapsLock is reversed when I turn it on.

Due to this when I have to type in lowercase I have to turn keyboard's CapsLock ON and when I have to type in uppercase have to turn OFF the CapsLock.

How to fix this CapsLock issue?


This can sometimes happen on certain OSes in Virtualbox when you save the machine state with capslock set to ON.

You should be able to fix it by setting capslock to ON on your keyboard, saving the machine state, switching capslock OFF on your keyboard and then restarting the VM.