Some versions of VNC have a bug in which the keyboard map is set up wrong. This means different characters appear on the remote machine to what you actually typed.
Add the following to your ~/.vnc/xstartup just under the #!/bin/bash line.
export XKL_XMODMAP_DISABLE=1
Ubuntu 10.10 users:
If the ‘d’ key causes your windows to minimise themselves…try the following
System->Preferences->Keyboard Shortcuts Scroll down to "Hide all normal windows and set focus to the desktop", click to highlight, and hit the backspace key to set the shortcut to "Disabled".