Zend certified PHP/Magento developer

Keyboard layout completely messed up – running a VM on a server

I am connected to a vnc server and am viewing it using a vnc viewer. On the vnc server, there is a VM. Both the vnc server and the VM are running the latest version of Ubuntu.
My computer’s keyboard layout (I’m using Windows) is set to German.

The keyboard input is processed just fine on the vnc server, but the VM gets it completely wrong. E.g. pressing on “-” on the German keyboard will print out a “ß” in the VM.

The closest to correct input I can get on the VM is if I set my Windows keyboard layout to “US”, after which almost all keys get processed correctly (ä, ö etc.) except for the < key, which is read as # instead (the # key itself is also read as #, there are just two # keys).

According to the output of the command localetcl status, the keyboard layout of the VM is correctly set to German, while the keyboard layout of the vnc server is not. As far as I can tell, I can’t change the keyboard layout because I don’t have sudo permission on that server. What the hell is happening here, can someone please help?

note: I have been unable to type | on any keyboard so far, so I might not be able to use grep