Skip to content

Linux VMs, RDP considerations

cajhin edited this page Jan 31, 2021 · 3 revisions

There are some minor complications to keep in mind when using software that gets low-level keyboard input.

Linux VMs

Auto Capture Keyboard

VirtualBox has a setting menu > Input > Keyboard > Keyboard Settings > Auto Capture Keyboard
(VMware has something similar).

This has two 'features':

  1. Without guest extensions installed, the keyboard is automatically redirected to the VM when it is in the foreground (with guest extensions, this always happens)
  2. The VM grabs key input from a lower level, before Windows processes it.
    If the option is unchecked, then Windows processes the keystrokes first, and only sends it to the VM if it is not a Win shortcut.

The latter has two implications:

  • Windows shortcuts (e.g. to Win+E to start Explorer) don't work when the VM has focus (might be desirable though)
  • The VM tracks its own CapsLock state, independent of Windows. This messes with key(CAPSON) and key(CAPSOFF), since capsicain always queries the state of CapsLock in Windows; it doesn't know anything about a Linux VM. You cannot turn Linux Capslock OFF when it is already off in Windows.

I always uncheck the auto capture keyboard feature.

altChar()

My config produces špèçïãl characters with Windows standard "Alt + NumPad" combos.

Linux does not understand those combos. For special chars in Linux, you'd have to create a config that uses the Linux system (Ctrl+Shift+U, unicode number, space).

Remote Desktops

RDP connect window has a setting tab > Local Resources > Keyboard > Apply Windows key combinations.

This decides if, for example, an Alt+Tab changes apps on the local machine or on the remote desktop.

This also has impact how keypresses are processed and buffered.

Basically, with the setting off, everything works.

With the setting on, you must slow down the send function with

[ESC]+[.] or
OPTION DelayForKeySequenceMS {milliseconds}

otherwise, key events will be dropped randomly. How much delay your RDP needs, depends on how fast your network is. Usually 1-10 ms in my environments.