If some keys on the keyboard do not work correctly in a virtual machine, you can set a property that makes a modification to the map. To change how a specific key is mapped, you add the appropriate property to the virtual machine configuration (.vmx) file or to ~/.vmware/config.

Prerequisites

  • Verify that the X server is an XFree86 server running on a PC. If the X server is remote, configure it to use key code mapping. See Configure Keyboard Mapping for a Remote X Server.
  • Determine the X key code and the corresponding v-scan code for the key. To find the X key code for a key, run xev or xmodmap -pk. See V-Scan Code Table for most v-scan codes.
  • Power off the virtual machine and exit Workstation Pro.

Procedure

  1. Open .vmx or ~/.vmware/config in a text editor.
  2. Add the xkeymap.keycode.code property and set it to the v-scan code.
    code must be a decimal number and the v-scan code must be a C-syntax hexadecimal number, such as 0x001.
    In this example, the properties swap left Ctrl and Caps Lock.
    xkeymap.keycode.64 = "0x01d # X Caps_Lock -> VM left ctrl"
    xkeymap.keycode.37 = "0x03a # X Control_L -> VM caps lock"