Optimal VNC Server for Mac with Robust International Keyboard Support (German Layout Focus)


2 views

After extensive testing of Mac's built-in Screen Sharing and Vine Server, I've identified consistent keyboard mapping issues when connecting from Windows clients with German QWERTZ layout. The problem manifests in several ways:

  • Umlaut characters (ä, ö, ü) either don't transmit or map incorrectly
  • The "@" symbol (AltGr+Q in German layout) frequently fails
  • Modifier key combinations (especially with AltGr) behave unpredictably

After testing multiple combinations, these setups delivered the most reliable German keyboard support:

Option 1: TurboVNC Server + TigerVNC Viewer

# TurboVNC server installation on Mac
brew install turbovnc
/opt/TurboVNC/bin/vncserver

# TigerVNC Viewer connection command (Windows)
vncviewer.exe -PreferredEncoding=ZRLE -QualityLevel=5 -DotWhenNoCursor 192.168.1.100:1

Option 2: x11vnc with Custom Keymap

# Install and run x11vnc with German keymap
brew install x11vnc
x11vnc -display :0 -xkb -noxrecord -noxfixes -noxdamage -rfbauth /path/to/passwd -env XKB_IN_USE=1 -env XKB_DEFAULT_RULES=base -env XKB_DEFAULT_MODEL=pc105 -env XKB_DEFAULT_LAYOUT=de

These settings proved critical for proper German keyboard handling:

Parameter Value Purpose
XKB_DEFAULT_LAYOUT de Sets German keyboard layout
XKB_DEFAULT_VARIANT ,nodeadkeys Handles dead keys properly
XKB_DEFAULT_OPTIONS grp:alt_shift_toggle Allows layout switching

To diagnose mapping problems, use this AppleScript to log keyboard events:

tell application "System Events"
    repeat while true
        set keyPressed to key code of (key down event)
        log "Key pressed: " & keyPressed
    end repeat
end tell

Compare these logs between local and remote sessions to identify mapping discrepancies.


When connecting from a Windows machine with a German keyboard to a macOS VNC server, users frequently encounter key mapping issues particularly with special characters like ä, ö, ü, ß and modifier keys. The root cause lies in how macOS handles keyboard input events differently from Linux systems.

For native macOS VNC server (Screen Sharing), add these parameters to /Library/Preferences/com.apple.RemoteManagement.plist:


<key>Keyboard</key>
<dict>
    <key>SendKeyCodes</key>
    <true/>
    <key>UseSystemKeymap</key>
    <false/>
</dict>

1. RealVNC (Enterprise version):

  • Provides explicit keyboard layout negotiation
  • Supports custom keymap files
  • Command to enable proper mapping: vncserver -AlwaysShared -UseSystemKeymap=0

2. TurboVNC with custom keymap:


# Sample keymap configuration for German layout
xkbmap {
    model = "pc105";
    layout = "de";
    variant = "";
    options = "compose:rwin";
};

For TightVNC client on Windows, modify ~/.vnc/default.tigervnc:


[Connection]
Keyboard=de
SendLocalKeypresses=1
RemapKeys=0x5c:0x3a,0x7d:0x2b  # Specific remapping for German keys

This AppleScript helps reset keyboard mapping when connections drop:


tell application "System Events"
    do shell script "/usr/bin/defaults write com.apple.RemoteManagement RestoreKeyboardDefaults -bool true"
    do shell script "/usr/bin/killall -HUP ARDAgent"
end tell

Use this terminal command to monitor raw keycodes:


sudo dtruss -n WindowServer 2>&1 | grep -E 'KeyDown|KeyUp'

For VNC-specific debugging:


defaults write org.virtualbox.app.VirtualBoxVM VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled -bool YES